[BUG] Notification hook does not fire in VSCode extension

Resolved 💬 30 comments Opened Nov 7, 2025 by yoshiki0630 Closed Feb 6, 2026
💡 Likely answer: A maintainer (blois, 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 Notification hook does not fire in the VSCode extension version of Claude Code.

Actual Behavior

  • Permission dialog is displayed as expected
  • However, the Notification hook does not fire
  • No log file is created by the hook command
  • PreToolUse and Stop hooks work correctly

What Should Happen?

Expected Behavior

According to the documentation (https://code.claude.com/docs/ja/hooks#notification), the Notification hook should fire in the following cases:

  • When Claude Code requests permission to use a tool
  • When the prompt input has been idle for at least 60 seconds

Error Messages/Logs

None

Steps to Reproduce

Steps to Reproduce

  1. Configure a Notification hook in settings.json with a command that logs to a file
  2. Reload VSCode window
  3. Configure permissions.ask to require confirmation for specific tools (e.g., Bash)
  4. Execute a tool that triggers the permission dialog

sample_settings.json

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.35 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

  • When the permission dialog was displayed, the Notification hook did not execute
  • The log file specified in the command was never created
  • Other hooks (PreToolUse, Stop) work as expected
  • Workaround: Using PreToolUse hook with matcher "Write|Edit|Bash|NotebookEdit" to achieve similar functionality
  • Unclear if this issue exists in the CLI version
  • This may be specific to the VSCode extension

View original on GitHub ↗

30 Comments

tatsuo48 · 8 months ago

I'm in the same situation and struggling as well. I'll include some information.

MacOS
VSCode Version: 1.105.0
Claude Code Extention Version: 2.0.35

settings.json

{
  "permissions": {
    "allow": [
      "Bash(git:*)",
      "Bash(ls:*)",
      "Bash(cat:*)",
      "Bash(pwd:*)",
      "Bash(cd:*)",
      "Bash(find:*)",
      "Bash(grep:*)",
      "Bash(rg:*)",
      "Bash(npm:*)",
      "Bash(node:*)",
      "Bash(python:*)",
      "Bash(make:*)",
      "Bash(jq:*)",
      "Bash(curl:*)",
      "Bash(echo:*)",
      "Bash(gh:*)",
      "WebFetch(domain:github.com)",
      "WebFetch(domain:vercel.com)",
      "WebFetch(domain:docs.anthropic.com)",
      "WebFetch(domain:stackoverflow.com)",
      "WebFetch(domain:developer.mozilla.org)",
      "WebFetch(domain:npmjs.com)",
      "WebFetch(domain:nextjs.org)"
    ],
    "deny": [
      "Bash(sudo:*)",
      "Bash(rm:*)",
      "Bash(rm -rf:*)",
      "Bash(git push origin master)",
      "Bash(git push origin main)",
      "Bash(git reset:*)",
      "Bash(git rebase:*)",
      "Read(.env.*)",
      "Read(id_rsa)",
      "Read(id_ed25519)",
      "Read(**/*token*)",
      "Read(**/*key*)",
      "Write(.env*)",
      "Write(**/secrets/**)",
      "Bash(curl:*)",
      "Bash(wget:*)",
      "Bash(nc:*)",
      "Bash(npm uninstall:*)",
      "Bash(npm remove:*)",
      "Bash(psql:*)",
      "Bash(mysql:*)",
      "Bash(mongod:*)",
      "mcp__supabase__execute_sql"
    ],
    "defaultMode": "default"
  },
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e $'display notification \"タスク完了\" with title \"claude code\" sound name \"Glass\" \ntell application id \"com.microsoft.VSCode\" to activate'"
          }
        ]
      }
    ],
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e $'display notification \"claude > 確認事項があります!\" with title \"claude code\" sound name \"Glass\" \ntell application id \"com.microsoft.VSCode\" to activate'"
          }
        ]
      }
    ]
  },
  "statusLine": {
    "type": "command",
    "command": "npx ccusage@latest statusline"
  },
  "alwaysThinkingEnabled": true
}

Logs

2025-11-08 12:56:02.535 [info] From claude: [DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)
[DEBUG] executePreToolHooks called for tool: Bash
[DEBUG] Getting matching hook commands for PreToolUse with query: Bash
[DEBUG] Found 1 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)

2025-11-08 12:56:02.984 [info] From claude: [DEBUG] Getting matching hook commands for PostToolUse with query: Bash
[DEBUG] Found 1 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)

2025-11-08 12:56:02.996 [info] From claude: [DEBUG] Getting matching hook commands for PostToolUse with query: Bash
[DEBUG] Found 1 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)

2025-11-08 12:56:02.998 [info] From claude: [DEBUG] Skills and commands included in Skill tool:
[DEBUG] Slash commands included in SlashCommand tool:

2025-11-08 12:56:03.654 [info] From claude: [DEBUG] Stream started - received first chunk

2025-11-08 12:56:03.689 [info] From claude: [DEBUG] Stream started - received first chunk

2025-11-08 12:56:04.560 [info] From claude: [DEBUG] Stream started - received first chunk

2025-11-08 12:56:06.056 [info] From claude: [DEBUG] executePreToolHooks called for tool: Bash
[DEBUG] Getting matching hook commands for PreToolUse with query: Bash
[DEBUG] Found 1 hook matchers in settings

2025-11-08 12:56:06.056 [info] From claude: [DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)

2025-11-08 12:56:06.068 [info] Received message from webview: {"type":"request","requestId":"7oa7jbx36oy","request":{"type":"show_notification","message":"Claude is requesting permission to use Bash","severity":"info","buttons":["View"],"onlyIfNotVisible":true}}

For privacy, the commands have been removed, but in reality the command contents are written.
<img width="1573" height="412" alt="Image" src="https://github.com/user-attachments/assets/a1dd12c9-774f-4cbb-b37f-232356aeb1f1" />

In my case, it seems to have been resolved by updating VSCode to 1.105.1 and restarting.
I’d like to monitor it a bit longer.

memetican · 8 months ago

Confirming this on Win11 as well.

The Claude CLI does trigger the Notification hook, but the Claude Code extension does not.

OS Name Microsoft Windows 11 Pro
Version 10.0.26100 Build 26100
VSCode Version: 1.105.0
Claude Code Extension Version: 2.0.35

Unfortunately updating to VSCode 1.105.1 and restarting ( VSCode, and the system ) did not resolve the problem.

yoshiki0630 · 8 months ago

Thank you all for reporting this issue.

I also tested it with VSCode 1.105.1 in my environment, but the Notification hook did not work.

edsonbrusque · 8 months ago

It also doesn't work for me. Please, someone fix this.

dappthatass · 8 months ago

i was very sad to learn about this bug. losing a lot of efficiency by having to watch Claude in case it asks me for something OR have it sit idle for some time because I'm doing something else and didn't notice

cookiejoo · 7 months ago

me too!!!

noamt · 7 months ago

This is affecting me as well

glasser · 7 months ago

It would be great if this were fixed; it would also be great if there were an option to allow the VSCode extension to use VSCode's native notifications for Claude Code notifications.

cookiejoo · 7 months ago

I have an alternative solution : Is Use Terminal !

Open Claude Code -> click 。。。 -> Configure Editor -> input:Use Terminal -> choose:Use Terminal

<img width="665" height="287" alt="Image" src="https://github.com/user-attachments/assets/712291ce-c595-4941-9754-6a549cb71390" />

<img width="615" height="508" alt="Image" src="https://github.com/user-attachments/assets/6ad0a113-71e6-4b3a-ac5d-6feda55a6f98" />

<img width="1438" height="532" alt="Image" src="https://github.com/user-attachments/assets/36fe17cc-28c5-47a8-97ff-ecf68dddd894" />

<img width="1524" height="886" alt="Image" src="https://github.com/user-attachments/assets/2a001b90-8456-4a29-979f-c543b22d6d0f" />

edsonbrusque · 7 months ago

@cookiejoo This is not a solution. It's a workaround and a poor one.

The VS Code extension can do things the terminal doesn't, that's why we use it.

cookiejoo · 7 months ago
@cookiejoo This is not a solution. It's a workaround and a poor one. The VS Code extension can do things the terminal doesn't, that's why we use it.

I know, bro! It's just that when you need a hook to solve some indispensable problems, it's a choice you have to make. Hope the official will respond!

rvnikita · 6 months ago

Not working for me, please fix this ASAP

gerald-lee · 6 months ago

This is an important issue affect user productivity. Can this be prioritized?

chwoozy · 6 months ago

need this looked at as soon as possible please

cookiejoo · 6 months ago

I found today that this issue has been resolved. Please help verify it and also report back if it's still not fixed.

easonfg · 6 months ago

for me only AskUserQuestion would trigger the notification hook, any other permission asking to run Bash or read file would not trigger notification still

memetican · 5 months ago

@cookiejoo I'm seeing the same behavior.

yoshiki0630 · 5 months ago

It doesn't seem to work in my environment either.

BenWilles · 5 months ago

same here. 10 weeks old, no one cares?

thzking703 · 5 months ago

I'm experiencing the same issue. I analyzed the VSCode extension source code and found the root cause.

Environment

| Item | Value |
|------|-------|
| Host OS | Ubuntu Server (Linux 6.5.0-45-generic) |
| Claude Code CLI | 2.1.19 |
| Claude Code VSCode Extension | 2.1.19 |
| VSCode | 1.108.2 |
| Connection Method | VSCode Remote SSH from Mac/Windows |

Setup Details

[Local PC (Mac/Windows)]              [Ubuntu Server]
         VSCode  ──── SSH Connection ────→  Claude Code CLI (installed)
           │                                       ↑
           └── Remote SSH Extension ──→ Claude Code VSCode Extension
                                        (runs on server, invokes CLI)
  • Claude Code CLI is installed on the Ubuntu server
  • Local PC connects to Ubuntu server via VSCode Remote SSH extension
  • Claude Code VSCode extension runs on the server side and invokes the Claude Code CLI on the server
  • All hook scripts are executed on the Ubuntu server

Hook Behavior in My Environment

I have configured hooks for all available events:

| Hook | Terminal CLI | VSCode Extension |
|------|--------------|------------------|
| PreToolUse | Works | Works |
| PostToolUse | Works | Works |
| UserPromptSubmit | Works | Works |
| Stop | Works | Works |
| SubagentStop | Works | Works |
| SessionStart | Works | Works |
| SessionEnd | Works | Works |
| PreCompact | Works | Works |
| Notification | Works | Does NOT fire |
| PermissionRequest | Works | Does NOT fire |

---

Root Cause

Missing Subtype Handlers in processControlRequest()

The processControlRequest() method only handles 3 subtypes:

async processControlRequest(e,r){
  if(e.request.subtype==="can_use_tool"){
    // Implemented - handles tool permission requests
    return{...await this.canUseTool(...),toolUseID:e.request.tool_use_id}
  }else{
    if(e.request.subtype==="hook_callback"){
      // Implemented - handles PreToolUse/PostToolUse hooks
      return await this.handleHookCallbacks(e.request.callback_id,e.request.input,...)
    }
    if(e.request.subtype==="mcp_message"){
      // Implemented - handles MCP messages
    }
  }
  throw Error("Unsupported control request subtype: "+e.request.subtype)
  // Notification and PermissionRequest reach here and throw error
}

Subtype Support Matrix

| Subtype | Handler Method | Status |
|---------|---------------|--------|
| can_use_tool | canUseTool() | Implemented |
| hook_callback | handleHookCallbacks() | Implemented |
| mcp_message | MCP handler | Implemented |
| Notification | - | Not implemented |
| PermissionRequest | - | Not implemented |

Why PreToolUse/PostToolUse Work

These hooks are sent as hook_callback subtype and processed by handleHookCallbacks():

handleHookCallbacks(e,r,n,s){
  let i=this.hookCallbacks.get(e);
  if(!i)throw Error(`No hook callback found for ID: ${e}`);
  return i(r,n,{signal:s})  // Executes registered callback
}

Why Notification/PermissionRequest Don't Work

These are sent as separate subtypes (Notification, PermissionRequest) but there's no handler for them in processControlRequest(). They fall through to the final throw Error() statement.

Processing Flow Comparison

[PreToolUse/PostToolUse (works)]
CLI -> control_request(subtype="hook_callback") -> handleHookCallbacks() -> User hook executed

[Notification/PermissionRequest (doesn't work)]
CLI -> control_request(subtype="Notification") -> processControlRequest() -> No handler -> Error

Regarding Recent Reports

@easonfg reported on 1/17 that "only AskUserQuestion triggers the notification hook". This suggests AskUserQuestion may use a different code path. Further investigation may be needed to understand this partial behavior.

---

Suggested Fix

Adding handlers for Notification and PermissionRequest subtypes in processControlRequest() should resolve this issue:

async processControlRequest(e,r){
  // ... existing handlers ...

  // Add these handlers:
  if(e.request.subtype==="Notification"){
    return await this.handleHookCallbacks(/* Notification hook params */);
  }
  if(e.request.subtype==="PermissionRequest"){
    return await this.handleHookCallbacks(/* PermissionRequest hook params */);
  }

  throw Error("Unsupported control request subtype: "+e.request.subtype)
}

Analyzed File

~/.vscode-server/extensions/anthropic.claude-code-2.1.19-linux-x64/extension.js

ndru123 · 5 months ago

Please fix this ASAP. Still not fixed on Claude Code VSCode Extension 2.1.22, VSCode 1.108.2

cedric-vermeulen · 5 months ago

Same issue here, it's been a while...

RodPaDev · 5 months ago

Has this been fixed?

blois collaborator · 5 months ago

PermissionRequest hooks are now supported in the IDE:

{
  "hooks": {
"PermissionRequest": [
  {
    "hooks": [
      {
        "type": "command",
        "command": "powershell.exe -Command \"[console]::beep(1000, 500)\"",
        "async": true
      }
    ]
  }
]
  }
}
kyleawayan · 5 months ago

Thanks @blois ! Can confirm it works for me!

blois collaborator · 5 months ago

Going to close this issue out- PermissionRequest notifications should be working and right now we do not have plans to support the Notification hook from the IDE- the semantics of this hook are fairly tied to the TUI.

ivanjuras · 5 months ago

@blois It's still not firing. My notification script hasn't fired when I got this. It's the Permission hook that's not working.

<img width="2074" height="422" alt="Image" src="https://github.com/user-attachments/assets/05f25a10-3661-4cd5-9cae-d9ea7879bfd9" />

blois collaborator · 5 months ago

@ivanjuras an additional fix should be arriving shortly.

Nespouique · 5 months ago

Hi, thanks for your actions. Is it planned to have native windows notification via VSCode extension when Opus needs our input or has finished working ?

github-actions[bot] · 4 months 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.