codex-cli-rules
Installation
SKILL.md
When to Use
Use this skill when you are driving Codex CLI from a script or ralph loop and need to verify it actually ran (not just exited 0). Read it BEFORE writing any wrapper that pipes Codex output into a downstream step.
Tested with Codex CLI v0.118.0+, model gpt-5.4, model_reasoning_effort: xhigh. Older CLIs (<0.118) reject xhigh as unknown variant for model_reasoning_effort — pin a fallback.
Skip if you are using Codex interactively (the TUI), or just running it once by hand.
stdin vs argv
Highest-frequency footgun. Putting a long prompt into "$(cat prompt.md)" hits ARG_MAX (~1MB on modern macOS, ~256KB on POSIX-only systems) and either truncates or fails with argument list too long.
# ❌ Bad — diff over ~500 lines silently truncates or errors
codex exec -s read-only --ephemeral -o /tmp/out.md "$(cat /tmp/prompt.md)"
# ✅ Good — pipe via stdin, trailing `-` reads from stdin
cat /tmp/prompt.md | codex exec -s read-only --ephemeral -o /tmp/out.md -