fix: align hooks declaration with current Claude Code schema#4
Open
n-dryer wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The plugin currently fails to load on recent Claude Code (
Status: ✘ failed to load). Two small schema fixes:hooks/hooks.json— wrap the existing event map under a top-level"hooks": { ... }record. CC's hooks validator now requires this top-level key; without it, load fails with:.claude-plugin/plugin.json— drop the\"hooks\": \"./hooks/hooks.json\"line. CC now auto-loadshooks/hooks.jsonby convention, so declaring it explicitly causes:Behavior is unchanged — the same
SessionStarthook still firesensure-setup.sh.Repro before the fix
After
Tested via a wrapper marketplace pointing at this branch, on Claude Code installed from the Mac desktop app. SessionStart hook still runs
ensure-setup.shend-to-end (Playwright Chromium download + browse binary build + compat symlink).Test plan
claude plugin validate <plugin-dir>→ passesStatus: ✔ enabledinclaude plugin listensure-setup.sh,vendor/gstack/browse/dist/browseends up builtbrowse,plan-ceo-review,plan-eng-review,qa,retro,review,setup-browser-cookies,ship) appear in the session's available-skills list🤖 Generated with Claude Code