Skip to content

fix(plugin): nest hook matchers under hooks so Claude Code loads the plugin - #148

Merged
ryanleecode merged 1 commit into
masterfrom
fix/plugin-hooks-wrapper
Oct 26, 2026
Merged

ryanleecode merged 1 commit into
masterfrom
fix/plugin-hooks-wrapper

Conversation

@systemfsoftware-bot

Copy link
Copy Markdown
Contributor

claude plugin list showed the marketplace plugin as ✘ failed to load: "Hook load failed: hooks.json must have 'hooks' (the hook matchers) or 'modules' (hooks modules), or both". hooks/hooks.json had PostToolUse at the top level; Claude Code requires it under hooks. This wraps it, with no other change, plus a patch changeset so the release workflow cuts a tag the workstation can pin the marketplace to.

Checked: claude plugin validate . passes; the hook command, run from this tree against a Write payload with a restating comment, flags it and exits 2.

https://claude.ai/code/session_012bHx97dSM8bVZv8HoNDdNc

…plugin

Claude Code rejects a plugin hooks.json without a top-level hooks key
("Hook load failed: hooks.json must have 'hooks'"), so installing the
plugin from the marketplace checked nothing.

Claude-Session: https://claude.ai/code/session_012bHx97dSM8bVZv8HoNDdNc
@ryanleecode
ryanleecode merged commit 9f8896e into master Oct 26, 2026
9 of 10 checks passed
@ryanleecode
ryanleecode deleted the fix/plugin-hooks-wrapper branch October 26, 2026 05:53

@kiro-systemf kiro-systemf Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conductor review (kirocrew-conductor-2) of the merged change 9e44128eb1..9f8896ee80, from review-only session review-comm-148 (/ce-code-review base:9e44128eb1) plus my verdict. This PR merged with gate red, and master has been red since.

P1. The plugin-hooks test still reads the old top-level shape (crates/comment-checker/tests/hook_commands.rs:64).

  • Evidence: cargo test --test hook_commands at 9f8896ee80 gives 2 passed; 9 failed, nine panics at hook_commands.rs:34:9: "hooks/hooks.json must wire exactly one PostToolUse command hook, found []". gate / gate is the only failing job, on the merge commit (run 40276645554) and on master 45e50465ef (run 40276667634). Master was green at 9e44128eb1. The changeset-release/master release PR is failing on the same job.
  • The hooks.json change is right; the test is wrong.
    • Claude Code's plugin components reference specifies hooks/hooks.json as {"hooks": {"PostToolUse": [...]}}, the shape this PR adopted (the command string is byte-identical).
    • The test's sibling parsers already read the nested shape (hook_commands.rs:49, :57). Only plugin_hook_command still reads top-level hooks["PostToolUse"].
  • Fix (follow-up PR): change line 64 to exactly_one(&command_hooks(&hooks["hooks"]["PostToolUse"]), "hooks/hooks.json"), then run cargo test --test hook_commands and the full gate.

Nothing else: the diff is in scope (the changeset and hooks/hooks.json), clean of skips, secrets and markers, and the literals match hooks/run.ts and the npm package name. Test integrity: no new exports or tests. The failing test is not tautological; it catches exactly the plugin-not-wiring bug this PR fixes.

Residual, awareness only: plugin.json pins 0.3.6, while the changeset bumps the npm package at the next release.

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