codex-compat
Installation
SKILL.md
Codex supports Claude-style SessionStart, SubagentStart, PreToolUse, PermissionRequest, PostToolUse, PreCompact, PostCompact, UserPromptSubmit, SubagentStop, and Stop hooks. Claude-only events (FileChanged, WorktreeCreate, SessionEnd, PostToolUseFailure) use a safe Stop-batch fallback or are dropped. Tool matchers cover Bash, MCP, apply_patch, and Edit|Write; map edit hooks direct when possible. Use /read-the-damn-docs for current behavior and /plan-arbiter for ambiguous mappings.
Creates
.codex/hooks.json: supported direct hooks..codex/hooks/codex-batch-check.sh: fallback-only checks..codex/rules/frontend-skills.rules: execpolicy floor.- Root
AGENTS.md+CLAUDE.md: shared rules. - compatibility matrix:
direct|direct with shim|fallback only|unsupported.
Steps
- Classify every
.claude/settings.jsonhook with REFERENCE.md. - Generate
.codex/hooks.json: lifecycle events direct; Bash/Edit|Write/apply_patch/mcp__.*pre/post direct; PermissionRequest direct only when scripts accept Codex payloads; omit/document unsafe unsupported cases. - Copy
scripts/codex-batch-check.shonly when fallback is required; make executable. - Copy
hooks/frontend-skills.rulesto.codex/rules/. - Generate AGENTS/CLAUDE from the reference template.
- Set
[features] hooks = trueinconfig.toml; run/hooksand trust definitions again after changes. CI uses managed hooks or--dangerously-bypass-hook-trust. Optionalnotify = ["bash", "<repo>/.claude/hooks/codex-notify.sh"].