claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] PermissionRequest hook does not trigger in VSCode extension

Open McBenac opened this issue 2 weeks ago • 1 comments

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?

Description

The PermissionRequest hook does not fire when the permission dialog (Yes/No/Yes and don't ask again) is displayed in the VSCode extension. The hook is documented as a valid hook type but appears to not be implemented or broken in VSCode.

Steps to reproduce

  1. Add PermissionRequest hook to ~/.claude/settings.json:
{
  "hooks": {
    "PermissionRequest": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "powershell -Command \"(New-Object Media.SoundPlayer 'C:\\Windows\\Media\\Windows Proximity Notification.wav').PlaySync()\"",
            "timeout": 5000
          }
        ]
      }
    ]
  }
}
  1. Reload VSCode window
  2. Ask Claude to run a command that requires permission approval
  3. Permission dialog appears but hook does NOT trigger

Expected behavior

Hook should trigger when permission dialog is displayed

Actual behavior

Hook never triggers. Tested with and without matcher: "*".

Note: PreToolUse hook DOES work with the same configuration, but triggers on ALL tool calls (including auto-approved ones), making it unsuitable for notification purposes.

Use case

Running Claude Code in multiple VSCode windows and needing audio notification when human intervention is required, so agents can continue working after approval. Now multiple agents are waiting for approval, unnecessarily pausing the work.

Environment

  • Claude Code VSCode extension
  • Windows 11
  • hooks configured in ~/.claude/settings.json

What Should Happen?

Hook should trigger when permission dialog is displayed

Error Messages/Logs


Steps to Reproduce

  1. Add PermissionRequest hook to ~/.claude/settings.json:
{
  "hooks": {
    "PermissionRequest": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "powershell -Command \"(New-Object Media.SoundPlayer 'C:\\Windows\\Media\\Windows Proximity Notification.wav').PlaySync()\"",
            "timeout": 5000
          }
        ]
      }
    ]
  }
}
  1. Reload VSCode window
  2. Ask Claude to run a command that requires permission approval
  3. Permission dialog appears but hook does NOT trigger

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude Opus 4.5 (model ID: claude-opus-4-5-20251101)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

McBenac avatar Dec 06 '25 12:12 McBenac