AskUserQuestion does not fire Notification hook (silent user-input wait)
Summary
When Claude Code awaits user input via AskUserQuestion tool, no hook event fires. Users relying on hooks for async-workflow notifications (terminal bell, system notification, etc.) silently miss these "Claude needs your input" moments.
Steps to Reproduce
- Configure a
Notificationhook in~/.claude/settings.jsonthat produces an audible/visual signal (e.g. writing BEL to tty for a tab-coloring daemon). - From an outer agent or model that uses
AskUserQuestion, invoke the tool with any question. - Switch focus to a different terminal tab or app while the question UI is shown.
- Observe: no Notification hook fires; no signal reaches the user.
- Switch back and answer the question → only then does
Stophook fire (after Claude finishes its post-answer response), well after the user would have wanted to know.
Expected Behavior
When Claude Code displays a UI awaiting user input (AskUserQuestion, possibly also permission prompts that already fire Notification), a Notification hook event SHOULD fire so users can be alerted via their hook pipeline.
Actual Behavior
AskUserQuestion is treated as a tool call in flight; Claude is "waiting on tool result" rather than "awaiting user input" at the hook layer, so no event fires until the tool returns.
Why This Matters
Async-workflow users (e.g. multi-tab terminal multiplexing, remote sessions over mosh, BEL-driven tab-coloring daemons) rely on hooks to know when Claude needs attention. Currently:
- "Claude finished responding" → Stop hook ✓ works
- "Claude needs permission for Bash command" → Notification hook ✓ works
- "Claude is asking user to pick from options via AskUserQuestion" → no hook ✗
The third case is just as much "awaiting user input" as the second, but the notification pipeline silently drops it.
Suggested Fix
Fire \Notification\ hook (with appropriate \hook_event_name\ payload distinguishing it from permission prompts) when \AskUserQuestion\ is shown to the user.
Environment
- Claude Code version: 2.1.143
- OS: macOS
- Use case: BEL byte → tmux → mosh → iTerm2 → tab-coloring daemon
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗