hooks.json: Claude Code warns "unknown keys" for id/description on all 24 matcher groups
Symptom
On every session start, Claude Code prints:
ecc: hooks.json: unknown keys "description" in hooks.PreToolUse[0], "id" in hooks.PreToolUse[0], "description" in hooks.PreToolUse[1], "id" in hooks.PreToolUse[1], "description" in hooks.PreToolUse[2] and 43 more ignoredCause
hooks/hooks.json (v2.2.1, and marketplace HEAD 928c1dea) has 24 matcher groups. Each one carries id and description alongside matcher and hooks. Claude Code's hook schema only accepts matcher and hooks at that level, so it drops the 48 extra keys (24 × 2) and warns about them.
$ jq '[.hooks[]|.[]|select(has("id"))]|length' hooks/hooks.json
24The hooks themselves still load and run. The only effect is a warning on every startup, which makes users suspect a broken install.
Why users can't just strip the keys
The ids are load-bearing for ECC's own tooling:
scripts/lib/install/claude-settings.js(~L149, ~L200) throws if a managed hook entry lacks a uniqueid.scripts/ci/validate-hooks.js(~L192) errors on a missing or duplicateidwhenrequiresStableIdsis set.
So a local edit breaks the installer and validator, and the next plugin update overwrites it anyway.
Suggested fix
Keep the plugin-shipped hooks/hooks.json limited to the keys Claude Code accepts, and keep the metadata somewhere else. For example:
- a sidecar file (e.g.
hooks/hooks.meta.json) mappingevent[index]or a command fingerprint to{id, description}, read by the installer and validator; or - generate the plugin-facing
hooks.jsonfrom an annotated source file at build time, strippingid/description.
Either way, the installer's stable-id merge keeps working, and the startup warning goes away.
Source: affaan-m/ECC