Add hook for user input/question events (UserInputRequired)
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
Currently, the Stop hook only fires when Claude completes a full
response. It does not fire when Claude pauses mid-response to:
- Ask permission to run a tool/command
- Ask clarifying questions
- Wait for user confirmation
This makes it impossible to get audio/visual notifications when Claude needs user attention during a long-running session.
Related to #6454: That issue addresses notifications for completed prompts (which Stop hook handles). This issue addresses the gap for mid-response input requests (which no hook currently handles).
When working in another window while Claude Code runs commands, there's no way to know when Claude needs permission without constantly checking the terminal.
Proposed Solution
Add a new hook type (suggested name: UserInputRequired or
AwaitingInput) that triggers whenever Claude pauses and waits for user
input.
Example configuration:
{
"hooks": {
"Stop": [
{
"hooks": [{"type": "command", "command": "afplay
/System/Library/Sounds/Glass.aiff"}]
}
],
"UserInputRequired": [
{
"hooks": [{"type": "command", "command": "afplay
/System/Library/Sounds/Ping.aiff"}]
}
]
}
}
Trigger conditions:
- Claude asks for tool permission
- Claude asks a question and waits for user response
- Any state where Claude cannot proceed without user input
This complements #6454:
- #6454: "Task is done" → Stop hook (already works)
- This issue: "Claude needs you NOW" → No hook available (gap)
Alternative Solutions
Using PreToolUse hook, but it fires for every tool execution (including
auto-approved tools), making it too noisy for this use case.
Another option would be to enhance PreToolUse hook with a
requiresApproval flag:
{ "requiresApproval": true, "tool": "Bash", "command": "rm -rf important_files" }
This would allow conditional notifications only for tools requiring approval.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
Example scenario:
- I'm working on a React app with a Node.js backend
- I ask Claude to "run the tests and fix any failures"
- Claude starts running tests (takes 2 minutes)
- I switch to my browser to review documentation
- Tests finish, Claude finds an error and needs to run
git stash - Claude asks for permission to run the command
- Current behavior: No notification - I don't know Claude needs input
- Desired behavior: Audio ping alerts me to switch back to terminal
This would save time and improve multitasking, especially during long build/test cycles where Claude occasionally needs permission.
Real example: Claude ran 5 commands successfully over 3 minutes, then
stopped to ask permission for rm -rf dist/. I didn't notice for 10
minutes because I was in another window.
Additional Context
Current Hook Behavior:
Stop- Only fires on completion (handles #6454 use case)PreToolUse- Fires before every tool (too noisy)PostToolUse- Fires after tool executionUserPromptSubmit- Fires when user submits input (opposite direction)
Environment:
- OS: macOS
- Use case: Audio notifications via system sounds (afplay)
- Configuration: Using hooks in ~/.claude/settings.json
Suggested hook names:
UserInputRequired- Clear and descriptiveAwaitingInput- Shorter, states current statePausedForInput- Indicates temporary pause
Why this is different from #6454: Issue #6454 wants notifications when prompts finish - the Stop hook already supports this. This issue requests notifications when Claude pauses mid-response waiting for input - no hook currently supports this critical use case.
This feature would be especially valuable for:
- Long-running build/test processes
- Accessibility - users who rely on audio cues
- Multi-tasking developers working across multiple windows
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/9575
- https://github.com/anthropics/claude-code/issues/4690
- https://github.com/anthropics/claude-code/issues/9516
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
Im request this too, it super userful
This would be very useful
Hello is there a hook for this yet 🙏
I also need this.
Now version 2.0.45, but seem still no update for this Oh wait, check /hooks 11. Permission Requests
We're still waiting, please don't close for inactivity.
We're still waiting, please don't close for inactivity.
This features available now. Check hooks #11
@uponatime2019 I think you're referring to the new PermissionRequest hook (https://code.claude.com/docs/en/hooks#permissionrequest-decision-control).
Yes, this was released about two weeks ago but I can't find a way to make it play a sound.
So, unless it works and is properly documented, this issue should remain open.
This threads mixes two different events:
PermissionRequest- we already have a hook event for this ✅
- This is when Claude presents you with a plan and asks you to proceed with "Yes" or say "No"
- Also when it asks for permission to use a tool (e.g.
Bash(npm install))
AskUserQuestion- we do NOT have a hook event for this ❌
- This is a new feature they introduced in v2.0, and it's about asking users clarificatory questions, e.g.
it would be great to have a hook event for the 2nd event.
@bcherny @dicksontsai & Anthropic team, could you please confirm if my understanding is correct and if yes, if Claude will receive support for an AskUserQuestion hook event?
Yes Permission Request works for me with
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
],
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
]
}
Yes Permission Request works for me with
"hooks": { "Stop": [ { "hooks": [ { "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" } ] } ], "PermissionRequest": [ { "hooks": [ { "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" } ] } ] }
This format worked for me, but only in CLI, in VSCODE AddOn nope 😓
AskUserQuestion is a specific tool. You can use PreToolUse with "matcher": "AskUserQuestion".
Ooh, I see. Thanks for the tip @dicksontsai.
Well, it still doesn't work for me.
The 'Stop' hook is firing consistently, but none of the others work.
This is how I have it configured to test it on WSL:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "bash -c \"echo \\\"$(date '+%Y-%m-%d %H:%M:%S') - STOP\\\" >> /mnt/c/temp/hook-test.log\" && powershell.exe -Command \"(New-Object Media.SoundPlayer 'C:\\Devel\\Media\\normalized\\chord.wav').PlaySync()\""
}
]
}
],
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "bash -c \"echo \\\"$(date '+%Y-%m-%d %H:%M:%S') - PERMISSION_REQUEST\\\" >> /mnt/c/temp/hook-test.log\" && powershell.exe -Command \"(New-Object Media.SoundPlayer 'C:\\Devel\\Media\\normalized\\chimes.wav').PlaySync()\""
}
]
}
],
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "bash -c \"echo \\\"$(date '+%Y-%m-%d %H:%M:%S') - PRE_TOOL_USE_ASK\\\" >> /mnt/c/temp/hook-test.log\" && powershell.exe -Command \"(New-Object Media.SoundPlayer 'C:\\Devel\\Media\\normalized\\chimes.wav').PlaySync()\""
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "bash -c \"echo \\\"$(date '+%Y-%m-%d %H:%M:%S') - NOTIFICATION\\\" >> /mnt/c/temp/hook-test.log\" && powershell.exe -Command \"(New-Object Media.SoundPlayer 'C:\\Devel\\Media\\normalized\\notify.wav').PlaySync()\""
}
]
}
]
}
}
The command is a little complex because I added logging to confirm if this isn't an audio issue. It isn't. The 'stop' hook is logged. The other aren't.
Anyway, I also have this on Windows native with only the command being different and the same thing happens: The 'stop' hook plays a sound. The others don't.
UPDATE: I tested with the Claude Code on the WSL CLI and the PERMISSION_REQUEST and NOTIFICATION hooks fired. It seems it only doesn't work when using the 'Claude Code for VS Code' extension.
I can confirm that the PermissionRequest hook does not fire when permission dialogs appear, at least on Windows.
Environment:
- OS: Windows 11
- Tested in both VS Code extension and CLI
Configuration tested:
{
"hooks": {
"PermissionRequest": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "powershell -ExecutionPolicy Bypass -File \"C:\\path\\to\\notify.ps1\""
}
]
}
]
}
}
The script outputs the required JSON structure:
{"hookSpecificOutput":{"hookEventName":"PermissionRequest","decision":{"behavior":"allow"}}}
What I tried:
PermissionRequestwith matcher"*"- doesn't firePermissionRequestwith matcher"Bash"- doesn't firePreToolUsewith matcher"*"- doesn't fire before permission dialogsPreToolUsewith matcher"AskUserQuestion"- doesn't fire for permission dialogs
What works:
Stophook fires correctly when Claude finishes- The script works when run directly from the command line
The PermissionRequest hook is documented but doesn't appear to be functional. A working UserInputRequired or AwaitingInput hook (as suggested in this thread) would solve this use case.
Confirming: PreToolUse + AskUserQuestion matcher works
As @dicksontsai mentioned, you can use PreToolUse with "matcher": "AskUserQuestion" to get notified when Claude asks a question.
Working config (.claude/settings.local.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
]
}
}
Troubleshooting if it doesn't work:
- Restart Claude Code after modifying
settings.local.json(hooks load at session start) - Test with
afplayfirst (macOS) to verify the hook fires before using custom scripts - Custom scripts must handle the
PreToolUseevent. Checkhook_input.get("hook_event_name") == "PreToolUse"andhook_input.get("tool_name") == "AskUserQuestion" - There's a reported issue (#13439) about PreToolUse causing empty AskUserQuestion responses in some cases. May be version-specific.
This covers the AskUserQuestion tool specifically. Does not cover permission prompts or other input-blocking scenarios.
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 AskUserQuestion using the PreToolUse hook with a tool name matcher:
if event_name == "PreToolUse":
if tool_name == "AskUserQuestion":
return "pretooluse-askuserquestion"
However, I found that both PreToolUse and PermissionRequest fire simultaneously for AskUserQuestion (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 AskUserQuestion inherently requires user interaction, the PermissionRequest hook is sufficient and semantically correct for this use case. Adding special handling in PreToolUse is redundant.
Conclusion: The PermissionRequest hook already covers the "user input required" scenario that this issue requests. If you want tool-specific sounds, you can match on tool_name within the PermissionRequest handler instead of PreToolUse.
My implementation (with configurable hooks and sounds): https://github.com/shanraisshan/claude-code-voice-hooks
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
All these hook workarounds solve the "same machine" case — you still need to be at your desk to hear the sound.
If you want notifications that reach your phone when you're away:
https://github.com/chadbyte/claude-relay
Run npx claude-relay in your project directory and you get push notifications for permission requests, completions, errors, and questions — on your phone, even with the browser closed. No hooks to configure.
npx claude-relay
No install, no cloud, free and open source.