You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] "Notification" hook doesn't work in VS Code extension "native UI" mode #8985
I have searched existing issues and this hasn't been reported yet
This is a single bug report (please file separate reports for different bugs)
I am using the latest version of Claude Code
What's Wrong?
Claude Code version 2.0.8, in VS Code extension's "Native UI" mode.
The "Notification" hook doesn't work any more: when Claude Code pauses to ask for my intervention, the hook doesn't work, because I set up a hook to play a sound at that moment. I can't hear that sound any more.
But in the CLI mode (version 2.0.8), I could hear that sound.
And do something that would make Claude Code ask for human intervention.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.0.8
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
It happened in the new "native UI" of the VS Code extension.
Reacted by zyoung-rc, jakobhalling, Kern Herskind Nightingale, Alexandre Touzel, Iori Kurata, Erban Danaj, SloumaCMK, kevinfan100, larl26, Mike and 56 more
Confirmed: Notification Hooks Not Firing for Permission Prompts
I can verify this issue affects permission_prompt notifications specifically.
Configuration
Empty matcher "matcher": "" to catch all notifications
Windows 11, VS Code extension
Enhanced script that logs notification type and message
Testing Results
✅ Manual script test: Works perfectly when invoked directly
✅ PreToolUse/PostToolUse hooks: Fire correctly for Read tool
❌ Notification hooks: Never fire despite multiple permission prompts
Evidence
Cleared .claude/settings.local.json allow list to force prompts
Confirmed seeing 3+ permission prompts in UI
Zero notification hook invocations logged
Tested after full restart - same result
Hook script verified working via manual JSON piping
The notification hook system is completely non-functional for permission_prompt events in VS Code extension. Script works, config is correct, other hooks work, but Notification hooks are never called.
Detailed test report available if maintainers need it.
Linked issue is a consequence if this one, which is the root cause. Once hooks are supported we can intercept notification events via hooks.
BTW, this is more a feature request for the VSCode extension than a bug. Unless the lack of feature parity with CLI is assumed to be a bug :)
Can't wait for this to be tackled by the Anthropic team so that I can share a Claude Code notifier that uplevels notifications to MacOS system notifs when Cursor / VSCode is in the background.
{
"hooks": {
"Notification": [{ "matcher": "", "hooks": [{ "type": "command", "command": "powershell.exe -Command \"[System.Media.SystemSounds]::Beep.Play()\"" }] }],
"Stop": [{ "matcher": "", "hooks": [{ "type": "command", "command": "powershell.exe -Command \"[System.Media.SystemSounds]::Beep.Play()\"" }] }]
}
}
Behavior:✅ Stop hook works (beep when task completes)❌ Notification hook does NOT fire when user input is neededThis works correctly in the terminal CLI. The VSCode extension should have feature parity.
Reacted by Anjan Talatam, Benjamin S and Guanzhou Hu
I'm experiencing the same issue. I analyzed the VSCode extension source code and found the root cause.
Environment
Item
Value
Host OS
Ubuntu Server (Linux 6.5.0-45-generic)
Claude Code CLI
2.1.19
Claude Code VSCode Extension
2.1.19
VSCode
1.108.2
Connection Method
VSCode Remote SSH from Mac/Windows
Setup Details
[Local PC (Mac/Windows)] [Ubuntu Server]
VSCode ──── SSH Connection ────→ Claude Code CLI (installed)
│ ↑
└── Remote SSH Extension ──→ Claude Code VSCode Extension
(runs on server, invokes CLI)
Claude Code CLI is installed on the Ubuntu server
Local PC connects to Ubuntu server via VSCode Remote SSH extension
Claude Code VSCode extension runs on the server side and invokes the Claude Code CLI on the server
All hook scripts are executed on the Ubuntu server
Hook Behavior in My Environment
I have configured hooks for all available events:
Hook
Terminal CLI
VSCode Extension
PreToolUse
Works
Works
PostToolUse
Works
Works
UserPromptSubmit
Works
Works
Stop
Works
Works
SubagentStop
Works
Works
SessionStart
Works
Works
SessionEnd
Works
Works
PreCompact
Works
Works
Notification
Works
Does NOT fire
PermissionRequest
Works
Does NOT fire
Root Cause
Missing Subtype Handlers in processControlRequest()
The processControlRequest() method only handles 3 subtypes:
asyncprocessControlRequest(e,r){if(e.request.subtype==="can_use_tool"){// Implemented - handles tool permission requestsreturn{...awaitthis.canUseTool(...),toolUseID:e.request.tool_use_id}}else{if(e.request.subtype==="hook_callback"){// Implemented - handles PreToolUse/PostToolUse hooksreturnawaitthis.handleHookCallbacks(e.request.callback_id,e.request.input,...)}if(e.request.subtype==="mcp_message"){// Implemented - handles MCP messages}}throwError("Unsupported control request subtype: "+e.request.subtype)// Notification and PermissionRequest reach here and throw error}
Subtype Support Matrix
Subtype
Handler Method
Status
can_use_tool
canUseTool()
Implemented
hook_callback
handleHookCallbacks()
Implemented
mcp_message
MCP handler
Implemented
Notification
-
Not implemented
PermissionRequest
-
Not implemented
Why PreToolUse/PostToolUse Work
These hooks are sent as hook_callback subtype and processed by handleHookCallbacks():
handleHookCallbacks(e,r,n,s){leti=this.hookCallbacks.get(e);if(!i)throwError(`No hook callback found for ID: ${e}`);returni(r,n,{signal:s})// Executes registered callback}
Why Notification/PermissionRequest Don't Work
These are sent as separate subtypes (Notification, PermissionRequest) but there's no handler for them in processControlRequest(). They fall through to the final throw Error() statement.
Great root cause analysis by @thzking703. Until Anthropic patches the VSCode extension, here are workarounds for getting notifications in Native UI mode: Workaround 1 — Use a different hook event as a proxy:
Since PreToolUse and PostToolUse fire correctly in the extension, you can use them to trigger notifications when Claude is likely waiting for input:
Workaround 2 — Run in CLI mode for critical sessions:
If notifications are essential (e.g., long-running autonomous tasks), running Claude Code in the integrated terminal (Ctrl+\`` → claude`) instead of Native UI mode gives you full hook support including Notification and PermissionRequest. Workaround 3 — Poll-based notification (heavier but reliable):
A SessionStart hook can launch a background watcher that monitors Claude's output for pause indicators:
{
"hooks": {
"SessionStart": [
{
"hook": "bash -c 'nohup bash -c \"while true; do sleep 30; if pgrep -f claude-code | xargs -I{} ls /proc/{}/fd 2>/dev/null | wc -l | grep -q '^[0-3]$'; then notify-send \\\"Claude may be idle\\\" 2>/dev/null; fi; done\" &'"
}
]
}
}
The proper fix is what @thzking703 described — adding Notification and PermissionRequest subtype handlers in processControlRequest(). But until that ships, these workarounds should keep you unblocked.
This regression was one of the triggers that pushed me to write an extension instead of relying on the Notification hook. Rather than the single Notification event, mine listens to PermissionRequest, PreToolUse with matcher AskUserQuestion|ExitPlanMode, Elicitation, Stop, StopFailure and PostToolBatch. Every one of those fires immediately, which is the other problem with the Notification hook: permission_prompt and idle_prompt both wait on an inactivity timer first.
+1 — affecting me too on VS Code 1.117 / Claude Code 2.1.121 / macOS 26.4.
A user-side priority note: I work primarily in the VS Code extension and only use the terminal CLI occasionally. The Notification hook used to fire in the extension before — this is a regression that broke an established workflow, not a missing feature.
If extension vs terminal triage has to be prioritized, I'd vote the extension first. For me, missing the audio cue in the extension means losing prompts during long tasks, while I personally don't need it in the terminal.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
redbeard commentedon Oct 24, 2025
Second this -- works in terminal, fails in vscode ui mode.
bsdev90 commentedon Oct 24, 2025
Same here (Cursor, Windows 11). Stop hook works though
joemillerpe-ux commentedon Nov 15, 2025
Confirmed: Notification Hooks Not Firing for Permission Prompts
I can verify this issue affects permission_prompt notifications specifically.
Configuration
"matcher": ""to catch all notificationsTesting Results
✅ Manual script test: Works perfectly when invoked directly
✅ PreToolUse/PostToolUse hooks: Fire correctly for Read tool
❌ Notification hooks: Never fire despite multiple permission prompts
Evidence
.claude/settings.local.jsonallow list to force promptsThe notification hook system is completely non-functional for permission_prompt events in VS Code extension. Script works, config is correct, other hooks work, but Notification hooks are never called.
Detailed test report available if maintainers need it.
glasser commentedon Dec 8, 2025
I think duplicate of #11156
TimeHunter81 commentedon Dec 11, 2025
Linked issue is a consequence if this one, which is the root cause. Once hooks are supported we can intercept notification events via hooks.
BTW, this is more a feature request for the VSCode extension than a bug. Unless the lack of feature parity with CLI is assumed to be a bug :)
Can't wait for this to be tackled by the Anthropic team so that I can share a Claude Code notifier that uplevels notifications to MacOS system notifs when Cursor / VSCode is in the background.
marcomulder commentedon Dec 31, 2025
+1 - This affects my workflow significantly.
My settings.json:
{ "hooks": { "Notification": [{ "matcher": "", "hooks": [{ "type": "command", "command": "powershell.exe -Command \"[System.Media.SystemSounds]::Beep.Play()\"" }] }], "Stop": [{ "matcher": "", "hooks": [{ "type": "command", "command": "powershell.exe -Command \"[System.Media.SystemSounds]::Beep.Play()\"" }] }] } } Behavior: ✅ Stop hook works (beep when task completes) ❌ Notification hook does NOT fire when user input is needed This works correctly in the terminal CLI. The VSCode extension should have feature parity.lonedfx commentedon Jan 23, 2026
This is not macos specific, I'm on Windows and have the exact same issue.
thzking703 commentedon Jan 26, 2026
I'm experiencing the same issue. I analyzed the VSCode extension source code and found the root cause.
Environment
Setup Details
Hook Behavior in My Environment
I have configured hooks for all available events:
Root Cause
Missing Subtype Handlers in
processControlRequest()The
processControlRequest()method only handles 3 subtypes:Subtype Support Matrix
can_use_toolhook_callbackmcp_messageNotificationPermissionRequestWhy PreToolUse/PostToolUse Work
These hooks are sent as
hook_callbacksubtype and processed byhandleHookCallbacks():Why Notification/PermissionRequest Don't Work
These are sent as separate subtypes (
Notification,PermissionRequest) but there's no handler for them inprocessControlRequest(). They fall through to the finalthrow Error()statement.Processing Flow Comparison
Suggested Fix
Adding handlers for
NotificationandPermissionRequestsubtypes inprocessControlRequest()should resolve this issue:Analyzed File
~/.vscode-server/extensions/anthropic.claude-code-2.1.19-linux-x64/extension.jsyurukusa commentedon Mar 31, 2026
Great root cause analysis by @thzking703. Until Anthropic patches the VSCode extension, here are workarounds for getting notifications in Native UI mode:
Workaround 1 — Use a different hook event as a proxy:
Since
PreToolUseandPostToolUsefire correctly in the extension, you can use them to trigger notifications when Claude is likely waiting for input:Workaround 2 — Run in CLI mode for critical sessions:
If notifications are essential (e.g., long-running autonomous tasks), running Claude Code in the integrated terminal (
Ctrl+\`` →claude`) instead of Native UI mode gives you full hook support including Notification and PermissionRequest.Workaround 3 — Poll-based notification (heavier but reliable):
A SessionStart hook can launch a background watcher that monitors Claude's output for pause indicators:
{ "hooks": { "SessionStart": [ { "hook": "bash -c 'nohup bash -c \"while true; do sleep 30; if pgrep -f claude-code | xargs -I{} ls /proc/{}/fd 2>/dev/null | wc -l | grep -q '^[0-3]$'; then notify-send \\\"Claude may be idle\\\" 2>/dev/null; fi; done\" &'" } ] } }The proper fix is what @thzking703 described — adding
NotificationandPermissionRequestsubtype handlers inprocessControlRequest(). But until that ships, these workarounds should keep you unblocked.mayerwin commentedon Apr 20, 2026
This regression was one of the triggers that pushed me to write an extension instead of relying on the Notification hook. Rather than the single Notification event, mine listens to PermissionRequest, PreToolUse with matcher AskUserQuestion|ExitPlanMode, Elicitation, Stop, StopFailure and PostToolBatch. Every one of those fires immediately, which is the other problem with the Notification hook: permission_prompt and idle_prompt both wait on an inactivity timer first.
Permission requests, turn completion and a turn that died on a rate limit all get their own sound. Cross-platform and free: https://marketplace.visualstudio.com/items?itemName=mayerwin.ai-agent-sound-notification . Repo: https://github.com/mayerwin/AI-Agent-Sound-Notification . If your afplay-based setup still isn't firing after an update, this might be a quicker path than debugging the regression.
saiso commentedon Apr 28, 2026
+1 — affecting me too on VS Code 1.117 / Claude Code 2.1.121 / macOS 26.4.
A user-side priority note: I work primarily in the VS Code extension and only use the terminal CLI occasionally. The Notification hook used to fire in the extension before — this is a regression that broke an established workflow, not a missing feature.
If extension vs terminal triage has to be prioritized, I'd vote the extension first. For me, missing the audio cue in the extension means losing prompts during long tasks, while I personally don't need it in the terminal.
Thanks for the great work on Claude Code.
docs: document VS Code extension regression workaround (v1.0.2)
TedRubber commentedon Apr 28, 2026
Same issue here. I am still running 2.1.45 just to keep the notifications in VS Code.
shohei-ihaya commentedon May 11, 2026
+1 2.1.138 on macos
docs: correct claim that PermissionRequest fixes the VSCode extension…
claude commentedon Aug 19, 2026
Fixed in 2.1.233 — changelog: "Fixed Notification hooks not firing for permission prompts when running under Claude Desktop or VS Code" (https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md). That matches this report (the
Notificationhook staying silent in the VS Code extension when Claude pauses for your input, while the same hook works in the terminal).If it still doesn't fire in the extension on 2.1.233 or later, reply with your version and this can be reopened.
🤖 Generated with Claude Code
Generated by Claude Code
github-actions commentedon Oct 14, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.