Skip to content

Load plugin hooks from hooks/hooks.json and every manifest entry - #429

Merged
ilovepixelart merged 1 commit into
ilovepixelart:mainfrom
sproott:plugin-hooks-array
Nov 14, 2026
Merged

ilovepixelart merged 1 commit into
ilovepixelart:mainfrom
sproott:plugin-hooks-array

Conversation

@sproott

@sproott sproott commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude Code accepts a plugin manifest hooks that is a path, an inline object, or an array of either, and per the plugins reference "the default file loads first, and what the manifest declares merges into it."

pi-code ignored arrays, so a plugin that lists its hooks files (ponytail, for one) registered no hooks, and a string or object hooks skipped hooks/hooks.json. Now hooks/hooks.json loads first, then every declared entry. A file listed twice loads once, and an entry that is neither a path nor an object is skipped with a warning.

  • npm run check passes (Biome, strict tsc, Vitest)
  • Tests cover the change

🤖 Generated with Claude Code

Claude Code loads hooks/hooks.json first and merges the manifest's
`hooks` into it, where `hooks` is a path, an inline object, or an array
of either. An array fell back to hooks/hooks.json, so plugins that list
their hooks files registered none, and a declared path or object
dropped the default file. Each file now loads once, and entries that are
neither a path nor an object are skipped with a warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sproott
sproott marked this pull request as draft November 14, 2026 13:59
@sproott sproott changed the title Load plugin hooks declared as an array of paths Load plugin hooks from hooks/hooks.json and every manifest entry Nov 14, 2026
@sproott
sproott marked this pull request as ready for review November 14, 2026 16:38
@ilovepixelart
ilovepixelart merged commit 928f503 into ilovepixelart:main Nov 14, 2026
12 checks passed
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