1 Commits
Author SHA1 Message Date
yetone cfe006ea0f library: a Codex plugin's manifest is read like a Claude Code one, and its hooks go to Codex (#7255)
A folder with .codex-plugin/plugin.json is a plugin now. Its skills and
mcpServers are read like Claude's manifest fields (Claude's win where both
name one). The hooks it names (a path, a list of paths or inline) are
Codex's own: kept as written as codex:<Event> hooks with their matcher and
given to Codex alone, so .codex/hooks.json gets them and Claude's settings
do not. An event Codex has none called (codexHookSpec's native list, from
codex-rs/hooks) is left out and said. A manifest's mcpServers naming
./.mcp.json no longer reads that file twice. Codex 0.165's binary names
.codex-plugin/plugin.json and resolves plugin.json#hooks; the shape matches
hooks/hooks.json.

Ported in outline from Arobotmaster's 874624ed, not its code: that commit
also changed session-start matchers and put env on script hooks, which are
other goals.

Run on mote: gofmt, go vet ./internal/library, go test ./internal/library
and ./internal/cli (whole packages, ok); new TestPluginCodexManifest (probe
counts, Codex gets the hooks, Claude gets none, remove takes them out).
Not tried: a real Codex plugin from a marketplace (Codex marketplaces are not
read), a plugin with both manifests naming different hooks, Codex actually
running the carried hooks.
2026-11-20 05:28:25 +08:00