[FEATURE] Add hook for when Claude is waiting for user input
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When Claude stops to wait for user input (like the AskUserQuestion interactive prompt), there's no configurable hook that fires. I want to play an audio chime whenever Claude needs my attention so I know to check back on it.
Currently:
Stophook only fires when Claude finishes completely, not when waiting for inputNotificationhook withidle_promptonly fires after 60+ seconds idle (too slow for immediate feedback)
This means if Claude asks me a question via the interactive UI picker, I have no way to get notified. Claude just sits there waiting while I'm doing something else, not knowing it needs my input.
Proposed Solution
Either:
- Add a new hook like
WaitingForInputorYieldthat fires whenever Claude yields control back to the user (including AskUserQuestion prompts, permission dialogs, etc.)
Or:
- Expand the
Stophook to also fire when Claude is waiting for input, not just when completely finished.
The hook should fire immediately when Claude pauses
Alternative Solutions
I've tried:
Stophook - doesn't fire when waiting for input, only on complete finishNotificationhook withpermission_promptmatcher - only covers permission dialogs, not AskUserQuestionNotificationhook withidle_prompt- 60 second delay is too long for immediate feedback
There's no current workaround that covers the AskUserQuestion interactive prompt case.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
- I ask Claude to help me build a feature
- Claude uses AskUserQuestion to show me a multi-select UI asking for clarification
- I've tabbed away to another window while waiting
- Claude sits there waiting for my input - I have no idea it needs me
- With this feature, my configured hook would play a chime immediately when the question appears
- I'd hear the chime, switch back, answer the question, and Claude continues working
Additional Context
The AskUserQuestion tool and similar tools creates an interactive UI prompt but doesn't trigger any hookable event. This seems like an oversight since other "waiting" scenarios (permissions, idle) do have notification support.
26 Comments
Agreed, I have the same need
This would be really helpful
Re: @currenthandle, this should be default behavior, but until this is picked up my anthropic, simplest answer I have found and tested that actually works. Put this into your <agent>.MD:
Not perfect, better would be if claude does this deterministically, but its a start...
I've been working on a voice hooks implementation for Claude Code and discovered something relevant to this discussion.
I initially implemented a special sound for
AskUserQuestionusing thePreToolUsehook with a tool name matcher:However, I found that both
PreToolUseandPermissionRequestfire simultaneously forAskUserQuestion(and other permission-required tools). This causes both sounds to play at the same time, creating audio conflicts.Looking at the hook event flow:
PreToolUsefires → informational ("tool is about to run")PermissionRequestfires immediately after → requires user action ("Claude needs your input")Since
AskUserQuestioninherently requires user interaction, thePermissionRequesthook is sufficient and semantically correct for this use case. Adding special handling inPreToolUseis redundant.Conclusion: The
PermissionRequesthook already covers the "user input required" scenario that this issue requests. If you want tool-specific sounds, you can match on tool_name within thePermissionRequesthandler instead ofPreToolUse.My implementation (with configurable hooks and sounds): https://github.com/shanraisshan/claude-code-voice-hooks
Workaround using iTerm2 Triggers
While waiting for native hook support, I found a workaround using iTerm2's trigger feature. Triggers watch for text patterns in terminal output and can take actions like ringing the bell, changing tab title, bouncing the dock icon, etc.
Setup:
Enter to selectThis matches the instruction text that appears at the bottom of AskUserQuestion prompts.Notes:
Not a perfect solution, but it works until there's a proper AskUserQuestion notification hook.
When Claude Code uses the AskUserQuestion tool to ask for user input, it would be helpful if the terminal/CLI window could flash or blink in the taskbar to get the user's attention. This is especially useful when working in other applications like Visual Studio and waiting for Claude to complete a task and you have sounds off.
Found https://github.com/anthropics/claude-code/issues/4690 closed, would be a great to have it.
I would also like to have this so that I can rename the window title. Doing so would allow me to see at a glance which tmux windows require my input.
@samuela you might actually find https://github.com/petergaultney/lemonaid/tree/main useful, since it has a fairly deep tmux integration for Claude Code 💛
Interesting, thank you for sharing!
🎉 SOLVED: Instant Notifications When Claude Finishes - The Stop Hook Discovery
I've successfully implemented instant desktop notifications (sound + toast popup) when Claude Code finishes responding and needs input. After extensive testing, I found the exact
solution to the 60-second delay problem!
---
🚨 The Breakthrough: The Stop Hook
Key Discovery: The Stop hook fires INSTANTLY when Claude finishes responding and yields control back to you!
Terminal Tab Transition:
This is the exact transition point from "Claude working" → "Claude idle/waiting" - no more 60-second delay!
---
📊 Hook Testing Results
After testing all available hooks, here's what I found:
✅ RECOMMENDED HOOKS:
❌ NOT RECOMMENDED:
---
✅ Recommended Configuration: Triple-Hook Strategy
For maximum reliability, use all three hooks in your settings.local.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "powershell -ExecutionPolicy Bypass -NoProfile -File \"%USERPROFILE%\\.claude\\notification.ps1\" -Sound -Toast"
}
]
}
],
"PermissionRequest": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "powershell -ExecutionPolicy Bypass -NoProfile -File \"%USERPROFILE%\\.claude\\notification.ps1\" -Sound -Toast"
}
]
}
],
"Notification": [
{
"matcher": "idle_prompt",
"hooks": [
{
"type": "command",
"command": "powershell -ExecutionPolicy Bypass -NoProfile -File \"%USERPROFILE%\\.claude\\notification.ps1\" -Sound -Toast"
}
]
}
]
}
}
Why three hooks?
Settings file location: %USERPROFILE%\.claude\settings.local.json
---
🔧 What Works for Notifications
After testing various methods on Windows 10/11:
Recommendation: Use sound + toast combination for best results.
---
📝 Simple PowerShell Script Example
Here's a minimal working example you can use:
# Save as: %USERPROFILE%\.claude\notification.ps1
param(
[switch]$Sound,
[switch]$Toast
)
# Play notification sound
if ($Sound) {
try {
# Use system beep as simple notification
[Console]::Beep(1000, 300)
} catch {
# Silent fail
}
}
# Show toast notification
if ($Toast) {
try {
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$notify = New-Object System.Windows.Forms.NotifyIcon
$notify.Icon = [System.Drawing.SystemIcons]::Information
$notify.Visible = $true
$notify.BalloonTipTitle = "Claude Code"
$notify.BalloonTipText = "Claude has finished and is waiting for your input."
$notify.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Info
$notify.ShowBalloonTip(3000)
Start-Sleep -Milliseconds 1000
$notify.Dispose()
} catch {
# Silent fail
}
}
exit 0
Usage:
---
🔍 Debug Mode for Testing
To verify hooks are firing correctly:
claude --debug
You'll see output like:
[DEBUG] Executing hooks for Stop
[DEBUG] Getting matching hook commands for Stop
[DEBUG] Found 1 hook matchers in settings
[DEBUG] Executing hook command: powershell -ExecutionPolicy Bypass...
[DEBUG] Hook command completed with status 0
Also useful: Press Ctrl+O in Claude Code to toggle verbose mode.
---
💡 Key Findings & Tips
---
📊 Performance
---
🌟 What This Solves
✅ No more missing Claude questions while multitasking
✅ No more 60-second wait for notifications
✅ Instant feedback when Claude needs your attention
✅ Works for ALL response types, not just questions
✅ Completely automatic - no manual monitoring needed
✅ Audible + visual notifications that work reliably
---
🎨 Customization Ideas
Toast notification customization:
Different notification styles for different hooks:
Pass a parameter to the script and customize behavior based on context:
param([string]$HookType)
switch ($HookType) {
"Stop" { $notify.BalloonTipText = "Claude has finished responding" }
"Question" { $notify.BalloonTipText = "Claude is asking a question" }
default { $notify.BalloonTipText = "Claude needs your attention" }
}
---
🤝 For the Community
This addresses the core request in this issue: knowing when Claude is waiting for input. The Stop hook was the missing piece!
The sound + toast combination provides excellent notification coverage. Even if you're in another window or on another monitor, you'll hear the sound and see the popup notification.
Implementation is straightforward:
Hope this helps others! The Stop hook discovery should work for any notification method (not just Windows - could adapt to Linux notify-send or macOS osascript).
---
📝 Technical Notes
What works:
What doesn't work:
Cross-platform potential:
---
🎉 Never miss a Claude question again!
Tested on Windows 10/11 with PowerShell 5.1+
Great solutions here. I built something similar for Mac that adds one key feature: smart suppression.
The problem with the hook approach alone is you get notifications even when you're already looking at your terminal. After a day of that, you start ignoring them.
My solution checks if the terminal app (iTerm2, Kitty, Warp, Terminal, etc.) is in the foreground before firing the notification. If you're already looking at Claude, it stays silent.
I packaged it as Claude Code Notifier -- free Mac app that handles hook installation automatically and adds the foreground detection. Also has iOS/Android companions for when you're away from your desk.
For anyone wanting to DIY on Mac, the key insight is using NSWorkspace to check the frontmost application before calling the notification.
If your goal is getting notified when you're away from your desk — not just on the same machine:
https://github.com/chadbyte/claude-relay
Run
npx claude-relayin your project directory and you get push notifications on your phone for all of these — permission requests, questions, completions, errors. No hooks to configure, works with the browser closed.No install, no cloud, free and open source.
Workaround: "Waiting for Input" indicator via hooks + statusline
Until this gets a native solution, here's what's working for me. The statusline shows a green "INPUT NEEDED" badge when Claude is done -- helpful when running multiple sessions side by side.
It uses a signal file as a bridge: hooks create/delete it, the statusline checks for it.
!Image
Hooks (
settings.json):Statusline (add to your script):
Is there a way to add windows notifications for claude code CLI and VSCode when claude needs input? Now i need to check back with my claude instance every 2 seconds when im working on something else.
For what it's worth — this is a problem you can solve with Claude Code using the hooks that already exist.
On Linux (adapt
notify-send/paplayto your OS):Drop that in
~/.claude/settings.local.json. No npm packages, no paid apps, no 50-line PowerShell scripts. The hooks system already covers this use case —Stopfires instantly when Claude yields control.macOS equivalent:
osascript -e 'display notification "Waiting for input" with title "Claude Code"' && afplay /System/Library/Sounds/Glass.aiffMore broadly — Claude Code is the tool to build these solutions with. Ask it to wire up a hook for you in a side session, iterate until it works. A couple hours of back-and-forth and you'll have something tailored to your exact setup rather than waiting on a feature request.
Two hooks already cover this without any new feature:
1.
PermissionRequest+AskUserQuestion— for questions mid-taskFires instantly when Claude wants to ask the user something:
2.
Stop— for turn completionFires when Claude finishes its response and yields control:
Cross-platform sound/notification:
afplay /System/Library/Sounds/Glass.aiff/osascript -e 'display notification "Waiting" with title "Claude Code"'powershell -c "[Console]::Beep(1000,300)"paplay /usr/share/sounds/freedesktop/stereo/message.oga/notify-sendCombining both hooks covers questions mid-task and task completion.
@yurukusa I couldn't get this to work for me. The Stop hook works as expected, but the other one does not fire.
Hitting exactly this from WSL + Warp's official
claude-code-warpplugin. Two data points that may strengthen the case:ExitPlanModeis another instance of the same pattern. When plan mode finishes and waits for the user to approve the plan, no hook fires either — same UX gap asAskUserQuestion. Both are explicit "Claude is yielding control back to you" points that currently emit no event.Notificationhook is matcher-locked toidle_promptand itsPermissionRequesthook has no legacy fallback for WSL environments whereWARP_CLI_AGENT_PROTOCOL_VERSIONisn't propagated. Net effect: users get a notification only onStop(end of turn), and miss every mid-turn pause —AskUserQuestion,ExitPlanMode, plus the permission prompts that the legacy path can't reach.A
WaitingForInput/Yieldevent (option 1 in the original proposal) would fix all three cases with a single hook point, and plugins could subscribe without having to guess the Warp protocol version or event subtypes. Strong +1 for option 1 over expandingStop.Your AskUserQuestion example is one of the cases I explicitly handle in a VS Code extension I published for this problem. Because AskUserQuestion doesn't fire a normal hook, I fall back on tailing the session transcript to detect those pause points. Not glamorous, but it works.
AI Agent Sound Notification plays a distinct audio chime the moment Claude needs you (permission prompts and idle-waiting states), and a different sound on clean turn completion. 10s default delay so it's silent if you're already watching, plus optional back-off repeats for when you've genuinely gone for coffee.
Free / OSS. Marketplace: https://marketplace.visualstudio.com/items?itemName=mayerwin.ai-agent-sound-notification . Source: https://github.com/mayerwin/AI-Agent-Sound-Notification . Feedback welcome.
+1 from Dash — we run multiple Claude Code agents in parallel worktrees and surface a per-task activity dot in the UI. With no hook for
AskUserQuestion, an agent calling it appears "busy" forever from our perspective even though the user is the bottleneck.We're planning the transcript-tailing fallback @mayerwin describes above, but a first-class
WaitingForInputhook would remove a significant source of false-positive "agent is working" indicators across multi-task UIs.Adding one more Mac-focused workaround/data point, since this thread is also about making the "waiting for input" state visible outside the terminal.
I built an open-source native macOS app for this: https://github.com/tristan666666/agent-island
It does not replace a first-class
WaitingForInputhook, but for local Claude/Codex sessions it surfaces the state in the MacBook notch:It can also send a configured continuation prompt to a selected long-running session after the limit window resets, so the agent can continue without me babysitting the terminal.
A native hook would still be cleaner for the ecosystem; this is the product-layer workaround I wanted on macOS.
Hitting this from the other side too. I run several sessions at once and use the Stop hook for an audio cue, but Stop fires whenever the turn yields, including when the session has handed work to a background subagent or shell command and is just waiting for it to come back. So the "done" chime sometimes means "still working, check later", and I can't tell that apart from a real "waiting on you", which is the case I care about.
A dedicated "yielding to the user" hook (option 1 above) would cover both halves: chime on that, stay quiet while background work is still running. The idle_prompt matcher doesn't help, because the session stays busy with the background task and re-invokes itself when that returns, so it never counts as idle.
For now my workaround is a Stop hook that checks whether my background workers are still alive before deciding what to announce, but that only works because I know the exact processes to look for. A first-class signal would make it general.
@marcospgp this matches what I have seen too:
Stopis useful as a coarse signal, but it is not semantically the same as "the user is now the bottleneck".For a native hook, I would also prefer a dedicated yield-to-user event over expanding
Stop. The event should mean something closer to:Otherwise tools layered on top of Claude Code have to keep re-implementing fragile process/transcript checks to distinguish:
That distinction is exactly what matters for long-running sessions and multi-agent workflows. A first-class signal here would make external notifiers, statuslines, tmux dashboards, and Mac/desktop companions much less guessy.
Upvoting this. My specific use case: I have a custom statusline script that shows git diffs, branch info, and agent effort level. I wanted to add a segment that lights up whenever a background agent is waiting for my input — so I don't have to remember to check the agent panel.
Without a native hook or statusline field for this state, the only workaround is scanning task output files in
/tmpfor aneeds input:marker, which has obvious reliability problems (false positives from stale files, false negatives from different phrasing, race conditions during writes).A
statuslineJSON field likeagents.pending_input_countor a dedicated hook event would make this trivial and reliable. ThesubagentStatusLinesetting covers agent panel row formatting but doesn't help with surfacing agent state in the main status bar.I'd appreciate this as well, please. Thanks!