From bb2f210bbf0522efec2c6ebc9cd2df9ee79c6ebc Mon Sep 17 00:00:00 2001 From: takekaraka Date: Wed, 3 Jun 2026 03:19:18 +0200 Subject: [PATCH] Fix hooks.json schema: nest matcher commands under "hooks" array Each PreToolUse/PostToolUse matcher entry placed type/command/timeout directly on the matcher object. The Claude Code hooks schema requires those nested inside a per-matcher "hooks" array, so validation failed with "expected array, received undefined" and none of the plugin hooks loaded. Wraps all four matcher entries (2 PreToolUse, 2 PostToolUse) in the required "hooks" array. No behavior change beyond the hooks now loading. Co-Authored-By: Claude Opus 4.8 (1M context) --- hooks/hooks.json | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/hooks/hooks.json b/hooks/hooks.json index 807b045..99be02d 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -3,29 +3,45 @@ "PreToolUse": [ { "matcher": "generate_tts|generate_music|generate_sfx|generate_image|generate_video|generate_subtitles|list_assets", - "type": "command", - "command": "sh scripts/check-mcp-server.sh remotion-media KIE_API_KEY", - "timeout": 5000 + "hooks": [ + { + "type": "command", + "command": "sh scripts/check-mcp-server.sh remotion-media KIE_API_KEY", + "timeout": 5000 + } + ] }, { "matcher": "replicate_run|replicate_create_prediction", - "type": "command", - "command": "sh scripts/check-mcp-server.sh replicate REPLICATE_API_TOKEN", - "timeout": 5000 + "hooks": [ + { + "type": "command", + "command": "sh scripts/check-mcp-server.sh replicate REPLICATE_API_TOKEN", + "timeout": 5000 + } + ] } ], "PostToolUse": [ { "matcher": "searchPhotos|searchVideos|downloadVideo", - "type": "command", - "command": "sh scripts/post-tool-note.sh pexels-attribution", - "timeout": 3000 + "hooks": [ + { + "type": "command", + "command": "sh scripts/post-tool-note.sh pexels-attribution", + "timeout": 3000 + } + ] }, { "matcher": "render", - "type": "command", - "command": "sh scripts/post-tool-note.sh captions-tip", - "timeout": 3000 + "hooks": [ + { + "type": "command", + "command": "sh scripts/post-tool-note.sh captions-tip", + "timeout": 3000 + } + ] } ] }