How to get Codex notifications

Updated 22 October 2026

Codex keeps working while you’re in another window, so you want to know when it finishes a turn or stops for your approval. It can tell you itself once you turn notifications on, a hook can alert you the moment it asks for approval, and you can answer it without going back to the terminal. Here’s each option.

The short answer

OptionTells you whenAnswer from it?
Built-in TUI notifications ([tui] notifications)Turn complete, approval requestedNo
A notify programTurn completeNo
A PermissionRequest hookThe moment Codex asks for approvalNo
Agent PetsThinking, needs approval, done, for every sessionYes: Allow or Deny, and reply, from any Chrome tab

1. Turn on Codex’s built-in notifications

The Codex terminal app can notify you itself. Add this to ~/.codex/config.toml:

~/.codex/config.toml[tui]
notifications = ["agent-turn-complete", "approval-requested"]
notification_method = "auto"
notification_condition = "unfocused"

If nothing appears, your terminal probably doesn’t turn OSC 9 into a desktop notification. Set notification_method = "bel" and let your terminal flash or bounce on the bell, or use one of the options below.

2. Run your own program when a turn finishes

notify runs any program each time Codex finishes a turn (the agent-turn-complete event, the only one it sends today). Codex passes one JSON argument with thread-id, cwd, input-messages and last-assistant-message, so the notification can say which project finished and what Codex answered.

~/.codex/config.tomlnotify = ["python3", "/Users/you/.codex/notify.py"]

Use it for desktop toasts with terminal-notifier, a chat webhook, or a sound. It doesn’t fire for approvals.

3. Get alerted the moment Codex asks for approval

Codex hooks run commands at points in a session. A PermissionRequest hook runs right when Codex is about to ask for approval. Save this as ~/.codex/hooks.json (on Linux, use notify-send 'Codex' 'Codex needs your approval' as the command):

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

Codex skips new or changed hooks until you trust them: start Codex, type /hooks and trust this one. A hook that prints nothing doesn’t approve or deny anything, so Codex shows its normal prompt right after.

No notification on macOS? osascript notifications come from Script Editor. Run osascript -e 'display notification "test"' once and allow Script Editor in System Settings → Notifications. On Linux, notify-send needs a desktop notification daemon, which SSH sessions and containers don’t have.

4. Answer Codex from your browser with Agent Pets

Every option above sends you back to the terminal. If you spend the wait in Chrome, Agent Pets brings Codex to you:

npx getagentpets init adds the hooks to ~/.codex/hooks.json (next to any you already have); then type /hooks in Codex once and trust them. It runs entirely on your computer: your code and prompts never leave your machine. If you don’t answer on the pet within 15 seconds, Codex shows its own prompt as usual.

Get Agent Pets — was $25, now $6Get Agent Pets — $25

Questions

Does Codex send desktop notifications by itself?

Yes, once you turn them on: set notifications under [tui] in ~/.codex/config.toml. They use OSC 9 where the terminal supports it and the terminal bell otherwise, and by default only fire while the terminal isn’t focused.

How do I get notified when Codex needs approval?

Include approval-requested in tui.notifications, or add a PermissionRequest hook that runs a notification command.

Why don’t my Codex hooks run?

Codex skips new or changed hooks until you trust them. Start Codex, type /hooks, review and trust them. If hooks are turned off entirely, check for hooks = false under [features] in config.toml.

Can I approve Codex commands without going back to the terminal?

Not with a notification or a plain hook. Agent Pets puts Allow and Deny on a pet on every Chrome page and on its desktop notification.

Sources: Codex documentation on advanced configuration, the configuration reference and hooks.

More guides