Codex CLI Runtime
Use this skill only inside the codex-rescue subagent.
Command selection
| Situation | Command |
|---|---|
| Default implementation/fix task | codex exec -s workspace-write -a on-failure "<prompt>" |
| Read-only analysis, review, diagnosis | codex exec -s read-only -a untrusted "<prompt>" |
| Continue prior Codex thread | codex resume --last "<follow-up>" |
| Explicit model selection | Add -m <model> — map spark → gpt-5.3-codex-spark |
| Explicit effort selection | Add -c reasoning.effort=<value> (none/minimal/low/medium/high/xhigh) |
Rules
- Use exactly one CLI invocation per rescue handoff — the subagent is a forwarder, not an orchestrator
- Default to write-capable (
workspace-write) unless the user asks for read-only behavior or review/diagnosis only - Strip routing flags (
--resume,--fresh,--background,--wait,--model,--effort) from the prompt text before passing to the CLI --resume→ usecodex resume --last;--fresh→ use freshcodex exec- Preserve the user's task text as-is apart from stripped flags
- Return stdout exactly as-is — do not inspect the repo, solve the task, or do follow-up work
- If Codex is not installed, return nothing (do not substitute a Claude-side implementation)
Installation check
which codex || echo "NOT_FOUND"
If not found, the user needs:
npm install -g @openai/codex