Notification hook (permission_prompt/idle_prompt) never fires from the VS Code native extension's in-editor permission dialog

Status Closed — duplicate
Reported on v2.1.215
Maintainer reply None cached
Activity 1 comment · opened Aug 6, 2026 · closed Aug 15, 2026

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:

  1. Add the above hook config to ~/.claude/settings.json.
  2. 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).
  3. Open /hooks once in an already-running session to force a config reload (confirmed necessary since the session predated the settings.json edit).
  4. Trigger a tool call that requires permission approval, causing the in-editor VS Code dialog to appear.
  5. Approve/interact with the dialog.
  6. 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 whether Notification hooks 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗