Get a notification when Claude Code or Codex is done
You start a long task, switch to something else, and come back to find the agent stopped ten minutes ago to ask a question. Here are three ways to hear about it sooner, and what each one covers.
Checked against the Claude Code and Codex documentation on November 30, 2026.
The short answer
| If you | Use | You get |
|---|---|---|
| Run Claude Code in one terminal |
A setting or a hook in ~/.claude/
|
A bell, a sound or a desktop notification on that computer |
| Run Codex in one terminal |
The notification settings in ~/.codex/
|
A desktop notification when a turn ends or approval is requested |
| Run more than one agent, or want alerts on your phone | Miunit | A sound on your computer and a notification on your phone, with nothing to script |
The first two are built into the agents. Miunit is a free download for macOS and Windows.
Claude Code: check the built-in alert, then add a hook
See what you already get. When Claude finishes a task or pauses for a permission prompt and you appear to be away from the terminal, Claude Code sends a notification by itself. What you see depends on the terminal:
- Ghostty, Kitty and iTerm2: a desktop notification. iTerm2 shows it only after you turn on its alert settings.
- Apple Terminal: no sound by default.
- Other terminals: nothing.
Ask for a bell everywhere. Add this to
~/.claude/settings.json. In Apple Terminal, also turn on
Audible bell in the profile’s advanced settings.
{
"preferredNotifChannel": "terminal_bell"
}
If the file already has settings, add these keys inside its existing braces instead of pasting a second block.
Play a sound or show a banner with a hook. Hooks run a command of yours when an event happens, alongside the built-in alert. Two events matter here:
-
Notificationruns when Claude Code sends a notification, such as waiting for input or permission. Stopruns when Claude has finished responding.
This example for macOS plays a system sound when Claude needs you and shows a banner when it finishes:
{
"hooks": {
"Notification": [
{
"hooks": [
{ "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" }
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Claude Code finished responding\" with title \"Claude Code\"'"
}
]
}
]
}
}
A few things to know:
-
Stopruns after every response, not only at the end of a large task, and not when you interrupt. Expect one banner per turn. -
Notificationwith nomatchercovers every type. To narrow it, usepermission_promptfor an approval that has waited about six seconds, oridle_promptfor a response that finished about a minute ago with no reply from you. -
On Linux, use
notify-send 'Claude Code' 'Claude Code needs your attention'. The Windows example in the documentation opens a message box, not a toast.
Sources: Claude Code terminal configuration and the hooks guide.
Codex: use its notification settings
Codex can raise desktop notifications from its terminal interface. In
~/.codex/config.toml:
[tui]
notifications = ["agent-turn-complete", "approval-requested"]
By default they appear only when the terminal is not focused. Codex sends them as a terminal notification, so whether you see a desktop banner depends on your terminal.
To run your own program when a turn ends, add a notify line to the same file:
notify = ["python3", "/path/to/notify.py"]
Put it at the top of the file, above any section header such as [tui]. A line
placed under a header becomes part of that section and is ignored.
Codex calls the program with one JSON argument. notify supports only the
agent-turn-complete event, and it belongs in your user-level config, not a
project one.
Sources: Codex advanced configuration and the configuration reference.
Where the built-in routes stop
If you run one agent in one terminal, the settings above are all you need. They start to cost time when your setup grows:
- One setup per agent, per computer. The JSON for Claude Code and the TOML for Codex are separate, and a second computer needs both again.
- The alert stays on that computer. Getting it on your phone means adding a service or a script of your own.
- A banner does not say which session. With several sessions open, you still have to find the one that is waiting, unless you script that too.
With Miunit: a sound on your computer, an alert on your phone
Miunit is a free desktop app for macOS and Windows. It runs your installed Claude Code, Codex and other coding agents and shows every task on one Board. Its alerts work the same way for each agent, and there is nothing to script.
-
Connect your agent. Open Settings → Agents and connect an agent you already have installed. Start the task from New Task. Sessions you start in the agent’s own app can appear as well if you turn on Threads started elsewhere for that agent; what Miunit can show for those depends on the agent.
-
Turn on task sounds. They are off by default. Select Audio in the status bar to switch them on, then open its options and choose which events play a sound: a task needs you, finishes, or fails. Task sounds in Settings lets you pick a sound for each event and preview it.
Choose the events you want to hear. -
Turn on Auto notify. Select the task counters in the status bar and turn on Auto notify. A new request or an unread result then brings up a Task updates card in the Miunit window.
-
Pair your phone. Install Miunit Mobile on iPhone or Android and pair it in Settings → Phone. With Notify paired phones on, which is the default, your phone gets a notification when a task needs your approval, has a question, finishes, fails or stops. It shows the project, the status and the task title. Those details are decrypted on your phone; the relay that carries them cannot read them. You can hide them with Show task details in the phone app’s Settings.
-
For long runs, check Keep Awake. A sleeping computer stops the work. See Sound notifications & Keep Awake.
What Miunit does not do
- No banners in the macOS or Windows notification center. On the computer you get a sound and a card in the Miunit window. The phone covers the time away from your desk.
- No sounds for what happened while it was closed. Sounds cover tasks that change while Miunit is open.
- Phone notifications are a prompt, not a guarantee. They need your computer online with Miunit running, and you will not get one while the phone app is open in front of you.
- It depends on the agent. What Miunit can detect varies by agent and version. Check Compatibility for yours.
Which one to pick
- One agent, one terminal, one computer: use the agent’s own setting. It is already there.
- Several sessions, more than one agent, or time away from your desk: use Miunit.
- Both: nothing stops you from keeping a hook and using Miunit as well.
Questions people ask
Can Claude Code or Codex notify my phone?
Anthropic’s and OpenAI’s own mobile apps can follow their own agent. See Claude Code remote control and OpenAI’s announcement. Miunit Mobile follows every agent connected to your computer in one app, on iPhone and Android.
Does this work on Windows?
Hooks run whatever command you give them, so the command has to be a Windows one. Codex’s notifications depend on your terminal. Miunit’s sounds and phone notifications work the same on Windows and macOS.
Can I get a sound without a banner?
Yes. In Claude Code, use the sound hook above or the terminal bell setting. In Miunit, turn on task sounds and leave Auto notify off.