[BUG] Plugin hooks registered but not firing in VSCode extension
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?
GitHub Bug Report: VS Code Plugin Hooks Not Loading
Repository: https://github.com/anthropics/claude-code/issues/new
Title: VS Code Extension: Plugin hooks.json not loaded - hooks only work from settings.json
---
Summary
Hooks defined in a plugin's hooks/hooks.json file are not loaded by the VS Code extension. Hooks only fire when defined directly in .claude/settings.json or ~/.claude/settings.json.
Environment
- Platform: macOS (Darwin 25.2.0)
- Claude Code: VS Code Extension
- Date: 2025-01-16
Expected Behavior
According to hooks documentation, plugins can provide hooks via hooks/hooks.json:
Plugins can provide hooks via hooks/hooks.json
The hookify plugin demonstrates this pattern with its hooks/hooks.json file.
When a plugin is enabled via enabledPlugins in settings.json, its hooks should automatically be registered and fire on the appropriate events.
Actual Behavior
Hooks defined in a plugin's hooks/hooks.json are not loaded by the VS Code extension. The hooks only fire when copied directly into .claude/settings.json.
Impact
- Plugin portability: Plugins cannot be self-contained with their own hooks
- Plugin marketplace: Published plugins with hooks may not work in VS Code
- User experience: Users must manually copy hooks from plugin to settings.json
- Maintenance burden: Hook updates in plugins don't propagate - users must re-copy each time plugin is updated
Additional:
- CLI loads the plugin hook correctly, without copying to settings.json
Related
- hookify plugin - Official plugin with hooks.json
- Hooks documentation
False positives for duplicate issue:
Have reviewed and the ones below that relate are closed as duplicates or done, but the duplicates were false positives and this issue persist.
https://github.com/anthropics/claude-code/issues/10997
https://github.com/anthropics/claude-code/issues/11509
https://github.com/anthropics/claude-code/issues/11544
https://github.com/anthropics/claude-code/issues/6305
What Should Happen?
Claude VSCode extension should recognize local file plugin hooks in place without need to copy into settings.json
Error Messages/Logs
Steps to Reproduce
Reproduction Steps
1. Create a plugin with hooks
Create directory structure:
.claude/plugins/my-plugin/
├── .claude-plugin/
│ └── marketplace.json.json
│ └── plugin.json
└── hooks/
├── __init__.py
└── hooks.json
marketplace.json
{
"name": "my-plugin-marketplace",
"version": "1.0.0",
"description": "Test local marketplace",
"owner": {
"name": "Local",
"email": "local@localhost"
},
"plugins": [
{
"name": "my-plugin",
"version": "1.0.0",
"description": "Test plugin with hooks"
"source": "./"
}
]
}
plugin.json:
{
"name": "my-plugin",
"version": "1.0.0",
"description": "Test plugin with hooks"
}
hooks/hooks.json:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "echo '{\"hookSpecificOutput\": {\"hookEventName\": \"UserPromptSubmit\", \"additionalContext\": \"Hook fired from plugin!\"}}'",
"timeout": 10
}
]
}
]
}
}
2. Enable the plugin in settings.json
.claude/settings.json:
{
"extraKnownMarketplaces": {
"my-plugin-marketplace": {
"source": {
"source": "directory",
"path": "./.claude/plugins/my-plugin"
}
}
},
"enabledPlugins": {
"my-plugin@my-plugin-marketplace": true
}
}
3. Test in VS Code
- Open project in VS Code
- Open Claude Code extension
- Send any message
Result: No hook output appears. The UserPromptSubmit hook does not fire.
4. Workaround - Add hooks directly to settings.json
.claude/settings.json:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "echo '{\"hookSpecificOutput\": {\"hookEventName\": \"UserPromptSubmit\", \"additionalContext\": \"Hook fired from settings.json!\"}}'",
"timeout": 10
}
]
}
]
},
"extraKnownMarketplaces": { ... },
"enabledPlugins": { ... }
}
Result: Hook ONLY fires correctly when defined in settings.json. Does not fire when in setup as above.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
VSCode Extension v.2.1.9
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗