Notification hook (permission_prompt/idle_prompt) never fires from the VS Code native extension's in-editor permission dialog
Environment
- Claude Code version: 2.1.215
- Platform: Windows 11 Home 10.0.26200
- Interface: VS Code native extension (not standalone terminal CLI)
- Shell: PowerShell 5.1 primary, Git Bash also available
Description
I configured a Notification hook in the global ~/.claude/settings.json:
{
"hooks": {
"Notification": [
{
"matcher": "permission_prompt|idle_prompt",
"hooks": [
{
"type": "command",
"command": "powershell.exe -ExecutionPolicy Bypass -File C:\\Users\\AJAYMU~1\\CLAUDE~1\\hooks\\notify.ps1"
}
]
}
]
}
}
The hook command itself is confirmed correct and functional — I pipe-tested it directly with a synthetic Notification payload ({"hook_event_name":"Notification","notification_type":"permission_prompt","message":"..."}) and it correctly triggers a Windows toast notification via BurntToast.
However, when Claude Code is running as the VS Code native extension and shows its own in-editor "allow this tool?" permission approval dialog, the Notification hook is never invoked. I confirmed this by adding a debug-logging line at the very top of the hook script (writing a timestamped line to a log file on every invocation, before any other logic runs). Steps to reproduce:
- Add the above hook config to
~/.claude/settings.json. - Add a line at the top of the hook script that unconditionally appends to a log file (to rule out any downstream failure in the script itself).
- Open
/hooksonce in an already-running session to force a config reload (confirmed necessary since the session predated the settings.json edit). - Trigger a tool call that requires permission approval, causing the in-editor VS Code dialog to appear.
- Approve/interact with the dialog.
- Check the log file — it does not exist / has no new entries, meaning the hook script was never invoked.
For comparison, manually piping a synthetic Notification payload directly into the same hook command (outside of Claude Code) works every time and produces a toast.
Expected behavior
The Notification hook (matcher permission_prompt) should fire when the VS Code extension shows its native permission-approval UI, the same way it's documented to fire for the terminal CLI's bell-style notification.
Actual behavior
The hook is silently never invoked in the VS Code extension context — no error, no log entry, nothing. The extension's permission UI appears to bypass the Notification hook dispatch entirely.
Additional notes
- Docs (
hooks.md,vs-code.md) don't explicitly clarify whetherNotificationhooks are expected to fire on the IDE extension's in-editor permission dialogs specifically, versus only the terminal CLI's out-of-focus notification/bell mechanism. If this is intentional/by-design, it would be great to have that documented explicitly, since it's currently easy to configure a "working" hook (verified via manual testing) that silently never fires in the IDE. - Both the extension and CLI reportedly read the same
~/.claude/settings.json, so this isn't a settings-location issue.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗