Notification setup generator for Claude Code, Codex and Gemini CLI.
A hook is a short command your AI agent runs at a set moment, such as when it finishes a reply. This free tool writes the hook, or the built-in setting, for you.
Choose your agent, the moments you care about (it finished, or it needs your OK) and how you want to hear about it. This page writes the exact snippet, names the file it goes in, and can merge it into a copy of that file. Claude Code gets Stop and Notification hooks; Codex and Gemini CLI get their own. Nothing you type leaves your browser.
Cowork Island
macOS 14 or later.
Apple silicon and Intel.
No account needed for Free.
Choose your alert.
The choices below need JavaScript. Without it, this page shows the most common setup: a Mac banner from Claude Code when it finishes or needs you.
Your setup.
Pick at least one moment: when it finishes, or when it needs you.
For a Mac banner, you may not need a hook. For a phone alert, a spoken line or a sound-only alert, use the generated hook below. In iTerm2, Ghostty and Kitty, Claude Code already shows a desktop notification when it finishes or needs you and you seem to be away from the terminal. In iTerm2, also open Settings > Profiles > Terminal, check Notification Center Alerts, click Filter Alerts and turn on Send escape sequence-generated alerts. Hooks run alongside that built-in notification, so with both you may get two alerts.
For a Mac banner, you may not need a hook. For a phone alert, a spoken line or a sound-only alert, use the generated hook below. Codex's own terminal alerts are on by default. Codex's docs say they use an escape sequence that some terminals show as a desktop notification, so in your terminal they may already appear. To keep them to the moments you picked, use the [tui] lines below. These settings control alerts on your Mac. They do not replace a phone-alert hook.
For a Mac banner, you may not need a hook. For a phone alert, a spoken line or a sound-only alert, use the generated hook below. Gemini CLI's built-in notifications show as desktop notifications in iTerm2, WezTerm, Ghostty and Kitty. They are experimental and off by default: turn them on in Gemini CLI with /settings > General > Enable Notifications. Use either that or the hooks below, not both, or you get two alerts.
Codex's built-in alerts, with the bell.
Optional: Codex's built-in Mac alerts.
In ~/.codex/config.toml
If the file already has a [tui] section, don't add the [tui] line again. Under the existing one, change the value of any of these keys that is already there and add only the missing ones. A second [tui] header, or the same key written twice, stops Codex from reading the file.
What the bell does depends on your terminal. In Terminal, open Settings > Profiles > Advanced > Bell to choose a sound, a badge or a bouncing Dock icon.
Hooks for your selected alert.
In ~/.claude/settings.json~/.codex/hooks.json~/.gemini/settings.json
Add these entries to the "hooks" object in the file, next to what is already there. Do not replace the file: it can hold your other settings and other tools' hooks. Settings files are strict JSON, so no comments and no trailing commas. Easier: paste your current file in the merge box below.
Add these as new entries in the file. Cowork Island and other tools can write to this same file, so never overwrite it; the merge box below does this for you. Then open Codex, type /hooks and trust each new entry: Codex skips new or changed hooks until you do.
Add these entries to the "hooks" object in the file, next to what is already there, or use the merge box below. Gemini CLI hooks may print only JSON, so each command ends by printing {}.
Add this setting to the file, next to what is already there, or use the merge box below.
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "/usr/bin/osascript -e 'on run argv' -e 'display notification (item 1 of argv) with title (item 2 of argv) subtitle (item 3 of argv) sound name \"Glass\"' -e 'end run' 'Claude Code finished' 'Claude Code' \"${PWD##*/}\""
}
]
}
],
"Notification": [
{
"matcher": "permission_prompt|elicitation_dialog|elicitation_url_dialog",
"hooks": [
{
"type": "command",
"command": "/usr/bin/osascript -e 'on run argv' -e 'display notification (item 1 of argv) with title (item 2 of argv) subtitle (item 3 of argv) sound name \"Funk\"' -e 'end run' 'Claude Code needs you' 'Claude Code' \"${PWD##*/}\""
}
]
}
]
}
}
- For Claude Code, permission alerts and input requests from connected tools arrive about 6 seconds after the prompt appears, and typing pushes them back. That is how Claude Code's Notification hook works. Other questions may not trigger this hook.
- The finished alert uses Stop, which fires each time Claude finishes a reply, not only at the end of a long task. It does not fire when you interrupt Claude.
- Claude Code holds back hooks in a folder until you accept its workspace trust dialog. On a work Mac, your organization may allow only its own hooks.
- This uses Claude Code's built-in setting, not a hook. It covers both moments, a finished task and a waiting permission prompt. You can also set it in Claude Code with
/config> Local notifications. What the bell does depends on your terminal: in Terminal, open Settings > Profiles > Advanced > Bell. - This turns on Gemini CLI's built-in notifications, which are experimental, and asks for the bell. They cover both moments: action required and session complete.
- The PermissionRequest entry runs in the background and makes no decision: Codex still shows its normal approval prompt.
- Use either these hooks or Gemini CLI's built-in notifications (Enable Notifications in
/settings), not both, or you get two alerts. - Gemini CLI's docs say that unpaid-tier and Google One users were moved to Antigravity CLI on 18 June 2026. These settings are for Gemini CLI.
- If a session that is already open does not pick up the change, restart it.
Optional: a banner through Codex's notify setting instead.
Codex's notify setting runs one program each time a turn completes. It never runs for approvals. If you use it, leave out the Stop entry above, or you get two banners for the same reply.
1. Save this as ~/.codex/notify-macos.js
Codex does not expand ~ in this setting, so the path must be complete. In Terminal, echo $HOME shows it.
2. Add this line to ~/.codex/config.toml
Type your user name above: until then the line says YOUR_NAME.
- Only one
notifyline is allowed per file. If yours already has one, do not add a second: the file would no longer load. Use the Stop hook above instead. - Put the line near the top, above the first line that starts with
[. Below a section header such as[tui], Codex reads it as part of that section and ignores it. - Cowork Island never uses
notify, so this line and the app do not collide.
Test it in Terminal:
Your randomly named ntfy topic.
Topics on ntfy.sh are public. Anyone who knows or guesses a topic name can read what is sent to it, so treat it like a password. That is why this topic is 32 random characters made by your browser, and why the hook sends only a fixed line such as “Claude Code finished”, never the agent's reply or the contents of your files.
On your phone, install the ntfy app and subscribe to this topic. ntfy.sh is a free third-party service with its own daily message limits.
Test it.
Paste this line in Terminal and press Return. It runs the same command the hook will run, so it sends one test message to your topic.
/usr/bin/osascript -e 'on run argv' -e 'display notification (item 1 of argv) with title (item 2 of argv) subtitle (item 3 of argv) sound name "Glass"' -e 'end run' 'Claude Code finished' 'Claude Code' "${PWD##*/}"
Test the bell.
Paste this line in Terminal and press Return:
printf '\a'
Allow Script Editor to show notifications. These banners come from macOS's Script Editor app, and macOS does not ask for permission first: until you allow it, nothing appears and nothing tells you why. Run the test line once, then open System Settings > Notifications, find Script Editor and turn on Allow Notifications.
Merge it into your current file.
Paste your whole current file here and this page adds your new entries to it. Hook entries already in the file stay as they are, including other tools' entries and Cowork Island's. If you picked a built-in setting, its new value replaces the old one, and the page tells you which. If you merge the same choice twice, nothing is added twice. What you paste stays in this page.
Merging needs JavaScript. Without it, add the entries by hand as described above.
For this choice there is nothing to merge: the setting goes in ~/.codex/config.toml, as shown above.
Open the file in a text editor, select everything, copy and paste it here. If the file does not exist yet, leave this empty.
If you also use Cowork Island.
Cowork Island, the Mac app made by this tool's maker, adds its own entries to the same files when it connects to Claude Code, Codex or Gemini CLI. These entries sit alongside your existing hooks. The app treats an entry as its own when its command contains /.perch/ anywhere (in any letter case), and it removes and adds back whole entries, not single commands.
- Every snippet here is its own entry and never points inside
~/.perch/, so reinstalling or switching off Cowork Island leaves it alone. - Do not paste one of these commands into one of Cowork Island's entries, and do not keep your own scripts in
~/.perch/: the app would treat them as its own. - Do not delete Cowork Island's entries by hand while its integration is on: the app adds them back the next time it starts.
- Both run side by side. Claude Code and Codex run all matching hooks at the same time, and Gemini CLI waits for all of them.
- For Claude Code, the alert for a permission prompt uses the Notification event, never a PermissionRequest hook, so it can never answer a request for you.
- For Gemini CLI, this tool writes AfterAgent and Notification hooks, never BeforeTool hooks.
What this page does with your input.
Everything happens in your browser. The generator makes no network request, stores nothing and sets no cookies: nothing you choose, type or paste leaves this page. Copy writes to your clipboard only when you click it. The ntfy topic is made with your browser's built-in random number generator. As on every page of this site, the visit itself is counted as described in the privacy policy.
The no-setup option.
Cowork Island is a Mac app by the maker of this tool. It keeps your AI agent sessions in a notch panel and shows the state of each one, so you can see at a glance which one needs you. It works with or without a notch.
- Claude Code and the tools the app finds on your Mac connect on their own. Codex stays off until you switch it on in Settings and allow Cowork Island's hooks in Codex.
- Each session shows its status, and “Needs you” when it waits for you. By default, the island then opens by itself, unless that session's terminal or app is already in front.
- When a session finishes, the island opens for 5 seconds by default.
- For Claude Code, you can allow or deny an action, or answer a multiple-choice question in the Island. Answering there is free. With other tools, you may need to respond in their own app or terminal.
- Sounds are off until you turn them on. The "Approval needed" sound is free; the "Session complete" chime is part of Pro. The app shows no macOS banners of its own.
Free shows one session card at a time. Pro shows all your sessions, and jumping back to a session's window, tab or pane is part of Pro. A 7-day Pro trial starts by itself, once per Mac, without payment details. See plans and the install guide.
Download for freeSources.
- Claude Code docs: Hooks reference
- Claude Code docs: Hooks guide
- Claude Code docs: Terminal configuration
- Claude Code docs: Settings reference
- Codex docs: Hooks
- Codex docs: Advanced configuration
- Codex docs: Configuration reference
- Gemini CLI docs: Hooks reference
- Gemini CLI docs: Notifications
- Gemini CLI docs: Configuration reference
- Mac Automation Scripting Guide: Displaying notifications
- Terminal User Guide: Advanced settings
- ntfy docs: Publishing
- Cowork Island FAQ and install guide
Sources checked 18 October 2026. This tool is written by Cowork Island's maker. For corrections, email support@coworkisland.com or open an issue on GitHub.