Skip to content

fix(hooks): normalize hooks.json to {"hooks": {}} in 4 vertical plugins#224

Open
aiiapairoj wants to merge 2 commits into
anthropics:mainfrom
aiiapairoj:fix/hooks-json-empty-object
Open

fix(hooks): normalize hooks.json to {"hooks": {}} in 4 vertical plugins#224
aiiapairoj wants to merge 2 commits into
anthropics:mainfrom
aiiapairoj:fix/hooks-json-empty-object

Conversation

@aiiapairoj

Copy link
Copy Markdown

Summary

Four vertical plugins ship hooks/hooks.json as a bare empty array ([]). The Claude Code plugin loader validates that file against a schema expecting an object, so all four install but fail to load with:

Hook load failed: [
  {
    "expected": "object",
    "code": "invalid_type",
    "path": [],
    "message": "Invalid input: expected object, received array"
  }
]

(The exact error text varies — some loader versions report "expected": "record" — but it's the same root cause.)

Fix

Replace the file contents in the four affected plugins with the canonical shape already used by investment-banking/hooks/hooks.json:

{
  "hooks": {}
}

Affected plugins (all 0.1.0 → 0.1.1):

Plugin hooks.json before hooks.json after
financial-analysis [] {"hooks": {}}
equity-research [] {"hooks": {}}
private-equity [] {"hooks": {}}
wealth-management [] {"hooks": {}}

investment-banking already has the correct shape and is unchanged.

Verification

  • python scripts/check.pyOK — 80 file(s) checked, 0 issues.
  • Manually patched the same files in a local marketplace clone and confirmed /doctor no longer reports the load failure.

Closes

Side note (not fixed here — out of scope)

The pre-commit hook in .githooks/pre-commit shells out to python3. On Windows that binary is named python, so the hook prints python3 not found; skipping version-bump. and the contributor has to bump versions manually (as I did here in a second commit). Trivial fix: probe python3 || python in the hook. Happy to send a separate PR if useful.

🤖 Generated with Claude Code

pairojvrh added 2 commits May 17, 2026 20:21
The plugin loader validates `hooks/hooks.json` against a schema
expecting `{ "hooks": <object> }`. Four plugins shipped a bare
empty array, so they install but fail to load with:

  Hook load failed: expected object, received array

Normalizing them to match the existing canonical shape in
`investment-banking/hooks/hooks.json` resolves the load.

Affected: financial-analysis, equity-research, private-equity,
wealth-management. Reported in anthropics#218, anthropics#219, anthropics#223.
Per repo convention: a plugin's `version` gates update delivery to
already-installed users. The 4 plugins whose `hooks.json` was just
fixed need a patch bump so the fix actually ships.

(The local pre-commit hook skipped this on Windows because it shells
out to `python3` rather than `python`. Filing separately won't hurt.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants