Claude Code plugin: "Duplicate hooks file detected" error when plugin.json declares standard hooks path
My Claude Code plugin ECC (everything-claude-code) v1.0.0 fails to load with "Error: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file ... error type: hook-load-failed" on every startup, and the plugin shows as "not available for MCP". This happens on macOS and Windows 11 even though the error is non-fatal and hooks, agents, skills, and commands still work. Why does declaring "hooks" in .claude-plugin/plugin.json trigger this, and how do I fix it?
Originally asked on GitHub: https://github.com/affaan-m/ECC/issues/103
5 answers
Fixed. A maintainer fixed this on Jan 29, 2026: the explicit
"hooks"field was removed from.claude-plugin/plugin.json, and a regression test (plugin.json does NOT have explicit hooks declaration) was added so the duplicate detection error should no longer occur.What happened: Claude Code automatically loads
hooks/hooks.jsonfrom the standard location for every plugin. ECC v1.0.0 also declared"hooks": "./hooks/hooks.json"in the manifest (introduced in commit779085e), so the loader saw the same file twice and loggedError: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file ... error type: hook-load-failed. The plugin was then marked "not available for MCP", though hooks, agents, skills, and commands kept working — noisy but non-fatal.To fix an existing install: open
ECC/.claude-plugin/plugin.jsonand delete the"hooks": "./hooks/hooks.json"line (fix the trailing comma if it was the last entry). No replacement is needed — the standardhooks/hooks.jsonis still loaded automatically. Two users confirmed this: one on Windows 11 build 26100 with plugin v1.0.0 said the plugin wasDid this work for you?What a GitHub user tried on GitHub (Worked)
The reporter identified the root cause — the manifest explicitly declaring
"hooks": "./hooks/hooks.json", a path Claude Code auto-loads — and suggested removing the line. That exact change was later confirmed by the maintainer and two commenters.Source: https://github.com/affaan-m/ECC/issues/103 (opens external site)
Did this work for you?What @apiooo tried on GitHub (Worked)
A user on Windows 11 build 26100 with plugin v1.0.0 deleted the hooks line from
plugin.jsonand reported the plugin was back to normal.Source: https://github.com/affaan-m/ECC/issues/103#issuecomment-3808585805 (opens external site)
Did this work for you?What @fursea1 tried on GitHub (Worked)
A user on Windows 11 build 26200.7628 with Claude Code v2.1.21 removed
"hooks": "./hooks/hooks.json"and reported no error afterward.Source: https://github.com/affaan-m/ECC/issues/103#issuecomment-3808757575 (opens external site)
Did this work for you?What @affaan-m tried on GitHub (Worked)
The maintainer removed the explicit hooks field from
.claude-plugin/plugin.jsonand added a regression test namedplugin.json does NOT have explicit hooks declaration.Source: https://github.com/affaan-m/ECC/issues/103#issuecomment-3815845743 (opens external site)
Did this work for you?
Related questions
- ECC: plugin marketplace add fails with 'plugins.0.source: Invalid input'
- Claude Code plugin fails to install: 'agents: Invalid input' in plugin manifest
- Why does `npm install opencode-ecc` fail with 'No matching version found'?
- PreToolUse Write hook blocks .claude/plan/*.md in everything-claude-code — fixed?
- ECC with Claude Code: how to install only the skills matching your project?