From 94d8f03cf9dc914e6c9b0f7c0412af7ad0a6fae6 Mon Sep 17 00:00:00 2001 From: lmiranda Date: Sat, 31 Jan 2026 14:26:51 -0500 Subject: [PATCH] fix: correct hooks.json structure per Claude Code documentation Three plugins had incorrect hooks.json structure that caused hooks to fail: - pr-review: SessionStart used nested `hooks` array without matcher - cmdb-assistant: SessionStart used nested `hooks` array without matcher - git-flow: Used completely wrong format (array with `event` field) Per Claude Code documentation: - Without matcher: direct `type`/`command` in the event array - With matcher: nested `hooks` array inside matcher object Co-Authored-By: Claude Opus 4.5 --- plugins/cmdb-assistant/hooks/hooks.json | 8 ++----- plugins/git-flow/hooks/hooks.json | 31 ++++++++++++++----------- plugins/pr-review/hooks/hooks.json | 8 ++----- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/plugins/cmdb-assistant/hooks/hooks.json b/plugins/cmdb-assistant/hooks/hooks.json index 367453a..d90fb51 100644 --- a/plugins/cmdb-assistant/hooks/hooks.json +++ b/plugins/cmdb-assistant/hooks/hooks.json @@ -2,12 +2,8 @@ "hooks": { "SessionStart": [ { - "hooks": [ - { - "type": "command", - "command": "${CLAUDE_PLUGIN_ROOT}/hooks/startup-check.sh" - } - ] + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/startup-check.sh" } ], "PreToolUse": [ diff --git a/plugins/git-flow/hooks/hooks.json b/plugins/git-flow/hooks/hooks.json index 81c4f4b..7860e41 100644 --- a/plugins/git-flow/hooks/hooks.json +++ b/plugins/git-flow/hooks/hooks.json @@ -1,16 +1,19 @@ { - "hooks": [ - { - "event": "PreToolUse", - "matcher": "Bash", - "type": "command", - "command": "${CLAUDE_PLUGIN_ROOT}/hooks/branch-check.sh" - }, - { - "event": "PreToolUse", - "matcher": "Bash", - "type": "command", - "command": "${CLAUDE_PLUGIN_ROOT}/hooks/commit-msg-check.sh" - } - ] + "hooks": { + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/branch-check.sh" + }, + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/commit-msg-check.sh" + } + ] + } + ] + } } diff --git a/plugins/pr-review/hooks/hooks.json b/plugins/pr-review/hooks/hooks.json index 544f8e2..529b5ec 100644 --- a/plugins/pr-review/hooks/hooks.json +++ b/plugins/pr-review/hooks/hooks.json @@ -2,12 +2,8 @@ "hooks": { "SessionStart": [ { - "hooks": [ - { - "type": "command", - "command": "${CLAUDE_PLUGIN_ROOT}/hooks/startup-check.sh" - } - ] + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/startup-check.sh" } ] } -- 2.49.1