AC Bridge

Codex CLI and Claude Code phone alerts: step-away guide

Last updated

The short answer To get phone alerts from Codex CLI or Claude Code while away from your desk, attach an async curl -s -o /dev/null hook that publishes to an open or self-hosted ntfy topic on Stop and PermissionRequest, keep long sessions alive inside tmux, or pair the ChatGPT desktop app with the mobile app if you use the desktop workflow.

Phone push notifications with ntfy hooks

Terminal sessions do not push to your phone out of the box. ntfy is an open-source HTTP pub-sub push service you can use on its public server or self-host. Subscribe to a hard-to-guess topic name in the ntfy iOS or Android app (treat the topic name like a password, or add auth on your own server), then trigger it from a quiet background hook.

Codex CLI: ~/.codex/hooks.json

Add Stop and PermissionRequest handlers, then start Codex and trust them once with /hooks. Pass -o /dev/null because ntfy returns JSON and Codex's Stop hook parses stdout; never use notify = ["curl", ...] in config.toml because notify appends the event JSON as an extra argument to curl.

~/.codex/hooks.json

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -o /dev/null -d \"Codex finished\" https://ntfy.sh/your-hard-to-guess-topic",
            "async": true
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -o /dev/null -H \"Priority: high\" -d \"Codex needs approval\" https://ntfy.sh/your-hard-to-guess-topic",
            "async": true
          }
        ]
      }
    ]
  }
}

Claude Code: ~/.claude/settings.json

Claude Code uses the same quiet pattern with "async": true so a slow network request never blocks the agent or leaks stdout into a hook decision. See the Claude Code hooks reference and Codex hooks and config.toml reference for matcher syntax.

~/.claude/settings.json

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -o /dev/null -d \"Claude Code finished\" https://ntfy.sh/your-hard-to-guess-topic",
            "async": true
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -o /dev/null -H \"Priority: high\" -d \"Claude Code needs approval\" https://ntfy.sh/your-hard-to-guess-topic",
            "async": true
          }
        ]
      }
    ]
  }
}

Official Codex desktop-to-mobile pairing

If you run Codex through the ChatGPT desktop app rather than the standalone CLI, OpenAI documents a remote connection workflow that notifies your phone and lets you approve actions remotely.

  1. Keep the host awake and signed in. Open the ChatGPT desktop app on macOS or Windows. Remote access stops if the machine sleeps, goes offline or quits the app.

  2. Pair from the desktop app. Go to Settings, Connections, Control this Mac or PC, pick Set up or Add, and scan the QR code with the ChatGPT mobile app (you cannot initiate pairing from the Codex CLI or IDE extension).

  3. Follow sessions on iOS or Android. Open Codex (or Remote) in the mobile app to see running tasks, receive alerts when a task completes or needs input, and respond. See Codex on mobile and the Codex notifications guide for desktop settings.

Running long tasks in tmux and background sessions

When stepping away or connecting over SSH, run your coding agent inside tmux so closing a laptop lid or dropping an SSH session does not terminate the agent mid-task.

Start, detach and reattach

shell

# Start a named session for your repository
tmux new -s agent-work

# Launch codex or claude inside tmux, then detach with Ctrl+B then D
# Reattach later from your desk or over SSH:
tmux attach -t agent-work

Keep terminal notifications passing through tmux

Add these two lines to ~/.tmux.conf and reload with tmux source-file ~/.tmux.conf so OSC 9 alerts and focus changes still work when you sit back down at the terminal.

~/.tmux.conf

set -g allow-passthrough on
set -g focus-events on

Phone push vs a room status light

Phone push alerts and ambient workspace lights solve two different parts of stepping away from your keyboard. Many setups use both together.

Situation Phone push (ntfy) Room status light
Out of the house or in another building Reaches you anywhere with mobile data or Wi-Fi. Not visible once you leave the room or home.
In the next room or at your desk with headphones on Adds lock-screen buzzes and ping fatigue across busy sessions. Silent glance across the room; zero phone unlocks or chimes.
Checking whether an agent is still working or stalled Shows past events only; easy to miss whether a run resumed. Continuous ambient state: working, waiting for approval or done.

Questions people ask

How do I connect Codex CLI to my phone?

Add Stop and PermissionRequest hooks in ~/.codex/hooks.json that post to an ntfy topic with curl -s -o /dev/null and "async": true, then trust them once via /hooks. For full remote chat replies from your phone, use the ChatGPT desktop app's QR pairing under Settings, Connections.

Can Claude Code alert my phone when a background job finishes?

Yes. Put an async Stop hook (and a PermissionRequest hook if you leave approvals enabled) in ~/.claude/settings.json calling curl -s -o /dev/null to your ntfy topic, and run Claude Code inside tmux so the session survives terminal disconnects.

Why should I pass -o /dev/null when curling ntfy from a hook?

ntfy responds with a JSON receipt on stdout. Suppressing response output with -o /dev/null (and running with "async": true) guarantees neither Codex nor Claude Code misreads the HTTP response body as hook output.

Do I need tmux to get phone alerts?

No. The ntfy hook works in any plain terminal window. tmux is only needed if you want to detach, reconnect over SSH or protect a long-running task from a dropped terminal connection.

Or let a light show it

When you are at home or moving around the office, a smart bulb in the hallway, kitchen or desk tells you at a glance whether Codex or Claude Code is still working, waiting for permission or finished, without adding more phone buzzes.

What it does

AC Bridge turns the smart lights and plugs you already own (Philips Hue, LIFX, Govee, WiZ, Home Assistant and more) into a status light for Claude Code and Codex. Your own ntfy phone hooks keep running alongside it because both agents run every matching hook concurrently.

What it follows

Claude Code drives all 29 agent states (needs permission follows Claude Code's permission_prompt notification); Codex drives 19 states (needs permission follows PermissionRequest and finished follows Stop). See how the Claude Code status light works and the Claude Code notifications guide.

What it costs

AC Bridge is free to use: one Claude Code profile and one Codex profile, each lighting one device on one repo at a time, with as many devices as you like switched on or off from the app. Pro is £12.99 once, not a subscription: as many profiles as you want for each agent, several devices in a profile, profiles on every repo at once, and your agent can control your devices. It works with the Claude Code or Codex you already run, on Windows, macOS or Linux, with no model API key to buy.

What it collects

LAN devices are driven straight from your machine and their keys never leave it; your account, settings, device list, usage counts and session states sync through our servers. Your prompts, code and session transcripts are never collected. Privacy policy.

Try it on your own lights Turn the lights you already own into a status light for Claude Code and Codex, and see from across the room when a session needs you. Get started free, or read the setup docs first. On Pro, ask Claude Code or Codex in plain English to switch, dim or recolour your lights, plugs and more. How MCP device control works