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:
[tui]
notifications = true
notification_method = "auto" # or "osc9", or "bel"
notification_condition = "unfocused" # or "always"
notificationscan also be a list, to keep only some event types.notification_methodsets how Codex signals the terminal:osc9sends a desktop-notification escape sequence, which only some terminals show, andbelrings the terminal bell. The default isauto.notification_conditiondefaults tounfocused: you are only notified while the terminal is not in front.
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.
notify = ["osascript", "-e", 'display notification "Codex finished its turn" with title "Codex"']
- Put
notifyabove the first[table]header. In TOML, a key written below a header belongs to that table. osascriptignores the JSON argument here. Codex ignoresnotifyin a project’s.codex/config.toml, so it has to go in your user config.- No banner?
osascriptnotifications come from Script Editor: allow it in System Settings → Notifications.
To name the project in the banner, read the JSON with JavaScript for Automation, which ships with macOS:
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:
{
"hooks": {
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Codex needs your approval\" with title \"Codex\"'",
"async": true
}
]
}
]
}
}
- Codex runs a hook you added only after you review and trust it. Open
/hooksin the Codex CLI to do that. If you change the hook later, Codex asks again. "async": trueruns it in the background, so Codex doesn’t wait for the banner.- Hooks are on by default.
hooks = falseunder[features]turns them all off. - A
Stophook also runs when a turn ends, but Codex expects JSON on its output. For finished turns,notifyis simpler.
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.jsonafter showing you the change, then asks you to trust them with/hooksin 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
PostToolUsehook 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.
| Method | Fires on | Setup |
|---|---|---|
| TUI notifications | Codex’s own events, while the terminal is in the background | [tui] in config.toml |
notify | Every finished turn | One line in config.toml |
PermissionRequest hook | Every approval request | hooks.json, then trust it in /hooks |
| Whipback | 60 seconds of waiting, then louder | Install the app |