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
- Create a plugin with a
hooks/hooks.jsoncontaining bothSessionStartandPreToolUsehooks:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "echo 'SessionStart works'"
}
]
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "echo 'PreToolUse fired'"
}
]
}
]
}
}
- Install the plugin and start a new session
- The
SessionStarthook fires and its message is visible - Use the Bash tool — the
PreToolUsehook does NOT fire
Verification
- The same
PreToolUsehook 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 fromsettings.jsonbut NOT from the plugin'shooks.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)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗