claude-code - 💡(How to fix) Fix Notification hook idle_prompt should also fire when AskUserQuestion is waiting for selection [1 participants]

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…
GitHub stats
anthropics/claude-code#51882Fetched 2026-04-23 07:42:23
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Code Example

"hooks": {
  "Notification": [
    {
      "matcher": "idle_prompt",
      "hooks": [
        {
          "type": "command",
          "command": "bash /path/to/idle-notification.sh",
          "async": true
        }
      ]
    }
  ]
}
RAW_BUFFERClick to expand / collapse

Problem

The Notification hook with idle_prompt matcher only fires when Claude is waiting for text input. It does not fire when Claude presents a multi-choice selection UI (e.g., from AskUserQuestion).

This means any idle reminder configured via hooks won't trigger when the user needs to pick an option — only when they need to type a response.

Current behavior

"hooks": {
  "Notification": [
    {
      "matcher": "idle_prompt",
      "hooks": [
        {
          "type": "command",
          "command": "bash /path/to/idle-notification.sh",
          "async": true
        }
      ]
    }
  ]
}
  • ✅ Fires when Claude finishes and waits for user text input
  • ❌ Does NOT fire when Claude presents a selection prompt (e.g., "Choose an option: 1. ... 2. ... 3. ...")

Expected behavior

idle_prompt should fire whenever Claude is waiting for any user interaction, including:

  • Text input prompts
  • Multi-choice selection prompts (AskUserQuestion)
  • Any other UI state where Claude is blocked on user response

Alternatively, provide a separate matcher (e.g., ask_user_question or waiting_for_selection) so users can hook into selection prompts specifically.

Use case

I have an idle notification that opens a browser reminder after 1 minute of inactivity, prompting me to switch back to the terminal. This works great for text prompts but completely misses selection prompts, which are equally important to respond to.

Environment

  • Claude Code on Windows 11
  • Using Notification hook with idle_prompt matcher
  • Settings configured in ~/.claude/settings.json

extent analysis

TL;DR

The idle_prompt matcher in the Notification hook should be extended or an additional matcher like waiting_for_selection should be introduced to cover multi-choice selection UI scenarios.

Guidance

  • Investigate the possibility of adding a new matcher (e.g., waiting_for_selection) to specifically target multi-choice selection prompts.
  • Consider modifying the existing idle_prompt matcher to include scenarios where Claude is waiting for user interaction beyond just text input.
  • Review the current implementation of the AskUserQuestion feature to understand how it differs from text input prompts and how this difference affects the idle_prompt matcher.
  • Evaluate the feasibility of introducing a more generic matcher (e.g., waiting_for_user_input) that could encompass all types of user input waits, including text and selection prompts.

Example

No code example is provided due to the lack of specific implementation details in the issue description.

Notes

The solution may require changes to the underlying logic of the Notification hook and the introduction of new matchers or modifications to existing ones. The exact implementation will depend on the internal workings of Claude and its hooks system.

Recommendation

Apply a workaround by introducing a new feature request or pull request to extend the idle_prompt matcher or add a waiting_for_selection matcher, as the current behavior does not meet the expected functionality.

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…

FAQ

Expected behavior

idle_prompt should fire whenever Claude is waiting for any user interaction, including:

  • Text input prompts
  • Multi-choice selection prompts (AskUserQuestion)
  • Any other UI state where Claude is blocked on user response

Alternatively, provide a separate matcher (e.g., ask_user_question or waiting_for_selection) so users can hook into selection prompts specifically.

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 Notification hook idle_prompt should also fire when AskUserQuestion is waiting for selection [1 participants]