Skip to content

context-guard: every hook is inert — the manifest redeclares the auto-loaded hooks/hooks.json #1985

Description

@kyle-sexton

What

plugins/context-guard/.claude-plugin/plugin.json declares
"hooks": "./hooks/hooks.json". That path is the one Claude Code already loads
automatically, so the manifest field re-registers a file the harness has loaded,
and the plugin's hooks fail to load at all:

Failed to load hooks from
C:\Users\<user>\.claude\plugins\cache\melodic-software\context-guard\0.4.5\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.

Everything the plugin's hook layer exists to do — zone-crossing injection, the
blocking gate, the PostCompact evidence-degraded marker — is inert on any
machine with the plugin installed. The kill switch and posture userConfig
fields have nothing to switch.

Scope

context-guard is the only plugin in this marketplace that sets the field.
claude-ops and guardrails both ship hooks/hooks.json with no manifest
hooks key and load correctly, so the working pattern is already in-repo.

Present on main at 0.4.6; reported against the installed 0.4.5.

Fix

Remove the hooks key from the manifest. The plugins reference documents the
field for custom paths (its example is "hooks": "./config/hooks.json") and
states the location as hooks/hooks.json in the plugin root or inline in
plugin.json — the default path is not something to redeclare.

Worth a contract test: no plugin manifest may point hooks, skills,
agents, or any other component field at that component's own auto-discovered
default path. This class fails silently at load time, which is exactly the
failure mode a gate catches and a reviewer does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions