Skip to content

iPhone notifications for Claude Code, Codex, and builds

When a program in your tmux session rings the terminal bell, Muxly sends an end-to-end encrypted push notification to your iPhone or iPad. It works even when the SSH connection has dropped and Muxly is closed, because the host sends it. Claude Code, Codex, and any build or script can ring that bell.

Updated · Recipes tested with tmux 3.4, Codex CLI 0.154.0, and Claude Code 2.1.273

Before you start

  • Muxly connected to your host with tmux Integration on. Follow Use tmux on iPhone and iPad if you haven’t.
  • tmux 3.2 or later on the host, and the host can reach the internet. See the server requirements.
  • The host stays awake and online.
On this page

1. Enable notifications

  1. In Muxly Settings, turn on Bell Notifications. Allow notifications when iOS asks.
  2. Edit your saved host, turn on Notify for This Host, and save.
  3. Connect and open the tmux session you want to use.
Bell Notifications enabled in Muxly Settings
Bell Notifications is the app-wide switch.
Notify for This Host enabled with the Ready status
Ready means the host passed its bell check and this device is registered.

2. Send a test notification

Run this in a tmux shell on the host, then lock your phone before the ten seconds are up. Tap + for a fresh shell window if you need one.

Run on the host, inside your tmux shell
sleep 10; printf '\a'

printf '\a' prints the bell character. tmux notices it, and the hook Muxly installed sends the notification.

Muxly Lock Screen notification for Dev server, mobile-work session, build window
The notification names the host, the tmux session, and the window.

If nothing arrives, fix that first: see The test notification doesn’t arrive.

3. Choose what notifies you

Run the tool inside the tmux session you opened from Muxly, then set it up below.

ToolRings whenDelay
Claude Codeit asks for permission; it has finished and you haven’t typedabout 6 s; about 60 s (instant with the optional hook)
Codex CLIa turn completes; it asks for approvalimmediate
Any commandthe command exitsimmediate

Claude Code: approval requests and finished tasks

In Claude Code on the host, run:

Enter in Claude Code, inside tmux
/config notifChannel=terminal_bell

Claude confirms with “Set Local notifications to terminal_bell” and then rings the bell about six seconds after it asks for permission, and about a minute after it finishes if you haven’t typed since. On Claude Code older than 2.1.182, run /config, search for notifications, and choose Terminal bell.

Test it: ask for a one-line answer, lock the phone, and wait about a minute.

Optional: get the alert the moment Claude finishes

Add a Stop hook to ~/.claude/settings.json on the host. Claude Code sends the bell itself when it finishes, so it works inside tmux. Keep the setting above for permission prompts.

Merge into ~/.claude/settings.json on the host
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          { "type": "command", "command": "printf '%s' '{\"terminalSequence\":\"\\u0007\"}'" }
        ]
      }
    ]
  }
}

If the file already has a hooks section, add the Stop entry inside it. Restart Claude Code. The usual finished alert still follows a minute later and replaces the first one. Tested on Claude Code 2.1.273.

Notification setting · When alerts fire · Terminal notifications from hooks

Codex CLI: finished turns and approval requests

On the host, add these lines to ~/.codex/config.toml:

Edit the host’s Codex configuration
[tui]
notifications = ["agent-turn-complete", "approval-requested"]
notification_method = "bel"
notification_condition = "always"

bel makes Codex ring the plain terminal bell instead of a desktop-notification sequence that tmux may drop, and always stops it from waiting for terminal focus, which tmux doesn’t report unless you’ve turned on focus-events. If [tui] already exists, add the lines to that section. Restart Codex, give it a short task, and lock the phone.

Codex notification settings

Builds and scripts: when a command finishes

Ring the bell after any command, whether it succeeds or fails:

Run in the project directory, inside tmux
make; printf '\a'

Replace make with your command. Open the window to see the result.

Optional: a reusable bell command

Add this to ~/.bashrc or ~/.zshrc on the host, then run bell npm test or bell cargo build. It keeps the command’s exit status.

Add to your shell configuration on the host
bell() { "$@"; s=$?; printf '\a'; return $s; }

4. Open the notification

Tap it. If Muxly is connected, it opens that session and window. If not, it opens your host list and marks the host with a Bell badge; connect and pick the session. In a window with several panes, choose the pane running your task.

The build window open in Muxly after activating its notification
The build window, opened from its notification.

Common questions

Will notifications arrive after I disconnect or close Muxly?

Yes. The host sends them, so they don’t depend on the app or the SSH connection. The host and its tmux session must keep running, and the host needs internet access. Delivery is best effort: a notification can be delayed or dropped.

Does this work over plain SSH, without tmux?

No. Notifications rely on a hook Muxly installs in tmux on the host, so the host needs tmux Integration on, and only sessions you’ve opened from Muxly can ring.

Will I get a notification for the window I’m looking at?

No. Muxly stays quiet for the window you’re viewing, and bells from the same window replace each other, so you get one notification per window.

Can two devices get the same notifications?

Yes. Turn on iCloud Keychain on both devices so they share the delivery identity, then set up notifications on each device as above.

Is the notification content private?

Yes. The host encrypts the session and window names for your device; the relay only routes the message and never sees them. The hook lives in tmux’s memory and writes nothing to the host’s disk. Privacy policy.

What should I do after restarting the host or tmux?

Reconnect through Muxly and open a tmux session before starting work that should notify you. Reattaching reinstalls the hook.

Troubleshooting

The test notification doesn’t arrive

  1. Open iPhone Settings → Notifications → Muxly and enable Allow Notifications. Check that Focus allows Muxly.
  2. Check that Bell Notifications in Muxly Settings and Notify for This Host in the host settings are both on.
  3. Lock your iPhone and repeat the test. Muxly suppresses alerts for the window you are viewing.

If the test still fails, check the host’s notification status:

  1. Go Back to Hosts and edit the host. Choose Disconnect and Edit if asked.
  2. Read the status below Notify for This Host and follow its instructions. See the server requirements and tmux bell settings for more detail.
  3. Once it shows Ready, save, reconnect, open the session, and repeat the test notification.

The test works, but my tool doesn’t notify me

  • Claude Code: run /config and check that Local notifications shows Terminal bell. Allow about a minute after a response, and don’t type meanwhile.
  • Codex: check all three lines under [tui], especially notification_condition = "always", then restart Codex. Update Codex if it’s older than 0.147.
  • Build: the command has to exit. Watch mode never does, so the bell never runs.

If alerts stopped after a restart, reconnect through Muxly and open a session again.