Claude Hookbook

Hooks / notifications

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 check

What 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

EventNotification
Matcherpermission_prompt|idle_prompt|agent_needs_input
Scopeuser
Platformsmacos, linux
Asyncruns in the background, reports on exit
Timeout10s
Requiresjq
Failure modeobserve
Verified againstClaude Code hooks reference, event/matcher schema checked 2026-09-10
Test statusneeds 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

  1. Save the script to .claude/hooks/notify-input-needed.sh and chmod +x it.
  2. Add the config fragment to ~/.claude/settings.json (user scope - useful in every project).

Test it

Sources

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 check

Notify when the agent completes

Desktop notification when Claude finishes a turn - useful for long unattended runs.

Notificationagent_completedlow riskneeds manual check

Pro Pack (later)

Framework bundles, cross-platform scripts, tested blocking policies, and a test harness. Free recipes and the generator stay free.

Waitlist opens soon.