[BUG] VS Code extension's native permission-prompt UI doesn't fire the Notification (permission_prompt) hook

Status Fixed / completed
Reported on v2.1.215
Maintainer reply ✓ Yes — bcherny
Activity 3 comments · opened Jul 20, 2026 · closed Aug 19, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The VS Code extension's native permission-prompt UI does not fire the Notification hook (notification_type: permission_prompt) when Claude requests permission to run a tool. The identical bundled binary run directly in a plain terminal fires the same hook correctly for the same kind of permission request.

What Should Happen?

The Notification hook (permission_prompt) should fire consistently whether the permission dialog is rendered by the extension's own panel UI or by the terminal-based CLI, since both use the same underlying binary/engine.

Error Messages/Logs

None — this is a silent gap, not a crash or error. The configured hook command (writing to a file) simply never executes; no output, no log entry, no exception anywhere observed.

Steps to Reproduce

  1. Add a Notification hook with matcher permission_prompt to ~/.claude/settings.json that writes to a file when invoked.
  2. In the VS Code extension's Claude panel, ask Claude to run a shell command requiring approval (e.g. touch ~/test.txt).
  3. Leave the resulting permission popup unanswered for 90+ seconds.
  4. Observe: the hook never runs, no file is written.
  5. For comparison, run the extension's own bundled binary directly in a plain terminal (~/.vscode/extensions/anthropic.claude-code-<version>/resources/native-binary/claude) and repeat the same prompt: the hook fires as expected there.

Additional note: PreToolUse with matcher AskUserQuestion works correctly inside the extension — this is specific to the Notification/permission_prompt path for regular tool permission requests.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.215-darwin-arm64 (VS Code extension anthropic.claude-code), macOS 26.5

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

3 Comments

guoran23 · 2 months ago

Can confirm this also happens on Windows + WSL2 (not just macOS), running the VS Code extension.

Setup: Notification hook in ~/.claude/settings.json with an empty matcher (so it should catch every notification type), pointing to a command hook that pops a toast + plays a sound.

Confirmed behavior:

  • idle_prompt (Claude finishes a turn and waits for the next prompt): hook fires reliably, toast + sound both work.
  • permission_prompt (the inline Allow/Deny approval UI in the chat panel for a tool call): hook never fires. No toast, no sound, no hook invocation at all — tested multiple times by triggering a tool call that required manual approval.

Since the same hook config (same command, same empty matcher) works for idle_prompt but never fires for permission_prompt, this rules out a hooks misconfiguration on my end — it looks like the VS Code extension's native Allow/Deny UI doesn't go through the same Notification dispatch path that the terminal CLI uses.

bcherny collaborator · 1 month ago

Fixed in 2.1.233 — changelog: "Fixed Notification hooks not firing for permission prompts when running under Claude Desktop or VS Code" (https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md). Closing — reply to reopen if it still happens on the latest version.

🤖 Generated with Claude Code

github-actions[bot] · 5 days ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.