claude-code - 💡(How to fix) Fix AskUserQuestion does not fire Notification hook (silent user-input wait)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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

  1. Configure a Notification hook in ~/.claude/settings.json that produces an audible/visual signal (e.g. writing BEL to tty for a tab-coloring daemon).
  2. From an outer agent or model that uses AskUserQuestion, invoke the tool with any question.
  3. Switch focus to a different terminal tab or app while the question UI is shown.
  4. Observe: no Notification hook fires; no signal reaches the user.
  5. Switch back and answer the question → only then does Stop hook 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix AskUserQuestion does not fire Notification hook (silent user-input wait)