Investigation: does the ai-config plugin already carry the hooks? (no) + headless support #1123
d-morrison
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A. The plugin ships zero working hooks — schema mismatch.
The
ai-configplugin root is the repo root (marketplace.json->source: "./"),so Claude Code auto-detects
hooks/hooks.json. But that file is in the bespokeinstall-hooks.pyschema, incompatible with the plugin-hooks schema:hooksmust be an OBJECT keyed by event ({"UserPromptSubmit":[{"hooks":[...]}]});ours is an ARRAY.
{"type":"command","command":"..."}; ours are{"script","event","why"}."${CLAUDE_PLUGIN_ROOT}"/...;install-hooks.pyemits$HOME/.claude/....Consequence: enabling the plugin loads none of the 11 hooks, and the malformed file at the
auto-detected location may register a plugin load error for marketplace consumers (unverified).
B. Headless yes, cloud/web unconfirmed.
Plugin hooks appear to run in
-pheadless mode (theSetupevent fires there; only pluginmonitors are documented as interactive-only). Whether the web/cloud harness auto-enables
marketplace plugins and runs their hooks is not documented — needs a live test.
Bonus findings
.claude/settings.json, NOT/plugin install(install-hooks.pyreports registered=0,no
~/.claude/settings.json). So option 2 mainly helps other repos.defaultEnabled: falseinplugin.json(Claude Code >= 2.1.154) ships the hooks opt-in.
Net: option 2 is a real conversion, not a switch-flip — reformat
hooks/hooks.jsonto thenative schema with
${CLAUDE_PLUGIN_ROOT}, and rewrite or retireinstall-hooks.py(the twoschemas can't share one filename; duplicating them breaks DRY). The
why/_notemetadata hasno home in the native schema.
Generated by Claude Code
All reactions