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
25 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 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
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 ✅Bash(npm install))AskUserQuestion- we do NOT have a hook event for this ❌<img width="600" src="https://github.com/user-attachments/assets/32fcd4a9-dde9-49bb-aa60-3f1356ed8e93" />
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
AskUserQuestionhook event?Yes Permission Request works for me with
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:
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
PermissionRequesthook does not fire when permission dialogs appear, at least on Windows.Environment:
Configuration tested:
The script outputs the required JSON structure:
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 dialogsWhat works:
Stophook fires correctly when Claude finishesThe
PermissionRequesthook is documented but doesn't appear to be functional. A workingUserInputRequiredorAwaitingInputhook (as suggested in this thread) would solve this use case.Confirming:
PreToolUse+AskUserQuestionmatcher worksAs @dicksontsai mentioned, you can use
PreToolUsewith"matcher": "AskUserQuestion"to get notified when Claude asks a question.Working config (
.claude/settings.local.json):Troubleshooting if it doesn't work:
settings.local.json(hooks load at session start)afplayfirst (macOS) to verify the hook fires before using custom scriptsPreToolUseevent. Checkhook_input.get("hook_event_name") == "PreToolUse"andhook_input.get("tool_name") == "AskUserQuestion"This covers the
AskUserQuestiontool 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
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
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-relayin 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.No install, no cloud, free and open source.
+1
## Problem
There is no hook event that fires when the user clicks Allow/Deny on a permission prompt. This makes it impossible to reliably detect when a permission prompt
has been handled.
### Existing hooks and their limitations:
| Hook | Issue |
|------|-------|
|
PermissionRequest| Fires when dialog appears, not when responded ||
Notification[permission_prompt]| Same timing as PermissionRequest ||
PreToolUse| Fires before the permission dialog ||
PostToolUse| Fires after tool completes, but runs on every tool call ||
Stop| Fires when Claude finishes entire response (delayed) ||
UserPromptSubmit| Only fires for text input, not Allow/Deny clicks |## Use case
I'm building a system that changes the Windows Terminal tab title to indicate when Claude Code needs confirmation (yellow "⚠ Claude Code [CONFIRM]") vs normal
operation. Setting the title works via
Notification[permission_prompt], but clearing it after the user responds requires a hook that fires at that moment.Currently I use the
Stophook as a workaround, but this means the CONFIRM indicator stays visible during Claude's entire subsequent work phase — not just whilewaiting for user input.
## Proposed solution
Add a
PermissionResponse(orPermissionGranted/PermissionDenied) hook event that fires immediately after the user clicks Allow or Deny on a permissionprompt. The input JSON should include
session_id,tool_name, and the user's decision (allow/deny).Adding context specific to the VS Code extension on macOS — slightly different
from terminal CLI use cases already mentioned:
Problem in VS Code context:
Both
AskUserQuestiondialogs and permission approval prompts (Approve/Deny)appear with zero notification. The session just sits idle — no sound, no Dock
bounce, no window activation. The
Notificationhook with empty matcher neverfires for either case; only
Stopworks.Partial workaround (fragile, but functional today):
Per a side-effect bug,
PermissionRequesthook currently fires whenAskUserQuestionis called. This config coincidentally covers both:Exit code must be
0, otherwise the permission decision gets affected.This is clearly accidental behavior and will likely break in a future release.
Why this issue matters more for VS Code extension users:
In terminal mode, you can at least glance at the terminal output. In the VS Code
extension, the only feedback channel is the sidebar UI — making a proper hook
(or native VS Code notification) the only real solution.
The
UserInputRequiredhook proposed here, or extendingNotificationtoinclude an
awaiting_usermatcher type, would solve this cleanly.Partial solution available in v2.1.85: PreToolUse hooks can now match
AskUserQuestionand auto-respond withupdatedInput, which covers the "Claude asks a clarifying question and waits" case.The hook script can either auto-answer (for headless/autonomous mode) or trigger a notification (for the original use case):
Auto-answer example:
Notification example (macOS):
Key details:
questionsarray (not singularquestion):tool_input.questions[0].questionupdatedInput.answersobject:{ "question text": "answer text" }permissionDecision: "allow"is required alongsideupdatedInputWhat this covers: AskUserQuestion events (clarifying questions, confirmations).
What this doesn't cover: Permission prompts (tool approval). Those fire as PermissionRequest hooks, which already existed before v2.1.85.
So between
PreToolUseonAskUserQuestion(v2.1.85) andPermissionRequesthooks, the two main "waiting for input" scenarios now have hook-based solutions.The existing workarounds in this thread (
PermissionRequest,PreToolUsewithmatcher: AskUserQuestion) cover tool-based input requests. They miss a common scenario: plain-text checkpoints where the model writes a prompt and stops, with no tool call involved — e.g. UAT checkpoints in skill-driven workflows like:For these, only
idle_promptfires. Butidle_promptalso fires when the model is idle waiting on a long-running background shell (e.g. polling for CI/code-review completion viarun_in_background: true). Samenotification_type, samemessage— indistinguishable in payload.Result: bell on real checkpoint = good; bell every time the bg shell idles past threshold = false positive that trains me to ignore the bell.
Concrete need: a way to differentiate "model is blocked on user response" from "model is idle while async work is pending" in the
Notificationpayload (e.g. anis_async_pendingfield, or a separatenotification_type).I really do need this feature.
The current version is 2.1.141, but this feature is still not available.