claude-code - 💡(How to fix) Fix Notification hook never fires in the VSCode extension (works in CLI) — no event on idle timeout or permission prompt

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Code Example

Hook debug log (VSCode extension 2.1.143, after a 60+ second idle window).
Each hook script writes its first log line unconditionally on invocation:

2026-05-16 23:13:36 toast shown OK
2026-05-16 23:13:40 sound played OK (dur=4433ms)
2026-05-16 23:16:31 Stop hook fired (PID=19976, Session=1)
2026-05-16 23:16:31 toast shown OK
2026-05-16 23:16:35 sound played OK (dur=4433ms)

No `Notification hook fired` entry appears anywhere across the idle windowonly `Stop` hook entries. (For contrast, the CLI produces a
`Notification hook fired` line + sound at the 60s idle mark with the same
config.)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • 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?

The Notification hook never fires when Claude Code runs as the VSCode native extension — in any situation. The exact same settings.json works correctly in the CLI.

Environment:

  • Claude Code CLI: 2.1.143
  • Claude Code VSCode extension: 2.1.143
  • OS: Windows 11 Pro 10.0.26200
  • Hook shell: Windows PowerShell 5.1 (powershell.exe)

The Stop hook fires reliably in BOTH the CLI and the extension, so the settings file is read correctly and the hook mechanism works. Only Notification is dead in the extension. Both hook scripts write a log line unconditionally as their very first line, so any invocation is guaranteed to leave a trace — yet no Notification trace ever appears in the extension, neither on the ~60s input-idle condition nor while a permission dialog is pending.

Note: This is an environment-parity issue, not a known regression. We have only confirmed CLI 2.1.143 works and VSCode extension 2.1.143 does not. There is no evidence the Notification hook ever worked in any previous version of the VSCode extension.

What Should Happen?

The VSCode extension should route the same "waiting for input / permission needed" notification events to the Notification hook that the CLI does, so the hook fires (e.g. on the ~60s input-idle condition) and behavior is at parity with the CLI.

Additionally / alternatively:

  • A dedicated hook event for permission-approval requests (e.g. PermissionRequest) would let users be alerted specifically when a tool call is blocked waiting for their decision, in both CLI and extension.
  • If the CLI-vs-extension divergence is intentional, it should be documented.

Impact: on the VSCode extension there is currently no way to get an audible or desktop alert when Claude is waiting for input or for a permission approval. Users who rely on the Notification hook lose that signal entirely when moving from CLI to the extension, and the divergence is undocumented.

Error Messages/Logs

Hook debug log (VSCode extension 2.1.143, after a 60+ second idle window).
Each hook script writes its first log line unconditionally on invocation:

2026-05-16 23:13:36 toast shown OK
2026-05-16 23:13:40 sound played OK (dur=4433ms)
2026-05-16 23:16:31 Stop hook fired (PID=19976, Session=1)
2026-05-16 23:16:31 toast shown OK
2026-05-16 23:16:35 sound played OK (dur=4433ms)

No `Notification hook fired` entry appears anywhere across the idle window —
only `Stop` hook entries. (For contrast, the CLI produces a
`Notification hook fired` line + sound at the 60s idle mark with the same
config.)

Steps to Reproduce

  1. Add a Notification hook and a Stop hook to settings.json, each pointing to a script that writes a log line as its very first action (so any invocation always leaves a trace). Example:

    "hooks": { "Notification": [ { "hooks": [ { "type": "command", "command": "powershell.exe -ExecutionPolicy Bypass -File C:/Users/<user>/.claude/hooks/notify-waiting.ps1" } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "powershell.exe -ExecutionPolicy Bypass -File C:/Users/<user>/.claude/hooks/complete.ps1" } ] } ] }

  2. Run Claude Code as the VSCode native extension (version 2.1.143).

  3. Case A (idle): end a turn and leave the prompt idle for 60+ seconds without typing anything.

  4. Case B (permission prompt): trigger a tool call that requires permission approval, and leave the permission dialog untouched for 60+ seconds.

  5. Inspect the hook debug log.

Result: no Notification hook fired entry is ever written in either case — only Stop hook entries appear.

  1. For contrast, repeat steps 1–5 using the Claude Code CLI (version 2.1.143) with the identical settings.json. The Notification hook DOES fire on the ~60s idle condition (Case A), producing a Notification hook fired log line + sound.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.143

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Notification hook never fires in the VSCode extension (works in CLI) — no event on idle timeout or permission prompt