Plugin hooks registered but not matched in VSCode extension

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Nov 28, 2025 · closed Nov 28, 2025

Description

Plugin hooks are loaded and registered but not included in the hook matching logic when running Claude Code via the VSCode extension.

Environment

  • Claude Code version: VSCode extension
  • OS: macOS (Darwin 25.1.0)

Steps to Reproduce

  1. Create a plugin with hooks in hooks/hooks.json:
{
    "description": "Automatic code formatting",
    "hooks": {
        "PostToolUse": [
            {
                "matcher": "Edit|Write",
                "hooks": [
                    {
                        "type": "command",
                        "command": "uv run python ${CLAUDE_PLUGIN_ROOT}/scripts/post_tool_use.py",
                        "timeout": 30
                    }
                ]
            }
        ]
    }
}
  1. Enable the plugin in ~/.claude/settings.json:
{
  "enabledPlugins": {
    "python-developer@carefull-marketplace": true
  }
}
  1. Use Claude Code in VSCode extension
  2. Perform an Edit operation on a Python file

Expected Behavior

The plugin's PostToolUse hook should execute after Edit operations.

Actual Behavior

The hook does not execute. Debug logs show:

[DEBUG] Loading hooks from plugin: python-developer
[DEBUG] Registered 2 hooks from 1 plugins
...
[DEBUG] Getting matching hook commands for PostToolUse with query: Edit
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "Edit" (0 before deduplication)

The hooks are loaded and registered (Registered 2 hooks from 1 plugins), but when matching occurs, only "settings" hooks are checked (Found 0 hook matchers in settings), not the registered plugin hooks.

Analysis

The matching code path appears to only check user/project hooks from settings, not the plugin hooks that were registered during initialization. The plugin hooks should be merged with settings hooks for matching.

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗