fix: use object schema for hooks.json to fix plugin load failure#46
Open
paikend wants to merge 1 commit intoanthropics:mainfrom
Open
fix: use object schema for hooks.json to fix plugin load failure#46paikend wants to merge 1 commit intoanthropics:mainfrom
paikend wants to merge 1 commit intoanthropics:mainfrom
Conversation
Four plugins shipped hooks.json as `[]` (empty array) instead of
`{"hooks": {}}` (empty object). Claude Code validates hooks config
against an object schema, so the array causes:
"expected object, received array"
This prevented financial-analysis, equity-research, private-equity,
and wealth-management plugins from loading. investment-banking was
already correct.
Fixes anthropics#11
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
hooks.jsonas[](empty JSON array) instead of{"hooks": {}}(empty JSON object)"expected object, received array"financial-analysis,equity-research,private-equity, andwealth-managementplugins from loading on any OS (reported on Windows, but reproducible everywhere)Root cause
The
hooks.jsonfiles were initialized as empty arrays ([]) instead of the expected object structure.investment-bankingwas the only plugin with the correct format ({"hooks": {}}).Claude Code's plugin loader runs schema validation (likely via Zod) that checks
typeof data === 'object' && !Array.isArray(data). Sincetypeof [] === 'object'is true in JS butArray.isArray([])is also true, the array fails the object check.Fix
Changed 4 files from
[]to{"hooks": {}}:financial-analysis/hooks/hooks.jsonequity-research/hooks/hooks.jsonprivate-equity/hooks/hooks.jsonwealth-management/hooks/hooks.jsonVerification
All 5 hooks.json files now pass object schema validation.
Test plan
investment-banking(already correct) — unchanged, still passesFixes #11
🤖 Generated with Claude Code