Codex notifications: know when Codex is waiting for you

Guide · Updated · Checked against the Codex docs

Quick answer

To get notified when the Codex CLI is waiting on you, turn on notifications in the [tui] table of ~/.codex/config.toml, or set a top-level notify command there, which runs each time Codex finishes a turn (an osascript one shows a macOS banner). For approvals, a PermissionRequest hook in ~/.codex/hooks.json runs right before Codex asks. Whipback, a Mac menu bar app, builds on those hooks and cracks a whip across your screen once Codex has waited on you for 60 seconds.

The Codex CLI can tell you it needs you in three ways: its own terminal notifications, a notify command that runs whenever a turn finishes, and lifecycle hooks such as PermissionRequest. Whipback, a Mac menu bar app, builds on those hooks and cracks a whip across your screen. Here is each one, with examples you can paste.

When does Codex wait for you?

Codex waits for you in two moments: when it has finished its turn and needs your next prompt, and when it needs your approval before it acts, for example to run a command outside its sandbox. It reports the first to your notify command as agent-turn-complete, and runs your PermissionRequest hooks right before the second.

Does the Codex CLI notify you on its own?

Yes. The Codex CLI’s terminal interface can send its own notifications while you work in another window. You switch them on in the [tui] table of ~/.codex/config.toml, pick how the terminal is signalled, and choose whether they fire only while the terminal is in the background or all the time:

~/.codex/config.toml
[tui]
notifications = true
notification_method = "auto"          # or "osc9", or "bel"
notification_condition = "unfocused"  # or "always"

How do I get a macOS notification when Codex finishes a turn?

Set notify in ~/.codex/config.toml. Codex runs that command each time it finishes a turn and passes it one JSON argument. Today the only event type is agent-turn-complete, and the JSON carries type, thread-id, turn-id, cwd, input-messages and last-assistant-message.

~/.codex/config.toml (top level)
notify = ["osascript", "-e", 'display notification "Codex finished its turn" with title "Codex"']

To name the project in the banner, read the JSON with JavaScript for Automation, which ships with macOS:

~/.codex/config.toml (top level)
notify = ["osascript", "-l", "JavaScript", "-e", 'function run(argv) { const n = JSON.parse(argv[argv.length - 1]); const app = Application.currentApplication(); app.includeStandardAdditions = true; app.displayNotification("Finished its turn in " + n.cwd.split("/").pop(), { withTitle: "Codex" }) }']

Can a Codex hook tell me when it needs approval?

Yes. Codex runs lifecycle hooks from ~/.codex/hooks.json, or from inline [hooks] tables in config.toml. A PermissionRequest hook runs right before Codex asks for an approval. If the hook makes no decision, Codex shows its normal approval prompt, so a hook that only shows a banner changes nothing else:

~/.codex/hooks.json
{
  "hooks": {
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Codex needs your approval\" with title \"Codex\"'",
            "async": true
          }
        ]
      }
    ]
  }
}

What does Whipback add for Codex?

Whipback is a macOS menu bar app that uses Codex hooks so you can’t miss a waiting session. When Codex has waited on you for 60 seconds, a whip cracks across your screen with a banner naming the project. Point at an idle Codex terminal and slap your trackpad, or press ⌃⌥W, and it types “Continue.”.

  • It adds its own entries to ~/.codex/hooks.json after showing you the change, then asks you to trust them with /hooks in Codex.
  • It types only into a Terminal or iTerm2 tab whose foreground process is codex, only after Codex has finished its turn, and never into an approval prompt.
  • Whip Codex while it works and nothing is typed: its PostToolUse hook hands Codex a short “work faster” message as developer context after its next tool call.
  • The Codex CLI is supported. Support for the Codex desktop app is being tested.
  • macOS 14 or later, Apple silicon and Intel. No account, no analytics.
  • The download is free, and using it needs a license key. The first 100 keys are free; after that a license costs $3 to $9, paid once.

Which one should you use?

They work side by side. A common setup is notify for finished turns plus a PermissionRequest hook for approvals.

MethodFires onSetup
TUI notificationsCodex’s own events, while the terminal is in the background[tui] in config.toml
notifyEvery finished turnOne line in config.toml
PermissionRequest hookEvery approval requesthooks.json, then trust it in /hooks
Whipback60 seconds of waiting, then louderInstall the app

Sources