Pops a desktop notification when Claude Code needs your input, so you can work elsewhere while it runs.
WHEN TO USE IT
When a long task runs in the background and you keep switching back to check whether it is waiting on you.
Formats change. If a field stops working, check it against Anthropic's documentation.
Read it before you install it. A hook runs with your user account's permissions, on its own, every time it is triggered. That is what makes it useful, and why a stranger's should never be installed unread — this one included.
The Notification event fires when Claude Code wants your attention. Put it in your user settings — it is a preference, not a project rule.
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Claude Code needs your input\" with title \"Claude Code\"'"
}
]
}
]
}
}
Swap the command for your platform. With no matcher, the hook runs for every notification.
Linux (libnotify):
notify-send 'Claude Code' 'Claude Code needs your input'
Windows (PowerShell — plays the system alert sound):
powershell -NoProfile -Command "[System.Media.SystemSounds]::Asterisk.Play()"
MORE HOOKS
The authority
Anthropic's documentation for Hooks
This template is a starting point. Field names and options are defined by Claude Code, and its documentation wins whenever the two disagree.
https://code.claude.com/docs/en/hooks