Claude Code notifications on macOS: hooks, bells and the notch
This guide is published by NotchClippy. The setup steps and snippets were checked against official Claude Code, Codex and Cursor documentation on 1 December 2026. Hook events and setting names do change between releases, so confirm the live docs before you rely on a matcher or a JSON field.
You do not need a notch app to get a banner or a bell when Claude Code is waiting or done. The first half of this page is that how-to. NotchClippy is one option if you also want to watch a run and answer Allow or Deny from the menu bar, including on a display without a hardware notch.
Why the terminal is a poor notification surface
A long Claude Code, Codex or Cursor run often means you have tabbed away. The terminal or chat panel keeps updating, but macOS will not tell you unless something emits a notification, a bell, or another signal you actually notice.
That matters in two different moments:
- The agent is blocked on a permission prompt, a network request, or another question, and the run sits there until you answer.
- The run is done, and you want to read the result or start the next prompt.
Those are not the same event. A hook that only fires when the model finishes will not help you if Claude has been waiting six seconds for a tool approval. A hook that only fires when a prompt has been sitting there will not tell you the instant a turn ends.
When Claude is actually blocked
Claude Code can already fire a notification when it thinks you are away and it needs you. The official terminal setup guide says this happens when Claude finishes a task or pauses for a permission prompt. The exact types and timings are listed in the hooks guide.
The two types most people want are:
| Matcher | Official timing |
|---|---|
permission_prompt | Claude needs you to approve a tool use, or a sandboxed command's network request, and the prompt has waited about six seconds |
idle_prompt | Claude finished responding about 60 seconds ago and you have not typed since |
An empty matcher fires on every notification type. If you only want “it is waiting for approval,” set the matcher to permission_prompt. If your main problem is the permission alert arriving late, see Claude Code permission prompts on Mac, which covers the PermissionRequest hook.
The official macOS example adds a Notification hook to ~/.claude/settings.json. If the file already has a hooks object, add Notification next to the existing event keys rather than replacing the whole object:
{
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"
}
]
}
]
}
}
That osascript command is the one in Anthropic's hooks guide. Notifications go through the built-in Script Editor app. If Script Editor does not have notification permission, the command fails silently and macOS may never ask. The same guide says to run this once in Terminal:
osascript -e 'display notification "test"'
Nothing may appear yet. Open System Settings → Notifications, find Script Editor, turn on Allow Notifications, then run the test again.
To hear a sound instead of (or as well as) a banner, the terminal setup guide gives this Notification hook, which plays a built-in macOS sound. Hooks run alongside the built-in notification; they do not replace it:
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
]
}
}
Check the hook with /hooks at the Claude Code prompt. The official test is: press Esc to return to the CLI, press Shift+Tab until the status bar shows ⏸ manual mode on, ask Claude to do something that needs permission, then switch away from the terminal.
Notifications when a run is done
idle_prompt only fires about a minute after Claude has finished, and only if you have not typed since. If you want a signal as soon as a turn ends, use the Stop event instead. The hooks reference lists Stop as firing “when Claude finishes responding.”
Anthropic's published osascript snippet is on the Notification event. The same command shape works as a Stop hook if you change the message. This combined example is not copied as a single block from the docs; it uses the documented Stop event and the documented osascript pattern:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Claude Code finished\" with title \"Claude Code\"'"
}
]
}
]
}
}
You can keep both a Notification hook and a Stop hook in the same hooks object. If you do, you will get a banner when Claude is waiting (or idle), and another when the turn actually ends. Tighten the Notification matcher to permission_prompt if you do not also want the delayed idle_prompt banner.
A Stop hook can also block Claude from stopping if it exits with code 2 or returns the documented stop-control JSON. A notification hook should just run its command and exit 0. By default, after eight consecutive hook-triggered continuations with no intervening tool call, Claude Code overrides the next attempt to block stopping; that cap is about continuation hooks, not about banners.
If you would rather ring the terminal than post a Notification Center banner, the hooks reference lets a hook return a terminalSequence in JSON. Hooks cannot write to /dev/tty themselves. This official Notification example sends an OSC 777 sequence, which Ghostty and Warp can show as a desktop notification (jq is required; brew install jq on macOS):
#!/bin/bash
# Notification hook: ping the desktop when Claude Code needs attention.
input=$(cat)
title="Claude Code"
body=$(jq -r '.message // "Needs your attention"' <<<"$input")
seq=$(printf '\033]777;notify;%s;%s\007' "$title" "$body")
jq -nc --arg seq "$seq" '{terminalSequence: $seq}'
Point a Notification (or Stop) command hook at that script. terminalSequence only works in an interactive session, only while the Claude Code interface is open, and only if you leave async off. Allowed sequences are OSC 0/1/2 (titles), OSC 9 (iTerm2, WezTerm and others), OSC 99 (Kitty), OSC 777 (Ghostty and Warp), and a bare BEL.
Claude Code, Codex, and Cursor
Claude Code's built-in terminal bell and desktop alerts
Before you add hooks, try the built-in channel. According to the terminal setup guide, the default (preferredNotifChannel of "auto") is:
- Ghostty, Kitty and iTerm2, when Claude Code detects them: a desktop notification. iTerm2 shows it only after you turn on its alert settings.
- Apple Terminal: no sound. If “Audible bell” is off in the front window's profile, Claude Code may send a silent bell character, which can flash the window or bounce the Dock if “Visual bell” or Dock bounce is on; otherwise it may send nothing.
- Other terminals: nothing.
To always send the bell character, put this in ~/.claude/settings.json (it can sit next to your hooks object) and, in Apple Terminal, turn on Audible bell under Settings → Profiles → Advanced:
{
"preferredNotifChannel": "terminal_bell"
}
For a desktop notification in Ghostty, Kitty or iTerm2 (including over SSH outside tmux), leave the channel at "auto". On Claude Code versions before v2.1.326, the same guide says to set it to "iterm2", "kitty" or "ghostty" on the machine running Claude Code.
In iTerm2, go to Settings → Profiles → Terminal, tick Notification Center Alerts, click Filter Alerts, and enable Send escape sequence-generated alerts. Also allow iTerm2 (and Ghostty or Kitty, if you use those) to send notifications in System Settings → Notifications.
If you run Claude Code inside tmux 3.3 or later, its terminal notification escape sequences need passthrough to reach the outer terminal. A local osascript banner goes directly through macOS. Add this to ~/.tmux.conf, then run tmux source-file ~/.tmux.conf, detach, reattach, and restart Claude Code:
set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
Only the allow-passthrough line is needed to forward notifications. With on, the official sample only forwards them from a pane tmux is currently showing. On tmux 3.3 or later this is the documented requirement; versions older than 3.3 have no allow-passthrough. Before Claude Code v2.1.326, or on older tmux, the guide says to set preferredNotifChannel to "iterm2", "kitty" or "ghostty".
Codex
Codex has two official notification paths in ~/.codex/config.toml. Put notify in your user-level config; Codex ignores notify in a project-local .codex/config.toml.
TUI notifications are built in. They can be turned on for all supported types, or limited to specific ones. Current docs name agent-turn-complete and approval-requested. You can also choose how and when they fire:
[tui]
notifications = true
# Or only some types:
# notifications = ["agent-turn-complete", "approval-requested"]
notification_method = "auto" # or "osc9" or "bel"
notification_condition = "unfocused" # or "always"
notification_method defaults to "auto": Codex prefers OSC 9 when the terminal appears to support it, and falls back to BEL (\x07) otherwise. notification_condition defaults to "unfocused".
notify runs an external program whenever Codex emits a supported event. As of the docs checked on 1 December 2026, that program currently receives only agent-turn-complete (so it will not cover an approval prompt; use tui.notifications for that). The value is an argv array. Put it at the top level, before [tui] or any other TOML table. Official examples install terminal-notifier first, then point Codex at a short script:
notify = ["python3", "/path/to/notify.py"]
#!/usr/bin/env python3
import argparse
import json
import subprocess
import sys
def main() -> int:
parser = argparse.ArgumentParser(
description="Show a Codex turn-completion notification on macOS."
)
parser.add_argument("notification", type=json.loads, help="Codex notification JSON")
notification = parser.parse_args().notification
if notification.get("type") != "agent-turn-complete":
return 0
title = f"Codex: {notification.get('last-assistant-message', 'Turn Complete!')}"
message = " ".join(notification.get("input-messages", []))
subprocess.check_output(
[
"terminal-notifier",
"-title",
title,
"-message",
message,
"-group",
"codex-" + notification.get("thread-id", ""),
"-activate",
"com.googlecode.iterm2",
]
)
return 0
if __name__ == "__main__":
sys.exit(main())
That script is the official Python sample. It expects the notification JSON as one argument, not on stdin. The -activate com.googlecode.iterm2 flag focuses iTerm2 when you click the banner; change it if you use another terminal. You can use both notify and tui.notifications at once.
Codex also has lifecycle hooks, including a Stop event, but the notification setup documented for desktop alerts is notify and [tui] rather than a Stop hook.
Cursor
Cursor 1.5 added native OS notifications “when an agent run finishes or when input is required, for example approving a command that is not allowlisted,” and says to enable them from Settings. That is the first thing to try. A Cursor staff reply confirms the path for local agents: Settings → General → Notifications, with Completion Sound and System Notifications. Allow Cursor in System Settings → Notifications as well.
For a custom banner or script, Cursor's hooks documentation describes a stop hook that fires when the agent loop ends. User-level hooks live in ~/.cursor/hooks.json and need "version": 1. The hook receives JSON on stdin, including status (completed, aborted or error) and loop_count. Cursor does not publish an osascript snippet; the command below is a minimal hook on that documented event:
{
"version": 1,
"hooks": {
"stop": [
{
"command": "osascript -e 'display notification \"Agent finished\" with title \"Cursor\"'"
}
]
}
}
Two caveats from the official hook contract: a stop hook may return {"followup_message": "..."}, and Cursor will send that as the next user message, so a notification hook should print nothing (or {}) and exit 0. Exit code 2 blocks the action. If the file does not reload on save, restart Cursor. This stop hook answers “the loop ended”; it is not a documented stand-in for “waiting on approval.” Use Cursor's built-in OS notifications for the needs-input case.
Approve and answer from the notch
Hooks and bells tell you that something happened. They do not show the running step, and they do not let you approve a prompt from wherever you are looking.
NotchClippy is our Mac app. From v1.2.0 it can connect Claude Code, Codex and Cursor. While an agent works, its mark and running time sit in the notch, on every display. A new Agents tab shows each session as a note, with steps ticking off as they finish. When an agent asks for permission, a slip comes out of the notch with Deny and Allow. It never decides for you. When a turn ends, you can type the next prompt in the notch and send it to the agent's Terminal or iTerm2 tab, or jump to that tab. It can also show what's left of your Claude, Codex, Cursor and GitHub Copilot limits, and when each one resets.
Connect an agent from Settings → Agents, or from the notch's Agents tab. NotchClippy adds its entries to the agent's own hooks file, keeps a backup, and leaves the rest of your hooks alone, so a Notification or Stop hook you already added should stay in place. An optional sound, off until you turn it on, can play when an agent needs you or finishes.
It needs macOS 15 or later, on Apple Silicon and Intel. Displays without a hardware notch, including external monitors, get a virtual notch. You can try every feature free for 7 days, with no account or card. A licence is a one-time $9 launch price (regular $12) for 2 Macs, with updates included and a 14-day refund window.
What we do not claim: NotchClippy is not a replacement for Notification Center, and it is not a music or Live Activities island. If you only want a banner when Claude is done, the hooks and terminal settings above are enough.
What NotchClippy can and cannot see
This is the wording on the NotchClippy FAQ, not a broader access claim:
It sees what a connected agent reports as it works: your prompt, each step's short description, the command or file name, and its last reply. That is shown in the notch and kept in memory only, never stored, logged or sent anywhere. It never answers a request for you.
The v1.2.0 changelog repeats that prompts and steps live in memory only: they are never saved or sent. The app still goes online to check a licence, to look for updates if you allow it, and to fetch usage if you turn that on.
It does not get Screen Recording or Accessibility permission for the agent features. Those permissions are only requested if you use screenshots or optional paste-into-apps, which are separate tools in the same notch.
Other notch apps in this niche
A few Mac notch apps also advertise coding-agent alerts or approvals. NotchNook Pro lists approvals for Claude Code and Codex from the notch on its official site. We have not re-audited every agent-focused notch app in this article, and a banner from a hook is not the same product as a live session in the menu bar. If you arrived here while comparing notch apps, start with that NotchNook alternatives page.
Try it for seven days
If the built-in bell or a hook is all you needed, you can stop here. If you want to see Claude Code, Codex or Cursor in the notch, answer Deny or Allow without flipping back to the terminal, and keep those hooks in place, download NotchClippy and run the 7-day trial. There is no account or card for the trial, and the app stays on your Mac.
Sources checked 1 December 2026: Claude Code hooks guide, hooks reference, configure your terminal, Codex advanced configuration, Codex configuration reference, Codex hooks, Cursor hooks, Cursor 1.5 changelog, NotchClippy, the FAQ, and the v1.2.0 changelog.
Questions
Why don’t osascript notifications appear on my Mac?
Claude Code’s official hook examples use osascript, which routes banners through Script Editor. If Script Editor is not allowed to send notifications, the command fails silently. Run osascript -e 'display notification "test"' once, then turn on Allow Notifications for Script Editor in System Settings → Notifications, and run the test again.
What’s the difference between a Notification hook and a Stop hook?
A Notification hook fires when Claude Code sends a notification, for example permission_prompt after about six seconds, or idle_prompt about 60 seconds after Claude finished if you haven’t typed. A Stop hook fires when Claude finishes responding, so it is the better event if you want an alert as soon as a turn ends.
How do I get Codex or Cursor notifications on a Mac?
For Codex, enable [tui] notifications in ~/.codex/config.toml, or set notify to an external program; official examples use terminal-notifier and currently only emit agent-turn-complete to that program. For Cursor, version 1.5 added native OS notifications when a run finishes or input is required; enable them from Settings. You can also add a stop hook in ~/.cursor/hooks.json.
Does NotchClippy replace my hooks?
No. NotchClippy connects Claude Code, Codex and Cursor from Settings → Agents, adds its entries to the agent’s hooks file, keeps a backup, and leaves the rest of your hooks alone. You can keep a Notification or Stop hook for a desktop banner and still watch the run in the notch.
Can NotchClippy see my code?
It sees what a connected agent reports as it works: your prompt, each step’s short description, the command or file name, and its last reply. That is shown in the notch and kept in memory only, never stored, logged or sent anywhere. It never answers a request for you.
Do I need a hardware notch for this?
No. The hook, bell and Cursor or Codex notification setups work in a terminal or in Cursor without a notch. If you use NotchClippy, it adds a virtual notch on displays that don’t have one, including external monitors.