anotifier / guides / codex-notification-sound
[ GUIDE · CODEX CLI SOUNDS ]
Codex CLI logo

Make Codex CLI ding when it needs your approval or a response

Codex CLI already notifies you when it needs approval or a response from you, but by default only while its terminal is in the background, and in some terminals as a silent banner. Under [tui] in ~/.codex/config.toml, set notification_condition = "always" to be alerted even when the window is in front, and notification_method = "bel" to get the terminal bell instead of a banner. For a real sound file, add a PermissionRequest hook that plays one. Here are both, plus how to ding only when Codex is waiting on you. For the rest of the notification setup (desktop toasts, the notify command, phone alerts) see Codex CLI notifications.

Rather skip the manual setup? One command wires every agent you have installed to desktop toasts, phone push, and Slack, Discord or Telegram:

$ npx anotifier@latest setup

Updated 2026-10-16 · also see the Codex CLI overview and the full docs

Why Codex doesn't ding when it needs a response

The Codex TUI has notifications built in, and they are on by default. Codex sends one when a turn ends, when it asks to run a command or edit files, when an MCP server asks for approval, and when a Plan mode prompt or a question is waiting for your answer. Two defaults decide whether you notice:

  • Only while the terminal is unfocused. notification_condition defaults to unfocused, so nothing fires while the Codex window is in front.
  • Banner or bell depends on the terminal. notification_method defaults to auto: an OSC 9 desktop notification in terminals Codex knows support it, and the terminal bell (BEL) everywhere else.
Terminalauto sendsWhat you get
Ghostty, iTerm2, Kitty, Warp, WezTermOSC 9A desktop notification from the terminal app. Whether it plays a sound follows your OS notification settings for that app
Apple Terminal, Windows Terminal, VS Code, GNOME Terminal, Konsole, Alacritty, and the restBELWhatever the terminal does with its bell: a beep, a visual flash, or nothing if the bell is muted

Ding when Codex needs approval, even in the foreground

Put this in ~/.codex/config.toml. The list limits notifications to the ones that wait on you, bel forces the terminal bell, and always drops the unfocused-only rule:

[tui]
notifications = ["approval-requested", "plan-mode-prompt", "async-question"]
notification_method = "bel"
notification_condition = "always"
TypeFires when
agent-turn-completeA turn ends. The notification previews Codex's reply
approval-requestedCodex asks to run a command or edit files, or an MCP server asks for approval
plan-mode-promptA Plan mode prompt is waiting for you
async-questionCodex has asked you a question

Play a sound file when Codex needs approval: a hook

The bell is only as loud as your terminal makes it. For a sound file, use Codex hooks: PermissionRequest runs when Codex is about to ask for approval, and only then, and Stop runs when the turn ends. Add this to ~/.codex/hooks.json to hear Glass when Codex finishes and Ping when it needs you on macOS. The commandWindows override plays Windows sounds instead:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff",
            "commandWindows": "powershell.exe -NoProfile -Command \"(New-Object Media.SoundPlayer 'C:\\Windows\\Media\\chimes.wav').PlaySync()\"",
            "async": true
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Ping.aiff",
            "commandWindows": "powershell.exe -NoProfile -Command \"(New-Object Media.SoundPlayer 'C:\\Windows\\Media\\notify.wav').PlaySync()\"",
            "async": true
          }
        ]
      }
    ]
  }
}
  • "async": true tells Codex not to wait for the sound. Without it, Codex holds the approval prompt until the hook exits.
  • On Linux, change each command to paplay with a freedesktop sound from /usr/share/sounds/freedesktop/stereo/, such as complete.oga for Stop and message-new-instant.oga for approvals. It needs PulseAudio or PipeWire.
  • Codex skips new or changed hooks until you trust them. Open /hooks in Codex to review and trust these two; Codex warns at startup when hooks are waiting for review.
  • Hooks are on by default in current Codex releases. If you turned them off, set hooks = true under [features] in config.toml.
  • Sound players print nothing, and Codex treats a hook that exits 0 with no output as a success, so the hook never changes what Codex does.

Why notify can't ding on approvals

The notify setting runs your own program, but Codex currently sends it only one event, agent-turn-complete. It never fires for an approval prompt. Codex also ignores notify in a project's .codex/config.toml, so set it in ~/.codex/config.toml. Use it for a finished-turn sound or webhook, and one of the options above for approvals. The Codex CLI notifications guide covers notify as a desktop or phone alert.

Sounds and phone alerts with anotifier

npx anotifier@latest setup

anotifier registers Codex's Stop and PermissionRequest hooks for you and sends each event to your desktop and, if you set it up, your phone. An approval request arrives as an urgent needs-input alert with the Reminder sound (Ping on macOS). A finished turn plays IM (Glass on macOS). Change either with toastSound:

{
  "events": {
    "task_complete": {
      "toastSound": "Hero"
    },
    "needs_input": {
      "toastSound": "Sosumi"
    }
  }
}

anotifier also rings the terminal bell by default. If Codex's own [tui] bell fires too, you may hear two; turn one off with terminalBellEnabled: false in anotifier or notifications = false under [tui]. The Claude Code sound guide lists every sound name per platform; they are the same for Codex.

Codex CLI sounds: common questions

How do I make Codex ding when it needs approval or a response?

Under [tui] in ~/.codex/config.toml, set notifications = ["approval-requested", "plan-mode-prompt", "async-question"], notification_method = "bel" and notification_condition = "always". Or add a PermissionRequest hook to ~/.codex/hooks.json that plays a sound file (approvals only).

Can Codex ding when a Plan mode prompt or a question needs my response?

Yes. Those are the plan-mode-prompt and async-question notification types. Keep them in the [tui] notifications list with notification_method = "bel" and notification_condition = "always". A PermissionRequest hook fires only for approvals, so use the [tui] setting for prompts and questions.

Can Codex ding only when it is waiting on me, not when it finishes?

Yes. List only the types that wait on you, such as notifications = ["approval-requested", "plan-mode-prompt", "async-question"], and leave out agent-turn-complete. A PermissionRequest hook also fires only for approvals.

Why doesn't Codex make a sound?

By default Codex notifies only while its terminal is unfocused, and in Ghostty, iTerm2, Kitty, Warp and WezTerm it sends a desktop notification instead of ringing the bell. Also check that your terminal's bell isn't muted and that notifications isn't set to false under [tui].

Can Codex play a sound when it finishes?

Yes. Keep agent-turn-complete in the [tui] notifications list, or add a Stop hook that plays a file. The notify setting also fires on agent-turn-complete and can run any script.

Does a sound hook slow Codex down?

Not with "async": true. Without it, Codex waits for the hook, so the approval prompt appears only after the sound finishes.

Try it

One command wires every agent you have installed: Claude Code, Codex CLI, Cursor, and Gemini CLI.

npx anotifier@latest setup

Other guides