Environment:
- Claude Code version: 2.0.76
- VSCode/Cursor version: 2.3.18 (df371ac0d93fe1a68d05eeb59a09c5c39add0c80, arm64)
- OS: macOS 26.1 (Build 25B5072a)
- Extension: anthropic.claude-code
Description:
Notification hooks configured in settings work correctly when using Claude Code in the terminal CLI, but fail to execute when using the VSCode extension (via "Open in new tab" option in Cursor).
Expected Behavior:
When configured notification hooks (e.g., permission_prompt, idle_prompt) should trigger in both terminal CLI and VSCode extension environments.
Actual Behavior:
Configuration:
Hooks configured in ~/.claude/settings.json:
```json
{
"hooks": {
"Notification": [
{
"matcher": "permission_prompt",
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification "Claude needs your permission" with title "Claude Code" sound name "default"' && say 'Claude Code needs your permission' -r 200"
}
]
},
{
"matcher": "idle_prompt",
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification "Waiting for your input" with title "Claude Code" sound name "default"' && say 'Claude is waiting for your input' -r 200"
}
]
}
]
}
}
```
Also attempted in project-specific <project>/.claude/settings.local.json - same result.
Debug Evidence:
Terminal CLI debug log (working):
```
2026-01-02T21:10:49.435Z [DEBUG] Found 2 hook matchers in settings
2026-01-02T21:10:49.436Z [DEBUG] Matched 1 unique hooks for query "idle_prompt" (1 before deduplication)
2026-01-02T21:10:52.273Z [DEBUG] Notification:idle_prompt [...] completed with status 0
```
VSCode Extension debug log (not working):
```
2026-01-03T01:34:23.737Z [DEBUG] Watching for changes in setting files /Users/sahan/.claude, /Users/sahan/sidegig-api/.claude...
2026-01-03T01:34:24.822Z [DEBUG] Found 0 hook matchers in settings
2026-01-03T01:34:24.853Z [DEBUG] Found 0 hook matchers in settings
```
Steps to Reproduce:
- Configure notification hooks in
~/.claude/settings.json (see configuration above)
- Test in terminal: Run `claude` from terminal → hooks work ✅
- Test in VSCode: Use "Open in new tab" in Cursor → hooks don't work ❌
- Check debug logs: `grep "hook matchers" ~/.claude/debug/latest`
Additional Notes:
- The VSCode extension correctly watches the settings directories
- File watcher detects changes to settings files
- Hooks are properly formatted (validated by working terminal implementation)
- Issue appears to be in how the VSCode extension loads/parses hooks from settings
Possible Root Cause:
The VSCode extension may be using a different settings loading mechanism that doesn't properly parse the `hooks` configuration from the settings JSON files.
Environment:
Description:
Notification hooks configured in settings work correctly when using Claude Code in the terminal CLI, but fail to execute when using the VSCode extension (via "Open in new tab" option in Cursor).
Expected Behavior:
When configured notification hooks (e.g.,
permission_prompt,idle_prompt) should trigger in both terminal CLI and VSCode extension environments.Actual Behavior:
✅ Terminal CLI: Hooks execute successfully
Found 2 hook matchers in settings❌ VSCode Extension: Hooks never execute
Found 0 hook matchers in settingsConfiguration:
Hooks configured in
~/.claude/settings.json:```json
{
"hooks": {
"Notification": [
{
"matcher": "permission_prompt",
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification "Claude needs your permission" with title "Claude Code" sound name "default"' && say 'Claude Code needs your permission' -r 200"
}
]
},
{
"matcher": "idle_prompt",
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification "Waiting for your input" with title "Claude Code" sound name "default"' && say 'Claude is waiting for your input' -r 200"
}
]
}
]
}
}
```
Also attempted in project-specific
<project>/.claude/settings.local.json- same result.Debug Evidence:
Terminal CLI debug log (working):
```
2026-01-02T21:10:49.435Z [DEBUG] Found 2 hook matchers in settings
2026-01-02T21:10:49.436Z [DEBUG] Matched 1 unique hooks for query "idle_prompt" (1 before deduplication)
2026-01-02T21:10:52.273Z [DEBUG] Notification:idle_prompt [...] completed with status 0
```
VSCode Extension debug log (not working):
```
2026-01-03T01:34:23.737Z [DEBUG] Watching for changes in setting files /Users/sahan/.claude, /Users/sahan/sidegig-api/.claude...
2026-01-03T01:34:24.822Z [DEBUG] Found 0 hook matchers in settings
2026-01-03T01:34:24.853Z [DEBUG] Found 0 hook matchers in settings
```
Steps to Reproduce:
~/.claude/settings.json(see configuration above)Additional Notes:
Possible Root Cause:
The VSCode extension may be using a different settings loading mechanism that doesn't properly parse the `hooks` configuration from the settings JSON files.