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

[BUG] "Notification" hook doesn't work in VS Code extension "native UI" mode

Open jsh9 opened this issue 3 months ago • 6 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?

Claude Code version 2.0.8, in VS Code extension's "Native UI" mode.

The "Notification" hook doesn't work any more: when Claude Code pauses to ask for my intervention, the hook doesn't work, because I set up a hook to play a sound at that moment. I can't hear that sound any more.

But in the CLI mode (version 2.0.8), I could hear that sound.

What Should Happen?

"Notification" hook should be engaged.

Error Messages/Logs


Steps to Reproduce

Put the following into ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay -v 3 /System/Library/Sounds/Blow.aiff"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay -v 3 /System/Library/Sounds/Bottle.aiff"
          }
        ]
      }
    ]
  }
}

And do something that would make Claude Code ask for human intervention.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.0.8

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

It happened in the new "native UI" of the VS Code extension.

jsh9 avatar Oct 05 '25 22:10 jsh9

Second this -- works in terminal, fails in vscode ui mode.

redbeard avatar Oct 24 '25 07:10 redbeard

Same here (Cursor, Windows 11). Stop hook works though

bsdev90 avatar Oct 24 '25 15:10 bsdev90

Confirmed: Notification Hooks Not Firing for Permission Prompts

I can verify this issue affects permission_prompt notifications specifically.

Configuration

  • Empty matcher "matcher": "" to catch all notifications
  • Windows 11, VS Code extension
  • Enhanced script that logs notification type and message

Testing Results

Manual script test: Works perfectly when invoked directly
PreToolUse/PostToolUse hooks: Fire correctly for Read tool
Notification hooks: Never fire despite multiple permission prompts

Evidence

  • Cleared .claude/settings.local.json allow list to force prompts
  • Confirmed seeing 3+ permission prompts in UI
  • Zero notification hook invocations logged
  • Tested after full restart - same result
  • Hook script verified working via manual JSON piping

The notification hook system is completely non-functional for permission_prompt events in VS Code extension. Script works, config is correct, other hooks work, but Notification hooks are never called.

Detailed test report available if maintainers need it.

joemillerpe-ux avatar Nov 15 '25 15:11 joemillerpe-ux

I think duplicate of #11156

glasser avatar Dec 08 '25 18:12 glasser

I think duplicate of #11156

Linked issue is a consequence if this one, which is the root cause. Once hooks are supported we can intercept notification events via hooks. BTW, this is more a feature request for the VSCode extension than a bug. Unless the lack of feature parity with CLI is assumed to be a bug :) Can't wait for this to be tackled by the Anthropic team so that I can share a Claude Code notifier that uplevels notifications to MacOS system notifs when Cursor / VSCode is in the background.

TimeHunter81 avatar Dec 11 '25 22:12 TimeHunter81