Omniscio

OmniscioGuidesA notification hook

A Claude Code notification hook that reaches you

A long turn is exactly when you stop watching the terminal, and Claude Code picks that moment to wait for you. The hook below turns that wait into a desktop alert, so the tab you switched to does not become twenty minutes of nothing happening.

Checked against Anthropic’s Claude Code hooks documentation on November 25, 2026. By the Omniscio team. Updated .

The problem

Claude Code already ships desktop notifications, and if they work for you, this page is optional. They do not always work: a terminal you detached from, a machine where you muted the app, or a session on a box that has no notification daemon all leave you checking back by hand. A hook is the same alert through a command you control, in the same place every time.

The other half is timing. Anthropic’s documentation is specific: a permission prompt notifies after it has waited about six seconds, and an idle prompt about 60 seconds after Claude finished responding, only if you have not typed since and no background agent is still running. If a minute is too late for what you need, the Stop hook below is the immediate alternative.

The hook, per platform

All three go in ~/.claude/settings.json, which covers every project on the machine. If that file already exists, add the hooks object to it rather than replacing the file: a full-file paste silently drops your other settings. Anthropic’s quickstart gives all three commands, reproduced here as documented, and a command hook runs a shell command with your full user permissions, so read it before you paste it.

The quickest useful version narrows the alert to the one you want, which is why the first block carries a matcher and the three platform blocks below it keep the empty one:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "idle_prompt",
        "hooks": [
          {
            "type": "command",
            "command": "notify-send 'Claude Code' 'Waiting for you'"
          }
        ]
      }
    ]
  }
}

Swap the command for the one for your platform below, and keep the "matcher": "idle_prompt" line. With an empty matcher instead, every notification type fires it, including authentication successes.

macOS

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

Linux

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "notify-send 'Claude Code' 'Claude Code needs your attention'"
          }
        ]
      }
    ]
  }
}

Windows, from PowerShell

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "powershell.exe -Command \"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('Claude Code needs your attention', 'Claude Code')\""
          }
        ]
      }
    ]
  }
}

Which notification you actually want

Notification is one event with a matcher table of more than a dozen types. These are the ones a person waiting on a session cares about:

MatcherWhen it fires
permission_promptClaude needs you to approve a tool use or a sandboxed command’s network request, and the prompt has waited about six seconds
idle_promptClaude finished responding about 60 seconds ago, you have not typed since, and no background agent is still running
elicitation_dialogAn MCP server opens a form and you have not typed for about six seconds

Two things to know. Matcher values are case sensitive, so Idle_Prompt matches nothing. And if the built-in desktop notification already reaches you, your hook and that notification both fire, because the timing types share one clock.

One silence has a documented cause: Claude Code does not send idle_prompt while it waits for a claude.ai usage limit to reset. If the session is parked on a limit, no alert is due.

If you want to act the instant Claude asks for permission rather than six seconds later, the event for that moment is PermissionRequest, which fires when Claude Code is about to ask you, with no delay. It does not run for a sandboxed command’s network request, so the permission_prompt notification is what covers that prompt, and a notification hook cannot approve anything.

“Finished” and “needs you” are different events

An idle_prompt arrives about a minute after the turn ends, and only if you have not typed since and nothing else is running. If you want the alert the moment Claude stops talking, that is Stop, which runs when the main agent has finished responding. It does not fire on a user interrupt, and an API error fires StopFailure instead.

The command is the same platform-specific one as above; the Linux form is shown, and macOS and Windows readers swap in theirs.

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "notify-send 'Claude Code' 'Turn finished'"
          }
        ]
      }
    ]
  }
}

There is no matcher here on purpose: Stop has no matcher support, and a matcher field on it is silently ignored. The cost is that Stop fires on every completed turn, including trivial ones, and cannot tell “waiting on you” from “finished” — so a thirty-turn session gives thirty alerts. Use Stop when you want a per-turn signal, and Notification when you only want to know that Claude needs you.

One caution if you extend the Stop version to read the answer: the event carries last_assistant_message, and Anthropic recommends it over reading the transcript file, because the transcript is written asynchronously and may not yet hold the final message when the hook runs.

What each line does

PartJob
"Notification"The event key. It runs when Claude Code sends a notification.
"matcher": "idle_prompt"Narrows the hook to one notification type. An empty matcher matches every type.
"type": "command"Runs a shell command with the event JSON on stdin. The examples ignore stdin because they use fixed text; the JSON does carry the notification’s message, an optional title, notification_type and the common fields.
osascript -e 'display notification …'macOS’s scriptable notifier. It routes through the Script Editor app, which needs notification permission.
notify-sendLinux’s desktop notifier. It needs a notification daemon and a display session.
System.Windows.Forms.MessageBoxWindows’s dialog, shown through PowerShell because that is present on every install.

The event JSON carries message, notification_type and an optional title, plus the common fields such as session_id and cwd. Putting $(jq -r '.message') in the command replaces the fixed text with Claude Code’s own wording, which is useful when several sessions share one machine.

How to test that it fires

  1. Run the notifier on its own first. notify-send 'Claude Code' 'test', or the osascript line, or the PowerShell command. If that shows nothing, the hook is not the problem.
  2. Confirm the hook is registered. Anthropic’s quickstart says to type /hooks and check the hook appears under Notification. The menu is read-only and shows the settings file it came from.
  3. Trigger a permission prompt. Ask Claude to run a command that needs approval and then leave it alone. The alert should arrive about six seconds later.
  4. Or wait for idle. With an idle_prompt matcher, ask a short question, then do not type. The alert should arrive about a minute after the answer finishes.
  5. When nothing arrives, read the debug log. Start with claude --debug-file /tmp/claude.log and follow the file. A Notification hook that fails produces no visible notice, which is the next section.

We could not test delivery here: this machine has no notify-send and no desktop notification daemon, and it is not macOS or Windows. What the page can say is which command the documentation gives for each platform and where each one is documented to fail silently.

The common failures

1. macOS: the command works, nothing appears

osascript routes through Script Editor, and without notification permission for it the command fails silently, with no prompt from macOS. Anthropic’s fix is to run osascript -e 'display notification "test"' once in Terminal, then open System Settings, find Script Editor under Notifications and turn on Allow Notifications.

2. Linux: notify-send is not there

It needs a desktop notification daemon, and headless servers, SSH sessions and most containers do not have one. Run the command by hand; if it is missing, install libnotify-bin on Debian and Ubuntu, or your distribution’s equivalent. A remote or headless session is the wrong place for this hook at all: send the alert off the machine, for example with a curl to a push service that reaches your phone.

3. Windows: the dialog opens behind the terminal

The documented command opens a dialog box rather than a corner notification, so it can appear under the window you are working in, and the command does not return until the dialog is dismissed. Inside WSL, powershell.exe has to be on PATH through Windows interop.

4. Nothing is reported when it fails

On Notification, Anthropic documents that the exit code and stderr are ignored, because the notification has already been decided. A broken command therefore produces no transcript notice at all. The debug log, and the manual run from step one, are the only two ways to see it.

5. The hook is never loaded

A JSON syntax error in settings.json disables every hook in that file with no message, and a hook added mid-session may not be picked up until a new session starts. Save the file, start a new session, then look at /hooks. If the hook is listed but silent, the matcher is the next suspect: the values are case sensitive and match exactly, so Idle_Prompt matches nothing.

Where Omniscio fits

A notification hook belongs to one machine, so it lives in your user settings; a project’s .claude/settings.json is shared with the repository, which is the wrong place for a personal alert. Omniscio’s Hooks panel can carry the hooks it ships, and any you define, into every session it spawns, held in its own database rather than written into your global Claude configuration. The Claude Code hooks guide covers the panel, and the hooks builder assembles the block from the event, matcher and handler you pick.

Omniscio runs on Windows, macOS and Linux, and the pricing page covers the plans.

How this page was written

The event, its matcher types, their timing, the input fields, the rule that it cannot block and the Stop alternative were read from Anthropic’s Claude Code hooks reference on November 25, 2026. The three platform blocks and their troubleshooting notes come from Anthropic’s hooks quickstart, read the same day.

No notification was delivered to write this page: this machine has no notification daemon, and the macOS and Windows instructions cannot be exercised on it. The commands are quoted from the documentation rather than observed, and the page does not claim an alert appeared.

Sources

  • Anthropic’s Hooks reference, for the Notification event, every matcher value and its timing, the input fields, the no-block rule, Stop, StopFailure and PermissionRequest, read November 25, 2026.
  • Anthropic’s Automate actions with hooks, for the macOS, Linux and Windows commands and the “if no notification appears” notes, read November 25, 2026.

Common questions

How do I get a notification when Claude Code finishes?

A Notification hook with an idle_prompt matcher fires about 60 seconds after Claude finished responding, if you have not typed since and no background agent is running. For an alert the moment the turn ends, use a Stop hook instead, accepting that it fires on every turn.

Why does my notification hook not fire?

Check four things in order: the hook appears under Notification in the /hooks menu, the settings file is valid JSON, the matcher names a real notification type and matches case for case, and the notification command works when you run it by hand. On macOS a missing Script Editor permission makes osascript fail silently, and on Linux notify-send needs a desktop notification daemon.

Does turning off desktop notifications stop the hook?

No. Anthropic documents that the hook receives the event even with desktop notifications turned off: the preferred notification channel setting changes only how you are alerted, not whether the hook runs. That is why a disabled desktop notification plus a working hook can still produce your own alert.

Can a Notification hook block or change the notification?

No. Anthropic documents that Notification hooks cannot block or modify notifications, that their systemMessage and continue fields are discarded, and that their exit code and stderr are ignored. Use PermissionRequest if you need to decide something at the moment Claude asks for permission.

Know which session needs you

Omniscio runs your Claude Code sessions side by side and shows which one is waiting, so a notification is a nudge rather than the only signal you get. It can also compose the hooks it ships, and any you define, into every session it spawns.

The features page covers what else it does, pricing covers the plans, and you can download it for Windows, macOS or Linux.