Skip to content

Bug: Duplicate hooks file error due to explicit hooks declaration in plugin.json #103

@chaonextdoor

Description

@chaonextdoor

Bug Description

The plugin fails to load cleanly on startup because the manifest (plugin.json) explicitly declares "hooks": "./hooks/hooks.json", but Claude Code automatically loads hooks/hooks.json from the standard location in any plugin. This causes a duplicate detection error.

Error Message

Loaded hooks from standard location for plugin everything-claude-code
Skipping duplicate hooks file for plugin everything-claude-code
Error: 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.
Plugin not available for MCP: everything-claude-code@everything-claude-code - error type: hook-load-failed

Impact

  • Error logged on every session startup
  • Plugin shows hook-load-failed error type
  • Plugin is marked as "not available for MCP"
  • Hooks, agents, skills, and commands still function — the error is non-fatal but noisy

Root Cause

The "hooks" field in .claude-plugin/plugin.json points to ./hooks/hooks.json, which is the standard hooks location that Claude Code loads automatically. Declaring it explicitly triggers duplicate detection.

Introduced in: commit 779085e (Jan 26, 2026)

Suggested Fix

Remove the "hooks" line from .claude-plugin/plugin.json:

 {
   "commands": ["./commands/"],
   "skills": ["./skills/"],
   "agents": [...],
-  "hooks": "./hooks/hooks.json"
 }

The standard hooks/hooks.json file will continue to be loaded automatically — no explicit declaration is needed.

Environment

  • Claude Code CLI (latest)
  • macOS
  • Plugin version: 1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions