fix: stop re-declaring the auto-loaded hooks file in the plugin manifest - #134
Merged
Merged
Conversation
Claude Code loads the standard hooks/hooks.json automatically; declaring it
in manifest.hooks registered the same file twice and the loader rejected the
entire plugin ('Duplicate hooks file detected: ./hooks/hooks.json'), taking
all 18 skills, 5 crew agents, every ambient guard and the forge-cortex MCP
server down with it. manifest.hooks is only for additional hook files.
- .claude-plugin/plugin.json: drop the redundant hooks entry.
- src/doctor.js: the plugin-hooks check now defaults to the standard path
when manifest.hooks is absent, and warns when a manifest re-declares the
auto-loaded file (the exact failure this fixes).
- test/channels.test.js: regression test — fails if the standard hooks path
is ever re-declared. Verified it catches the old manifest.
- CHANGELOG.md: Fixed entry under Unreleased.
Gate: 1129/1131 pass (2 skipped), biome clean, tsc clean, docs check exit 0.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pyb7qWVaCdDzkQ1CfiaBk2
CodeWithJuber
marked this pull request as ready for review
August 22, 2026 20:01
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.
What & why
When forgekit 0.32.0 is installed as a marketplace plugin, Claude Code rejects it at load time:
Claude Code auto-loads the standard
hooks/hooks.jsonfrom the plugin root;manifest.hooksis only for additional hook files. The manifest re-declared the standard path, registering it twice, and the loader rejected the whole plugin — all 18 skills, 5 crew agents, every ambient guard, and theforge-cortexMCP server were absent for marketplace installs. (--plugin-dirdev flows and the repo's dogfood.claude/settings.jsonwere unaffected, which is why this went unnoticed;claude plugin validatedoesn't catch it either, as it's runtime-only.)Changes:
.claude-plugin/plugin.json: drop the redundant"hooks": "./hooks/hooks.json"entry. The hooks file itself is unchanged and still loads — automatically.src/doctor.js: the "Claude plugin hooks" check now defaults to the standard path whenmanifest.hooksis absent, and warns when a manifest re-declares the auto-loaded file (the exact failure this fixes).test/channels.test.js: regression test that fails if the standard hooks path is ever re-declared (verified it fails against the old manifest).CHANGELOG.md:### Fixedentry under## [Unreleased].Verified end-to-end: after this fix,
claude plugin install forgekit@forgeloads withStatus: √ enabledinstead of× failed to load.Checklist
npm testpasses (1129 pass / 2 skipped / 0 fail, Node 20)npm run checkpasses (Biome lint + format — no fixes applied)fix:)CHANGELOG.mdupdated under## [Unreleased]forge substrate,forge impact, router/gate, or MCP substrate toolsRisk & rollback
Extra checks (tick if applicable)
npm run typecheckpasses🤖 Generated with Claude Code
https://claude.ai/code/session_01Pyb7qWVaCdDzkQ1CfiaBk2
Generated by Claude Code