From 734daba12c27f4ab961d79172dda8eb5002792df Mon Sep 17 00:00:00 2001 From: n-dryer Date: Sat, 2 May 2026 11:26:52 -0700 Subject: [PATCH] fix: align hooks declaration with current Claude Code schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two changes that together let the plugin load on current Claude Code (it currently reports `Status: ✘ failed to load`): 1. `hooks/hooks.json` — wrap the existing event map under a top-level `"hooks": { ... }` record. Current CC validates the file with a schema that expects a top-level `hooks` field, otherwise it errors with `hooks: Invalid input: expected record, received undefined`. 2. `.claude-plugin/plugin.json` — drop the `"hooks": "./hooks/hooks.json"` line. Claude Code now auto-loads `hooks/hooks.json` by convention, so declaring it explicitly causes a duplicate-load error: `Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file ... The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.` Verified with `claude plugin validate` (passes) and `claude plugin list` (`Status: ✔ enabled`) on Claude Code installed via the Mac desktop app. --- .claude-plugin/plugin.json | 3 +-- hooks/hooks.json | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 5c1d668..8903b68 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -6,6 +6,5 @@ "name": "ahacad" }, "repository": "https://github.com/ahacad/gstack", - "license": "MIT", - "hooks": "./hooks/hooks.json" + "license": "MIT" } diff --git a/hooks/hooks.json b/hooks/hooks.json index 8bce25d..38eeefd 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -1,14 +1,16 @@ { - "SessionStart": [ - { - "matcher": "", - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/ensure-setup.sh", - "timeout": 120 - } - ] - } - ] + "hooks": { + "SessionStart": [ + { + "matcher": "", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/ensure-setup.sh", + "timeout": 120 + } + ] + } + ] + } }