A Claude Code skill for running OpenAI's Codex CLI non-interactively from within Claude Code sessions. Useful for getting a second opinion from a differently-trained model, automated code generation, and code reviews.
Codex CLI (codex exec) runs OpenAI models in a sandboxed, non-interactive mode. This skill gives Claude Code the knowledge to invoke it correctly, with sensible defaults for model selection, sandbox mode, and output handling. It enables multi-model workflows where Claude can delegate tasks to Codex or use it for adversarial review.
- Codex CLI installed and on
PATH(installation guide) - OpenAI API key configured for Codex
- Claude Code installed and working
/codex-exec [prompt or options]
Claude will run Codex with these defaults unless told otherwise:
codex exec --full-auto -m gpt-5.3-codex -c model_reasoning_effort=high "your prompt"| Mode | Flag | Description |
|---|---|---|
| Full auto | --full-auto |
Sandboxed automatic execution (default) |
| Read-only | -s read-only |
No write access |
| Workspace write | -s workspace-write |
Can write to workspace |
| Full access | -s danger-full-access |
Full system access |
| Flag | Description |
|---|---|
--json |
JSONL event stream to stdout |
-o <file> |
Write final message to file |
--output-schema <file> |
Structured output via JSON Schema |
codex exec review --base main # Review against main branch
codex exec review --uncommitted # Review staged/unstaged changes
codex exec review --commit <SHA> # Review a specific commitcodex exec resume --last "follow-up prompt"
codex exec resume <SESSION_ID> "follow-up prompt"When using --json, events are emitted as JSONL:
| Event | Description |
|---|---|
thread.started |
Session begins |
turn.started |
Agent turn begins |
item.completed |
Reasoning, message, or tool call completed |
turn.completed |
Turn finished with usage stats |
turn.failed |
Turn failed with error |
- Requires a separate OpenAI API key (not included with Claude Code)
- Codex CLI must be installed independently
--full-autouses workspace-write sandbox — files outside the workspace are not writable--dangerously-bypass-approvals-and-sandboxshould only be used in already-sandboxed environments- Running outside a git repo requires
--skip-git-repo-check
MIT