All guides

Codex's built-in notifications: tui.notifications, OSC 9 and the terminal bell

Updated 19 November 2026 · 4 min read

The Codex CLI has a built-in notification: when a turn completes or an approval is waiting and your terminal isn't focused, it alerts you through the terminal. It's on by default and controlled by three settings under [tui] in ~/.codex/config.toml. notifications turns it on or off (or limits it to certain events), notification_method chooses how (auto, osc9 or bel), and notification_condition chooses when (unfocused or always). In auto mode, Codex sends a desktop notification in Ghostty, iTerm2, Kitty, Warp and WezTerm, and rings the terminal bell everywhere else.

01The settings

# ~/.codex/config.toml
[tui]
notifications = true              # or false, or a list of event types
notification_method = "auto"      # "auto", "osc9" or "bel"
notification_condition = "unfocused"  # or "always"

You can also change these from inside Codex: type /config to open terminal preferences and search for notifications.

notifications

true turns on every type, false turns them off. A list limits them to certain events. OpenAI's docs name two:

[tui]
notifications = ["agent-turn-complete", "approval-requested"]
  • agent-turn-complete: Codex finished a turn.
  • approval-requested: Codex is waiting for you to approve a command, an edit or a tool call.

Recent versions also raise alerts for plan-mode prompts and questions. To get just "finished", use ["agent-turn-complete"].

notification_method

ValueWhat Codex writesWhat you see
osc9The OSC 9 escape sequenceA desktop notification, in terminals that support it
belThe bell character (\x07)Whatever your terminal does with a bell
auto (default)OSC 9 in Ghostty, iTerm2, Kitty, Warp and WezTerm; the bell elsewhere

"Elsewhere" includes Apple Terminal, Windows Terminal, the VS Code terminal, GNOME Terminal, Konsole and Alacritty. If your terminal supports OSC 9 but Codex doesn't recognise it (for example over SSH, or inside tmux), set osc9 yourself.

notification_condition

unfocused (the default) only alerts when the terminal window isn't focused, so you aren't pinged while watching. always alerts every time. If alerts never fire in a setup where focus can't be tracked, try always.

02Setting up your terminal

Ghostty, Kitty, WezTerm, Warp. They show OSC 9 as a desktop notification. Make sure the terminal app is allowed to send notifications in your system settings.

iTerm2. It shows OSC 9 notifications, but check the profile's notification settings and that iTerm2 may send notifications in macOS System Settings.

Apple Terminal. No OSC 9, so Codex rings the bell. In Terminal > Settings > Profiles > Advanced, choose what the bell does; the Dock bounce and badge options are the useful ones.

Windows Terminal. The bell. In Settings > Profiles > Advanced, set Bell notification style to flash the taskbar, play a sound, or both.

VS Code, Cursor and other IDE terminals. The bell. Whether you notice depends on the editor's bell settings; the VS Code guide has the details.

GNOME Terminal, Konsole, Alacritty. The bell, which your desktop may turn into a sound or an urgent window highlight.

tmux. Codex wraps OSC 9 for tmux, but tmux must allow it with set -g allow-passthrough on. See the tmux guide.

03When the built-in alert isn't enough

The built-in alert is written to the terminal, so it only helps when a terminal is showing the session and you're near the computer. It can't reach you once you've walked away or detached, and in many terminals it's only a bell. For more:

  • A real desktop notification in any terminal: a Stop and a PermissionRequest hook. See how to get a notification when Codex finishes.
  • A program on every completed turn: the notify setting. See the notify guide.
  • Your phone: ntfy, a chat app, or Notifier for Codex, whose free codex-notifier tool for Mac, Windows and Linux sends "finished", approvals and questions to an iPhone or Android app and lets you answer. It is independent and not affiliated with OpenAI.

If you use a hook and the built-in alert together, you may get two alerts for the same moment. Set notifications = false under [tui] to keep only the hook.

04FAQ

Are Codex's notifications on by default?

Yes. tui.notifications defaults to on, with notification_method = "auto" and notification_condition = "unfocused".

Why do I only hear a beep, not see a notification?

Your terminal isn't one Codex sends OSC 9 to, so it fell back to the bell. Switch to a terminal that supports OSC 9, set notification_method = "osc9" if yours supports it but isn't recognised, or use a hook.

Why don't I get any alert while I'm looking at the terminal?

That's notification_condition = "unfocused" working as intended. Set it to always if you want alerts regardless.

Does the built-in notification work in codex exec?

It belongs to the interactive terminal UI. For non-interactive codex exec runs, use a Stop hook or watch the --json event stream.

How do I turn Codex's notifications off?

notifications = false under [tui] in ~/.codex/config.toml, or switch it off in /config.

Notifier for Codex Get a push on your phone when Codex finishes or needs you, then approve, reject or answer from there. The codex-notifier command line tool is free on Mac, Windows and Linux.