Skip to content

Bug: Duplicate hooks.json reference causes plugin loading error #108

@luca-secchi

Description

@luca-secchi

Problem

The plugin fails to load with the following error:

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

Environment

  • Plugin Version: 1.0.0
  • Claude Code Version: v2.1.22

Root Cause

In .claude-plugin/plugin.json, line 42 explicitly declares:

"hooks": "./hooks/hooks.json"

However, Claude Code automatically loads hooks/hooks.json by convention when the file exists. Explicitly referencing it in the manifest causes a duplicate file conflict.

Suggested Fix

Remove the hooks key from .claude-plugin/plugin.json:

     "./agents/tdd-guide.md"
-  ],
-  "hooks": "./hooks/hooks.json"
+  ]
 }

The hooks/hooks.json file will still be loaded automatically by Claude Code without the explicit reference.

Affected Users

All users installing version 1.0.0 of the plugin.

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