Notification hook does not fire in VS Code extension (permission_prompt / idle_prompt); works in terminal

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Jul 21, 2026 · closed Aug 20, 2026

Summary
The Notification hook (matcher "", covering permission_prompt and idle_prompt) never fires when running Claude Code inside the VS Code extension. The same hook fires reliably in a standalone terminal. The Stop hook works in both, confirming the hook command and settings.json are valid.

Environment

  • Claude Code VS Code extension anthropic.claude-code v2.1.216 (darwin-arm64)
  • macOS 26.5 (Tahoe)
  • ~/.claude/settings.json hooks use osascript for macOS notifications
  • Relevant settings: remoteControlAtStartup: true, agentPushNotifEnabled: true, tui: fullscreen, claudeCode.preferredLocation: panel

Config (abbreviated)

"hooks": {
  "Notification": [{ "matcher": "", "hooks": [{ "type": "command", "command": "osascript -e 'display notification ... with title \"Claude Code\"'" }] }],
  "Stop":         [{ "matcher": "", "hooks": [{ "type": "command", "command": "osascript -e 'display notification ... with title \"Claude Code\"'" }] }]
}

Repro

  1. Configure the above hooks; restart the session.
  2. In the VS Code extension, trigger a tool that needs approval, or leave the prompt idle 60s+ (window unfocused).
  3. Expected: OS notification from the Notification hook.
  4. Actual: nothing fires. The Stop hook fires normally on task completion.
  5. Running the identical config in a standalone terminal: the Notification hook fires correctly (~5s after losing focus).

Impact
No desktop notification for mid-task permission prompts / idle waits in the VS Code extension. The extension exposes no notification-related setting to work around this. Likely the extension surfaces permission/input via its own panel UI without emitting the Notification hook event. Docs don't mention this extension-specific difference.

View original on GitHub ↗

3 Comments

mirrorr · 1 month ago

👍
Confirming this also reproduces on Windows 11, so it's not macOS/osascript-specific.

Setup:

Claude Code VS Code extension (Windows 11, win32)
Notification hook with matcher: "", running:

powershell.exe -Command "(New-Object Media.SoundPlayer 'C:/Windows/Media/notify.wav').PlaySync()"
Configured in both .claude/settings.json and .claude/settings.local.json — no difference.
What I ruled out before landing here:

JSON/hook syntax is valid (jq validates cleanly against the schema).
Not an audio issue — running the exact same command as a spawned background process (not just typed interactively) plays the sound fine, so the OS audio session and WAV file work.
Not specific to my own hook — I also tried two third-party marketplace extensions built for the same purpose ("Claude Notify", "Claude Notifier"), and neither produced sound either. Suggests there's no event/integration point in the extension for any tool to hook into for this.
Matches the suspected root cause here: the extension handles permission/idle prompts through its own panel UI without emitting the Notification hook event. Stop fires fine for me too, same as OP.

Would be great to get this on the roadmap — right now the only workaround is running claude in the VS Code integrated terminal instead of the extension panel, which gives up the extension UI entirely just to get audio alerts back.

carlosdealmeida · 1 month ago

For the idle_prompt half of this, there's a workaround that doesn't depend on hooks at all — disclosure: I'm the author.

Claude Todos detects "the agent stopped and is waiting for you" by reading the transcripts Claude Code already writes to ~/.claude/projects, and fires a native VS Code toast — no Notification hook involved, so the extension-vs-terminal discrepancy reported here doesn't affect it. It also notifies when all tasks complete and when the agent is explicitly waiting on an answer (AskUserQuestion, or a plan awaiting approval).

It does not cover permission_prompt: permission dialogs never reach the transcript, so there's nothing to detect from the outside — for that half, this issue is still the right fix.

Also available for JetBrains IDEs. MIT, local-only: https://github.com/carlosdealmeida/claude-todos-vscode

paul-adams-985 · 23 days ago

+1, hitting exactly this on macOS with the VS Code extension. Stop hook fires fine, Notification hook never fires — for permission prompts or AskUserQuestion. Same hook config works in the terminal. Would love a sound cue when Claude's waiting on me, not just when it finishes. Thanks for looking into it!

Showing cached comments. Read the full discussion on GitHub ↗