Skip to content

馃悰 Fix plugin load failure from the duplicate hooks declaration (0.1.5) - #99

Merged
Vivekyy merged 2 commits into
mainfrom
feat/fix-duplicate-claude-hooks-manifest-4d0c
Jul 31, 2026
Merged

馃悰 Fix plugin load failure from the duplicate hooks declaration (0.1.5)#99
Vivekyy merged 2 commits into
mainfrom
feat/fix-duplicate-claude-hooks-manifest-4d0c

Conversation

@Vivekyy

@Vivekyy Vivekyy commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

What

Rudder 0.1.4 fails to load on current Claude Code. .claude-plugin/plugin.json declared "hooks": "./hooks/hooks.json", but that path is the standard location both Claude Code and Codex load on their own, so the file was registered twice.

Claude Code 2.0.60 and later detect the second registration and reject it:

Failed to load hooks from .../hooks/hooks.json: Duplicate hooks file detected:
./hooks/hooks.json resolves to already-loaded file .../hooks/hooks.json. The standard
hooks/hooks.json is loaded automatically, so manifest.hooks should only reference
additional hook files.

That surfaces as hook-load-failed and the plugin becomes unavailable. Releases before 2.0.60 accept the manifest but merge both copies, so every Rudder hook ran twice per event.

Changes

  • Removed the hooks field from .claude-plugin/plugin.json. hooks/hooks.json stays where it is and both hosts keep discovering it; the Codex manifest never declared it, so provider parity is unchanged.
  • Added a package test asserting that neither manifest declares the standard hooks path and that the file exists at that path. claude plugin validate passes either way, so it cannot catch this regression on its own.
  • Bumped the plugin to 0.1.5 across package.json, package-lock.json, both plugin manifests, and both marketplace version fields, since 0.1.4 is unusable and needs a new published version.

Verification

Installed both manifest variants from a local marketplace using real Claude Code releases and read claude plugin list --json:

Claude Code 0.1.4 manifest (declares hooks) This change (no declaration)
2.1.10 no error reported clean
2.1.21, 2.1.22, 2.1.50, 2.1.100 Duplicate hooks file detected clean
2.1.220 Duplicate hooks file detected clean

Reading the bundled loader across 2.0.0 through 2.1.100 confirms the older behavior: every release from 2.0.0 loads <plugin root>/hooks/hooks.json when it exists, and the duplicate check plus its error message first appear in 2.0.60. Removing the declaration is therefore correct on every version that supports plugins, not only current ones.

Finally, npm pack of this branch installed on 2.1.220 with errors=none and a component inventory showing both hook events, the skill, and the MCP server.

npm run check:agent-layout, npm run typecheck, npm test, npm run build, and npm run format:markdown:check all pass.

Note

almanac/architecture/tooling/plugin-package.md still says the Claude manifest points at ./hooks/hooks.json, which is now stale. Left untouched so the CodeAlmanac ingest/garden run can reconcile it.

Open in WebOpen in Cursor

Open in Stage

Greptile Summary

Removes the redundant Claude hooks manifest declaration, synchronizes the 0.1.5 release metadata, and adds regression coverage for standard hook discovery.

  • Keeps hooks/hooks.json at the host-discovered plugin-root path.
  • Ensures neither Claude nor Codex manifests explicitly redeclare the standard hooks file.
  • Updates package, lockfile, plugin, and marketplace versions consistently.

Confidence Score: 5/5

The PR appears safe to merge, with the duplicate hook registration removed and release metadata kept consistent.

The standard hooks file remains included at the plugin root, the manifests no longer redundantly register it, and all active release-version locations are synchronized.

Important Files Changed

Filename Overview
.claude-plugin/plugin.json Removes the duplicate standard-hooks declaration and updates the plugin version to 0.1.5.
test/plugin-package.test.ts Adds focused regression assertions that both manifests omit the standard hooks path while the hooks file remains present.
package.json Updates the package version to 0.1.5 while retaining the hooks directory in the published-file allowlist.
.claude-plugin/marketplace.json Synchronizes both marketplace-facing version fields with the package release.
.codex-plugin/plugin.json Synchronizes the Codex plugin manifest version without changing its hook-discovery behavior.
package-lock.json Synchronizes the lockfile root package metadata with version 0.1.5.

Reviews (1): Last reviewed commit: "馃敄 Bump Rudder plugin to 0.1.5" | Re-trigger Greptile

Claude Code and Codex both load hooks/hooks.json from the plugin root on
their own, so naming that path in .claude-plugin/plugin.json registered it
twice. Claude Code 2.0.60 and later reject the plugin with "Duplicate hooks
file detected" and drop it with hook-load-failed, which made Rudder 0.1.4
fail to load on current Claude Code; releases before 2.0.60 instead ran every
Rudder hook twice per event.

Verified against real Claude Code releases 2.1.21, 2.1.22, 2.1.50, 2.1.100,
and 2.1.220: installing the 0.1.4 manifest from a local marketplace reports
the duplicate hook-load error in `claude plugin list --json`, while the same
plugin without the manifest field installs clean with both UserPromptSubmit
and Stop still registered.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Ship the plugin-load fix: 0.1.4 is unusable on Claude Code 2.1.x, so users
need a new published version rather than a re-tag. Synchronizes the version
across package.json, package-lock.json, both plugin manifests, and both
marketplace version fields.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@ghost

ghost commented Jul 31, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Remove duplicate hooks declaration from Claude manifest
2 Add test asserting implicit hook discovery
3 Bump plugin version to 0.1.5
4 Other changes
Open in Stage

Chapters generated by Stage for commit f07f75b on Jul 31, 2026 6:28pm UTC.

@github-actions

Copy link
Copy Markdown

馃攲 Merging this PR will release the Rudder plugin

Publish @ruddercode/rudder-plugin@0.1.5 through npm Trusted Publishing.
Create the plugin tag rudder-plugin-v0.1.5.
Create the GitHub Release for rudder-plugin-v0.1.5.

The release runs through .github/workflows/publish.yml after merge.

@Vivekyy
Vivekyy marked this pull request as ready for review July 31, 2026 18:29
@Vivekyy
Vivekyy merged commit cafbc6b into main Jul 31, 2026
4 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