Notification hook (permission_prompt / idle_prompt) never invoked in VSCode extension, works correctly in terminal CLI
Title: Notification hook (permission_prompt / idle_prompt) never invoked in VSCode extension, works correctly in terminal CLI
Environment
- Claude Code: VSCode native extension (also tested terminal/CLI build for comparison)
- OS: Linux (Ubuntu 24.04, kernel 6.17.0-35-generic)
Summary
A Notification hook configured in ~/.claude/settings.json (global settings) fires correctly and reliably when Claude Code runs in a plain terminal, but is never invoked when Claude Code runs as the VSCode extension — despite identical, validated configuration and multiple full restarts of VSCode.
Configuration used
{
"hooks": {
"Notification": [
{
"matcher": "permission_prompt|idle_prompt",
"hooks": [
{ "type": "command", "command": "~/.claude/hooks/alert.sh" }
]
}
]
}
}
Steps to reproduce
- Add the above
Notificationhook to~/.claude/settings.json, pointing to a script that logs invocation (e.g. writes a timestamped line + stdin JSON to a debug file). - Open a Claude Code session inside the VSCode extension.
- Trigger a permission prompt (e.g. run a Bash command not covered by the permission allowlist) and/or wait idle long enough to trigger
idle_prompt. - Check the debug log file.
Expected
The hook command runs on every permission_prompt and idle_prompt Notification event, same as in the terminal build.
Actual
- In the VSCode extension: the debug log file stays completely empty — 0 invocations — across multiple permission prompts, a 4+ minute idle wait, two full VSCode restarts, and a second session started in parallel.
- In a plain terminal session (same machine, same
~/.claude/settings.json, unchanged): the exact same hook fires correctly and repeatedly. Debug log captured real payloads, e.g.:
``json`
{"session_id":"...","transcript_path":"...","cwd":"/home/cms","hook_event_name":"Notification","message":"Claude needs your permission","notification_type":"permission_prompt"}
notify-send
Desktop notification () and sound (paplay/aplay`) both fired as expected.
Additional notes
- The VSCode extension does show its own native "switch back to this window" nudge when attention is needed — this is a separate, undocumented built-in mechanism, distinct from the
Notificationhook, and does not include a sound. - The Claude Code docs' feature-parity table (CLI vs VSCode extension) does not list
hooksas a CLI-only feature, nor does it clarify whether specific hook event types (as opposed to hook handler types likecommand/http/agent) are supported in the extension surface.
Ask
Please clarify (and fix, if unintended) whether Notification hooks — and hooks in general — are expected to fire inside the VSCode extension. If this is a known/intentional limitation, it should be documented in the feature-parity table.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗