Play a sound when Codex finishes a prompt / task
Sound when Codex finishes
Summary
Please add an optional, clearly audible completion sound that plays when Codex finishes executing a prompt/task (useful when prompts run longer and the user switches focus).
Why
Helps when Codex works in background and I’m in another window/tab.
Terminal bell \a is too short/quiet and easy to miss.
Use case / Motivation
Most of my prompts take Codex quite a long time to execute — often more than a minute. It’s frustrating that I have to sit and stare at the screen just to know when it’s done. Since I work remotely, I could easily use that waiting time to do something else, as long as Codex informs me when it finishes.
Yes, I can (and already did) hack together my own workaround, but it would be much nicer if this were a built-in feature of the extension. For example, after finishing a prompt Codex could simply play a clear sound notification.
Environment
VSC
Extras
I would be cool if it plays: https://youtu.be/CduA0TULnow?list=RDCduA0TULnow&t=58
Are you interested in implementing this feature?
_No response_
Additional information
_No response_
53 Comments
you can already do that by setting up a notification hook for it in your .codex config.toml.
just add this to your config.toml
notify = ["python3", "~/.codex/notify.py"]and setup a notify.py file
I had to a make a few tweaks (iterm2 on macOS):
~/.codex/config.toml, I had to use absolute path to my home dirnotify = ["python3", "/Users/YOUR_USER_NAME/.codex/notify.py"]python3 ~/.codex/notify.py '{"type":"agent-turn-complete"}'Love this ask. I implemented a cross-platform MVP that’s opt-in and uses system sounds (no bundled assets).
Proposal
notifications.sound = true|false(defaultfalse)notifications.only_on_long_runs_ms = 0notifications.success_tone = "default"/notifications.error_tone = "default"complete(success),dialog-error(error)\a) if no backend availableagent-turn-completeWhy
notifyhook scripts~/.codex/config.tomlExample Config
Opened a PR to implement this: #4329
It adds:
notifications.sound(default off)notifications.only_on_long_runs_mssuccess_tone/error_tonewith sensible per-OS defaultsCross-platform mappings:
complete/dialog-errorWould this proposal result in the cli playing a sound if the task pauses asking for approval?
Hi @samlouiscohen , does your code change work for the VS Code extension as well? Or only the CLI version of Codex?
我尝试了很多次,都通知失败,最后,我把notify = ["python3", "/Users/wang/.codex/notify.py"]
放到disable_response_storage = true的后面一行 成功了,(我之前一直放在
trust_level = "trusted"
后面,导致一直失败,很神奇)
"I tried many times, but the notification failed every time. Finally, I moved the line notify = ["python3", "/Users/wang/.codex/notify.py"] right after disable_response_storage = true, and it worked! (It's strange because it kept failing when I had it after trust_level = "trusted".)"
For macOS users, I found a simple way to play sounds or notifications using the Shortcuts app, which has higher permissions. I configured the TOML file accordingly.
<img width="925" height="790" alt="Image" src="https://github.com/user-attachments/assets/b32afc67-cd71-4762-88bf-5815455861d5" />
The following worked for me on macOS, simple and easy to maintain, without the hassle of creating a Python script (notify.py) or a Shortcut.
In
~/.codex/config.toml, add this line:/System/Library/Soundshas many different ringtones for you to choose. You don't have to use my choice.(Inspired by https://github.com/openai/codex/issues/4998#issuecomment-3386645329)
Will they add this?
@Ahmet-Dedeler Just ask the Codex to do a terminal beep after a task.
This script helps a lot. Here is a similar script generated by gpt-5-mini. It also works in macOS.
How to use this script:
Here is the test script:
On a Mac that would be the same as setting ~/.codex/config.toml:
notify = ["tput", "bel"]Unfortunately it does not sound the bel(l) on permission requests though.
I developed a python package to do this. For MacOS/Linux/Windows; For Claude Code/Codex. More details in [huangwb8/VibeNotification](https://github.com/huangwb8/VibeNotification )
on a mac:
In codex
config.toml, add this:I find that on Linux,
tput beldoes not accept the additional parameter that is passed down by codex and will fail silently.A more portable solution on POSIX is:
The
%.0sconversion will shallow up the additional argument.It raises error
› /Users/xx/.bash_profile: line 38: syntax error: unexpected end of fileafter it played the soundHey everyone, I’ve been using Codex since last September, and I just can't understand why it requires users to write their own script for the task completion notifications feature.
Is that really a good user experience? I don't think so. Even Google’s new Antigravity feature does this better than Codex.
I’m not really sure how difficult this is to implement. Can someone explain it to me? (Genuinely asking)
For anyone that struggles with sound integration - codex-1up comes with sound options. (Not a fork)
https://github.com/regenrek/codex-1up
I already implemented this a while ago, but it got closed. My mistake I didn't check on these issues first. I just forked and did it for my own use but it can be an starting point.
It sounds a beep when task id done or user input is required, and has a simple menu option to enable/disable. I have been using this daily with proper behavior on ubuntu 24.04:
https://github.com/openai/codex/pull/8417#issuecomment-3680900135
I made a Mac native app that fire sounds and a native notification badge when Codex finishes its turn.
https://github.com/BowTiedCrocodile/codex-notifications-mac
I put together a macOS helper that solves the ‘quiet completion sound’ problem for me and I’ve found it genuinely handy. It sends native notifications (with optional VSCode activation) and lets you choose a louder sound via CODEX_NOTIFY_SOUND (e.g., Funk).
Repo + quick start: https://github.com/paultendo/codex-notify
Example for a loud sound:
Works well as a stopgap until this lands in Codex itself.
This Displays a notification, and says Finished! (MacOS Only)
config.toml
(For Mac users)
Anyone looking an easily drop in customisable way, I made this
notify.jshelper.It's ready for Notification, Sound, Text-to-speech notification, and Discord notifications.
This way I can get a push notification on my phone tru a discord webhook if I walk away from my desk. I just mute the channel while im sitting on the pc.
I wanted to provide an update on this feature request, which covers both the Codex CLI and VS Code Extension.
The CLI has long supported a configuration option named
tui.notifications. See this documentation for details. When this is enabled, Codex sends a notification when finishing a prompt or asking for tool call approval or both. This notification has historically been delivered as an OSC 9 escape sequence, which some terminals support and turn into a desktop toast notification. Unfortunately, support for OSC 9 isn't universal. For example, the builtin-in Terminal app in macOS doesn't support it. So this wasn't a complete solution for all Codex CLI users.We've addressed this by updating
tui.notificationsto support a more universal solution — a simple BEL character, which most terminals honor by emitting a simple audio tone. The next version of the CLI will include a new config optiontui.notification_methodthat accepts the valuesauto,osc9andbel. It defaults toauto, which attempts to automatically detect whether the terminal supports OSC 9 and falls back on BEL if it doesn't.For the VS Code Extension, this feature request involves some complications. VS Code doesn't expose a standard way for extensions to emit desktop notifications. It _does_ provide a way for an extension to request a toast within VS Code, but this notification isn't very useful if you are not actively watching for it. It also doesn't support an audible signal. That means our options are rather limited here. If you have some thoughts about how such a notification feature might work best from within a VS Code extension, let us know.
For TUI current approach seems sufficient IMO. For the vscode extension most workarounds using the external command relies on invoking system notification directly like using osascript like on my previous message, which is fine as a work around but not as first party option as the notification comes from osa and not from vscode, clicking the notification brings up ScriptEditor instead of the correspondent vscode window.
I don't see any path forward other than requesting new APIs to the vscode team, this makes a compelling case for proposing these to be added to the extension APIs.
Thanks for the update, @etraut-openai!
I would love to have different sound notifications for completions and user approval prompts in VS Code, and a little research with Devin.
-----
For the VS Code extension, the limitations are indeed architectural. Extensions currently only have access to internal toasts via
vscode.window.showInformationMessagewhich require VS Code to have focus. There's no direct desktop notification or audio API exposed.However, VS Code already has the necessary infrastructure internally:
IAccessibilitySignalServicefor playing sounds used by core featuresChatWindowNotifierdemonstrates OS notification integration with proper click handling viahostService.showToast()Proposed VS Code API additions:
These would leverage existing
IHostServiceandIAccessibilitySignalServiceinfrastructure, with graceful degradation for web/remote scenarios.The implementation would require:
extHost.protocol.tsvscode.proposed.d.tsper extension proposal processThis approach reuses proven patterns while maintaining security boundaries.
Simple:
Add to prompt to AGENTS.md
For Window IDE version:
Create a python script at "%USERPROFILE%\\.codex" or everywhere you want and paste it snippet (replace DEFAULT with your sound file):
Then update config.toml (must replace C:\\Users\\ngtan\\.codex\\notify.py to your location of notify file):
Sometimes you need to install Codex CLI
Enjoy.
Still not working in Windows env, CLI codex-cli 0.105.0-alpha.6
I'm testing this for weeks with no success. The trouble is that notify from c:\Users\<user>\.codex\config.toml
notify = ["powershell", "-NoProfile", "-Command", "[console]::beep(900,200)" ]
is not fired automatically when codex is running; the model can instead trigger it manually. tested also by logging to a file: as setting no luck, manually fired works.
My dirty workaround: just tell agent to make it for you (it's noise log, it's tokens consumer but it's working) - put this in top of your AGENTS.md
@kul-work, if you're using the CLI, I recommend using the tui.notification config key (and optionally the
tui.notification_methodkey if you want to control whether to use anosc9orbelnotification). If you're having problems with this mechanism, please file a bug report. This feature request is still open because we don't have a good solution in place yet for the Codex IDE extension.Following up on my earlier comment — codex-notify now covers a lot of the gaps discussed here, especially for macOS users on the CLI and the VS Code extension:
sayfor when you're away from your desk--setupfor zero-friction configRe: @etraut-openai's point about the VS Code extension lacking desktop notification APIs — the
notifyhook inconfig.tomlalready fires from the VS Code extension (since it sharescodex-rs/core), socodex-notifyworks there too. The notification comes fromterminal-notifierwith execute-only activation, so clicking it brings VS Code to front reliably — no Script Editor redirect.I've also opened PR #12516 to add a
clientfield to the notify hook payload. This would let notification tools know whether the hook was triggered from the CLI, VS Code extension, or macOS app — useful for activating the correct application on click without having to guess.But we can ask the codex in the cursor IDE , to play a sound once you are done with the task. it is working.
A slightly different angle on this — if you're stepping away and want to know when Codex finishes (and see what it did), I built an open-source bridge called pikiclaw that streams Codex CLI output to Telegram in real-time.
It runs locally and uses your own Telegram bot, so when Codex completes a task, the result shows up as a Telegram message on your phone — with native push notifications. You can also send follow-up prompts from the chat without going back to your terminal.
Not a replacement for a local sound notification (which the hook-based solutions above handle well), but useful if you're away from your desk and want more than just a "ding."
(Disclosure: I'm the author.)
With the new hooks configuration this is now much easier to configure yourself 👍 https://developers.openai.com/codex/hooks
Relatable problem — long-running Codex tasks while working remotely.
I built a notification bridge into cc-clip that works over SSH. When Codex finishes a task, it forwards the notification through an SSH reverse tunnel to a local macOS daemon, which pops up a native notification.
For Codex specifically, it hooks into the \
notify\config in \~/.codex/config.toml\:\
\\toml\notify = ["cc-clip", "notify", "--from-codex-stdin"]
\
\\
cc-clip connect\auto-configures this if it detects \~/.codex/\on the remote.It's a third-party tool so not ideal compared to built-in support, but it works today for remote Codex sessions where \
notify-send\and terminal bell aren't available.+1 — would love a built-in notification/sound for turn completion in the CLI TUI.
Adding another data point from Codex CLI on WSL2/WSLg, because the current workaround story is much rougher than it should be.
Environment tested on April 9, 2026:
What we found:
Request:
Please add first-party, optional completion sounds for Codex CLI itself, with Claude-level ergonomics.
What would help most:
The main point is not that custom scripting is impossible. It is that the current DIY route is too fragile and too easy to get wrong in a way that produces either no signal or an unpleasant one.
One follow-up, because I want to be fair to the newer hook-based comments while also being precise about what is and is not solved.
The newer hooks configuration does improve the situation in one important way: it makes wiring a completion action into Codex much more straightforward than older ad-hoc workarounds.
However, that is not the same thing as this feature being genuinely solved from a user-experience perspective.
In our April 9, 2026 test on Codex CLI 0.118.0 under WSL2/WSLg:
So I think the accurate framing is:
That distinction matters, because otherwise it sounds like users already have a good solution when in practice many of us still do not.
@simfor99, this thread is for the Codex IDE extension. It sounds like you're having issues with the Codex CLI, which uses a different notification mechanism that works within the constraints of terminals. If you're having issues with the Codex CLI notification mechanism, please open a separate bug report so the feedback doesn't get lost.
Thanks for the clarification, @etraut-openai. You are right that my issue is about Codex CLI notification behavior rather than the IDE extension. I will move the discussion over to the CLI bug side so it does not get lost and continue there instead. Appreciate the pointer.
Follow-up: I opened a separate CLI tracking issue here as suggested: #17235. Thanks again for pointing me to the correct surface.
I managed to get the hooks https://developers.openai.com/codex/hooks to work on codex-cli 0.125.0 Ubuntu 25.10 with:
~/.codex/config.toml
hi guys, 8hrs ago I did my first project and as a second I did tiny workaround for this, detecting pet visual state changes and firing sound clip, for now as win32 systray thing, it expects pet docked in bottom-left screen corner, hopefully DPI-aware, tested on 1920x1200 at 100% now ... its ugly but simple and it works ... https://github.com/apws/260504-codex-pet-screen-sounds
(macosx version will be added soon...)
I published a small hook-based workaround for macOS users who want a clearer "Codex needs attention" signal, not just turn-complete notifications:
https://github.com/constansino/codex-attention-notifier
It sends a native macOS notification for
PermissionRequesthook events. It does not approve/deny anything; it only notifies and logs locally.I also wrote a short discussion post with usage details here:
https://github.com/openai/codex/discussions/21354
I’d like to add a +1 for the Codex Desktop app specifically.
The current completion notification sound is easy to miss, especially when Codex is running in the background and I’m focused on another app. It would be helpful to have one or more louder notification sound options for turn completion / input-required events.
A few possible options:
This would make long-running agent workflows easier to monitor without constantly watching the Codex window.
@PhilChen-6765, this feature is already supported in the Codex app. This thread is specifically for the Codex IDE Extension.
@etraut-openai Thanks for clarifying. I may not have explained it clearly.
I’m using Codex app version 26.506.31421 (2620). I’m aware that completion notifications are already supported in the Codex app. My request is not about adding notification support from scratch, but about the current notification sound being too quiet/easy to miss.
What I’m asking for is a louder or more noticeable sound option for the existing Codex app notifications, or a setting that lets users choose a louder/custom notification sound.
@PhilChen-6765, the desktop app uses standard desktop notifications that are under the control of the OS. In any case, this thread is specific to the IDE Extension, so this isn't the right place to be discussing feature requests for the app.
For anyone here using custom
notify.pyscripts or one-offafplaycommands, we built a small cross-platform notifier for Codex and other AI coding agents: https://github.com/DevinoSolutions/ai-agent-notifierJust run
npx ai-agent-notifier setup, reset your current sessions, and you are good to go!---
https://github.com/user-attachments/assets/5714b528-7e04-478e-abfd-2a3d05db562c
Watch on YouTube
hi, glad to see there 2 nice "hooks"-related solutions for (also) sound notifications; I was totally new to codex 3 weeks ago, so only now understanding the architecture (btw, is codex-CLI used under the hood of codex-APP ?), but as I understood reading related issues here, "hooks" are still in development to be in parity to claude code, but this is probably something I didn't knew - sure; so I as a one of first codex test projects implemented "out of the box sound notifier" based on visual screen watching of PET badge parked into left-bottom screen corner (tested on win/mac, hidpi aware etc); sure IT IS hack, but is reliable and is fast/immediate - system notifications on windows are always quite weird and not instant - thanks for the new workarounds/hooks here too;
(this was hidden originally as off-topic, but it isn't, excuse me, I am writing here mostly because "system notifications" at least on windows is something which didn't worked for me well, so i was immediately forced to TRY something simple the "other way"...)
https://github.com/apws/260504-codex-pet-screen-sounds
any update here? i dont need the sound. i need visual notification.
Someone built an additional plugin that can do this (but it does not work via the Remote SSH extension :()
https://marketplace.visualstudio.com/items?itemName=zis3c.codex-notifier
Please also support custom notification sounds in the Codex desktop app.
Suggested settings:
Currently, the macOS app bundles a fixed notification sound. Replacing that file manually invalidates the app code signature and may prevent the app from launching, so this needs an officially supported setting.
This would be especially useful for long-running tasks and for users who work with several agent applications simultaneously.