Plugin hooks.json: PreToolUse hooks don't fire (only SessionStart works)

Resolved 💬 3 comments Opened Mar 19, 2026 by felipearomani Closed Mar 23, 2026

Description

PreToolUse hooks defined in a Claude Code plugin's hooks/hooks.json file don't fire when tools are used. Only SessionStart hooks work from plugins.

Steps to Reproduce

  1. Create a plugin with a hooks/hooks.json containing both SessionStart and PreToolUse hooks:
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "echo 'SessionStart works'"
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "echo 'PreToolUse fired'"
          }
        ]
      }
    ]
  }
}
  1. Install the plugin and start a new session
  2. The SessionStart hook fires and its message is visible
  3. Use the Bash tool — the PreToolUse hook does NOT fire

Verification

  • The same PreToolUse hook config works when placed in the user's ~/.claude/settings.json
  • Confirmed by writing to a file (/tmp/hook-debug.log) — the file is created from settings.json but NOT from the plugin's hooks.json
  • The plugin is correctly installed and cached at ~/.claude/plugins/cache/

Expected Behavior

PreToolUse hooks defined in plugin hooks/hooks.json should fire before tool use, just as they do when defined in settings.json.

Environment

  • macOS (Darwin 25.3.0)
  • Claude Code CLI (latest)

View original on GitHub ↗

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