From edad7b3b47850fb824b9757a05395d981f99a413 Mon Sep 17 00:00:00 2001 From: Roberto Cano <3525807+robercano@users.noreply.github.com> Date: Mon, 6 Jul 2026 16:58:03 +0200 Subject: [PATCH] fix(harness): wrap plugin hooks.json events under a top-level "hooks" key Claude Code's plugin hooks.json schema requires the event map (PostToolUse, Stop, etc.) nested under a top-level "hooks" key -- same shape as the hooks field inside settings.json. Ours had PostToolUse/Stop directly at the root, which fails plugin load for every consumer with: Failed to load hooks from .../hooks/hooks.json: [{"expected":"record", "code":"invalid_type","path":["hooks"],"message":"Invalid input: expected record, received undefined"}] Caught while enabling the plugin in reDeploy. --- .claude/hooks/hooks.json | 44 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.claude/hooks/hooks.json b/.claude/hooks/hooks.json index e2b9a69..e5c3906 100644 --- a/.claude/hooks/hooks.json +++ b/.claude/hooks/hooks.json @@ -1,23 +1,25 @@ { - "PostToolUse": [ - { - "matcher": "Edit|Write", - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh lint" - } - ] - } - ], - "Stop": [ - { - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh test_affected" - } - ] - } - ] + "hooks": { + "PostToolUse": [ + { + "matcher": "Edit|Write", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh lint" + } + ] + } + ], + "Stop": [ + { + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh test_affected" + } + ] + } + ] + } }