A Claude Code hook that rings the terminal bell (\a) when user input is needed. In Windows Terminal, this shows a bell icon on the tab — so you can tell which tab needs you at a glance.
| Trigger | How it works |
|---|---|
| Permission dialogs | Notification:permission_prompt fires when Claude needs tool approval |
| AskUserQuestion dialogs | Also fires as permission_prompt |
Response ends with ? |
Stop event, script checks last_assistant_message |
No bell for working or idle states — only when Claude is waiting on you.
-
Save
bell-on-input-needed.shto~/.claude/hooks/and make it executable:mkdir -p ~/.claude/hooks curl -o ~/.claude/hooks/bell-on-input-needed.sh <raw-url-of-this-gist> chmod +x ~/.claude/hooks/bell-on-input-needed.sh
-
Add the hook registrations to your
~/.claude/settings.jsonunder the"hooks"key:"Notification": [ { "matcher": "permission_prompt", "hooks": [ { "type": "command", "command": "~/.claude/hooks/bell-on-input-needed.sh", "timeout": 1 } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "~/.claude/hooks/bell-on-input-needed.sh", "timeout": 1 } ] } ]
jq(for question-mark detection onStopevents; bell still works for permission dialogs without it)- A terminal that supports the bell character (Windows Terminal, iTerm2, most modern terminals)
- Trailing
?heuristic — May false-positive on code ending with?(URLs, ternary operators). May miss questions that aren't at the end of the response. - Bell fires even if you're looking at the tab — The ~6s typing-idle delay only suppresses during active typing, not passive viewing.