Codex tool names differ from Claude Code — verify with a debug hook
Porting a multi-event hook system from one CLI agent to another and discovering the matcher schema is incompatible.
Built a multi-event hook system for codex CLI (SessionStart, PostToolUse, PreToolUse, Stop) by porting matchers verbatim from a Claude Code reference (Bash, Edit, Write, Read, Grep, Glob, MultiEdit, NotebookEdit). The non-matcher events (SessionStart, Stop, UserPromptSubmit) worked perfectly — the model received and acted on the injected context. The matcher-based events (PostToolUse, PreToolUse) silently never fired because codex 0.128 uses different tool names (likely shell or local_shell, not Bash; apply_patch is correct but Edit/Write/Read are not codex tools at all). Symptom: state file never appeared even after many tool calls. Fix: register a wildcard debug hook first that logs every event as JSON, run a one-shot codex command, read the log to learn the actual tool names, then write the matcher.
Before porting any hook matchers between agent systems, register a no-op debug-logging hook with no matcher to capture the real tool-name strings. The CLI docs say the matcher is regex on tool name but do not enumerate which strings appear — you have to observe.