Notify when Claude needs input
Desktop notification when Claude asks for permission or goes idle waiting for you.
Notificationpermission_prompt|idle_prompt|agent_needs_inputlow riskneeds manual checkWhat it does
Fires on Notification with the permission_prompt, idle_prompt, and agent_needs_input matchers, then posts a native desktop notification (osascript on macOS, notify-send on Linux). Runs detached so notification daemons never stall the session. Note: agent_needs_input is one of the newer matcher values - older Claude Code versions simply will not fire it.
When it runs
| Event | Notification |
| Matcher | permission_prompt|idle_prompt|agent_needs_input |
| Scope | user |
| Platforms | macos, linux |
| Async | runs in the background, reports on exit |
| Timeout | 10s |
| Requires | jq |
| Failure mode | observe |
| Verified against | Claude Code hooks reference, event/matcher schema checked 2026-09-10 |
| Test status | needs manual check - run the test steps below before relying on it |
Config
Merge this into .claude/settings.json (or ~/.claude/settings.json for user scope) - or use the generator to combine hooks.
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/notify-input-needed.sh",
"timeout": 10,
"async": true
}
],
"matcher": "permission_prompt|idle_prompt|agent_needs_input"
}
]
}
}Script
Save as .claude/hooks/notify-input-needed.sh and chmod +x it.
#!/bin/bash
# notify-input-needed: desktop notification on permission/idle prompts.
set -u
msg="Claude needs your input"
if command -v osascript >/dev/null 2>&1; then
osascript -e "display notification \"$msg\" with title \"Claude Code\"" >/dev/null 2>&1 &
elif command -v notify-send >/dev/null 2>&1; then
notify-send "Claude Code" "$msg" >/dev/null 2>&1 &
fi
exit 0
Install
- Save the script to .claude/hooks/notify-input-needed.sh and chmod +x it.
- Add the config fragment to ~/.claude/settings.json (user scope - useful in every project).
Test it
- Positive: trigger a permission prompt (e.g. a command that needs approval) - a desktop notification should appear.
- Negative: normal tool calls that need no approval should not notify.
Sources
- Claude Code hooks reference (checked 2026-09-10)
Related hooks
Terminal bell on permission prompt
Rings the terminal bell when Claude asks for permission, via the terminalSequence output field.
Notificationpermission_promptlow riskneeds manual checkNotify when the agent completes
Desktop notification when Claude finishes a turn - useful for long unattended runs.
Notificationagent_completedlow riskneeds manual checkPro Pack (later)
Framework bundles, cross-platform scripts, tested blocking policies, and a test harness. Free recipes and the generator stay free.
Waitlist opens soon.