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.

Last updated

Cowork Island

macOS 14 or later.
Apple silicon and Intel.
No account needed for Free.

Download 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.

Which agent?
Tell me when it
How?
Sounds

These are the sounds in your Mac's System Sounds folder.

Your setup.

In ~/.claude/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.

{
  "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.
  • If a session that is already open does not pick up the change, restart it.

Test it.

Paste this line in Terminal and press Return. It runs the same command the hook will run.

/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##*/}"

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.

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 free

Sources.

Send yourself the download link for later.