Agent HUD

WeChat group

WeChat group

Scan with WeChat to join the group.

Guides

How to get a notification on Mac or Windows when Codex finishes a turn

In ~/.codex/config.toml, set notifications under [tui] and the Codex CLI notifies you through your terminal when a turn ends. For a macOS notification in any terminal, add a notify command. The desktop app has its own setting, and Agent HUD shows every finished turn at the edge of your screen without any of them.

Updated 2026-11-22

Notifications from the Codex CLI

Add this to ~/.codex/config.toml:

[tui]
notifications = ["agent-turn-complete", "approval-requested"]

notifications = true turns on every kind; the list keeps only the ones you name. agent-turn-complete is a finished turn, and approval-requested is Codex waiting for your approval.

Codex sends these through the terminal. Where the terminal understands desktop notifications you get a banner, and elsewhere Codex rings the terminal bell.

If nothing shows

By default Codex notifies you only while the terminal is not the window in front. Two more settings change when and how:

[tui]
notifications = true
notification_condition = "always"   # unfocused (default) | always
notification_method = "bel"         # auto (default) | osc9 | bel

always notifies you even while you are looking at the terminal. bel rings the bell in every terminal, which helps when yours shows no banner.

A macOS notification in any terminal

notify names a command that Codex runs when a turn completes. This line posts a notification with osascript, which every Mac has. It goes at the top of config.toml, above any [section]:

notify = ["/bin/bash", "-c", "osascript -e 'display notification \"Turn finished\" with title \"Codex\"'", "codex-notify"]

Codex appends one JSON argument to the command, with type, thread-id, turn-id, cwd, input-messages and last-assistant-message. The line above ignores it; a script of your own can read it to show the reply's text. OpenAI's documentation has an example in Python.

Notifications sent with osascript belong to Script Editor. If none appears, allow Script Editor under System Settings → Notifications.

  • notify runs for finished turns only. For approvals, use approval-requested under [tui].
  • It works with the IDE extension too, which has no notification settings of its own.

Codex: notifications in config.toml

In the desktop app

The desktop app needs no config file. Open Settings with ⌘, and choose under Notifications whether turn-completion alerts appear never, only while the app is in the background, or always. Permission and question notifications have switches of their own.

Codex: notifications

With a sound

To hear when a turn ends, have notify play one of the system sounds with afplay, which every Mac has:

notify = ["/bin/bash", "-c", "afplay /System/Library/Sounds/Glass.aiff", "codex-notify"]

Any file in /System/Library/Sounds works, such as Ping.aiff or Hero.aiff. notify takes one command, so to get the banner as well, join the two inside the quotes with ;.

On your phone and watch

When your computer is set up for remote connections in the ChatGPT desktop app, the ChatGPT mobile app notifies you when a task completes or needs your attention.

With Agent HUD Remote, a finished turn and a waiting request reach your iPhone and Apple Watch as notifications, for Codex and your other agents alike, including Codex sessions in the CLI.

OpenAI: remote connectionsControl Claude Code and Codex from iPhone and Apple Watch: Agent HUD Remote

On Windows

The file is %USERPROFILE%\.codex\config.toml, and the [tui] settings above work the same. If your terminal shows no banner, set notification_method to bel to get the bell.

The notify line above uses osascript, which is for the Mac only. On Windows, point notify at a script of your own, or let Agent HUD show the reply.

With Agent HUD: no config to write

Agent HUD shows a New reply card at the edge of your screen when Codex finishes a turn, in the CLI or in the desktop app. The card carries the session's title, the opening lines of the reply and how long the turn ran, and Return to session takes you back in one click.

It does the same for Claude Code and the other agents it follows, on the Mac and on Windows 10 and 11, so the replies of all of them arrive in one place. The card appears in the HUD, not in Notification Centre, and makes no sound.

A New reply reminder on the HUD
A New reply reminder on the HUD

Claude Code and Codex notifications on Mac and Windows: replies and quota alertsCodex

Which one to use

WaySetupWhat you get
[tui] notificationsTwo lines in config.tomlA banner or a bell from the terminal, for finished turns and approvals
notifyOne line in config.tomlA macOS notification after every turn, in any terminal
Desktop appA choice in SettingsThe app's own alerts
Agent HUDInstall the appA card with the reply's opening lines and one click back, for every agent

Questions

How do I get a notification when Codex finishes a turn on a Mac?

In ~/.codex/config.toml, add notifications = true under [tui] for a notification from your terminal, or add a notify command that runs osascript for a macOS notification in any terminal. The desktop app has the choice in Settings → Notifications. Agent HUD shows a New reply card for every finished turn with no config to write.

Why do Codex notifications not appear?

By default Codex notifies you only while the terminal is not in front; set notification_condition to always to change that. A terminal that shows no banner still gets the bell with notification_method set to bel. For a notify command that uses osascript, allow Script Editor under System Settings → Notifications.

Can Codex notify me when it needs an approval?

Yes, with approval-requested in the [tui] notifications list, or the permission switch in the desktop app's settings. The notify command runs for finished turns only.

What does Codex pass to the notify command?

One JSON argument, added after the command's own arguments, with type, thread-id, turn-id, cwd, input-messages and last-assistant-message. The only event type today is agent-turn-complete.

Does Agent HUD need a config I write myself?

No. Install Agent HUD and it follows Codex on its own. The reminder appears in the HUD, with one click back to the thread or the terminal pane.