Plugin hook parser rejects Claude Code hooks.json files containing a top-level `description` key

Resolved 💬 1 comment Opened Jun 28, 2026 by rajitsaha Closed Jun 28, 2026

Summary

Codex fails to load plugin hooks for any Claude Code plugin whose hooks/hooks.json includes a top-level description field. Claude Code's plugin schema permits (and ignores) unknown top-level keys, so many official and community plugins ship a description for documentation purposes. Codex's parser is strict and treats the unknown key as a hard error, so the entire hook config for that plugin is dropped.

Error

⚠ failed to parse plugin hooks config .../hookify/local/hooks/hooks.json:
  unknown field `description`, expected `hooks` at line 2 column 15

⚠ failed to parse plugin hooks config .../ralph-wiggum/1.0.0/hooks/hooks.json:
  unknown field `description`, expected `hooks` at line 2 column 15

⚠ failed to parse plugin hooks config .../security-guidance/2.0.0/hooks/hooks.json:
  unknown field `description`, expected `hooks` at line 2 column 15

Reproduction

  1. Install any Claude Code plugin whose hooks/hooks.json looks like:

``json
{
"description": "Human-readable description of the plugin's hooks",
"hooks": {
"PreToolUse": [ ... ]
}
}
`
(e.g.
hookify, ralph-wiggum, security-guidance`)

  1. Start Codex.
  2. Codex prints the parse warning above and the plugin's hooks never load.

Expected behavior

Codex should ignore unknown top-level keys in hooks.json (forward/cross compatibility with Claude Code's schema), load the hooks map, and not warn — matching how Claude Code itself parses these files.

Root cause

The hooks config deserializer appears to use a strict / deny_unknown_fields-style struct for the top-level object, so any key other than hooks aborts parsing.

Suggested fix

Make the top-level hooks.json struct tolerant of unknown fields (e.g. in serde, drop #[serde(deny_unknown_fields)] on the top-level type, or add a catch-all #[serde(flatten)] extra: HashMap<String, serde_json::Value>). Only hooks needs to be read; everything else (description, future metadata) should be ignored.

Impact

Affects every Claude Code plugin that documents its hooks with a top-level description. Users must hand-edit the cached hooks.json, but Codex re-pulls the file from the git marketplace on plugin update, so the warning recurs until fixed upstream.

Workaround (until fixed)

Strip the top-level description key from the affected cached files:

for f in ~/.codex/plugins/cache/*/*/*/hooks/hooks.json \
         ~/.codex/plugins/cache/*/*/hooks/hooks.json; do
  [ -f "$f" ] && python3 - "$f" <<'PY'
import json, sys
p = sys.argv[1]
d = json.load(open(p))
if d.pop("description", None) is not None:
    json.dump(d, open(p, "w"), indent=2); open(p, "a").write("\n")
    print("fixed", p)
PY
done

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗