From codex
Runs OpenAI Codex CLI non-interactively to execute tasks, generate code, or get structured output via sandboxed headless sessions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codex:codex_execThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Run OpenAI's Codex CLI non-interactively to execute tasks. This is the headless workhorse of Codex — it takes a prompt, runs it, and returns the result without an interactive TUI.
Run OpenAI's Codex CLI non-interactively to execute tasks. This is the headless workhorse of Codex — it takes a prompt, runs it, and returns the result without an interactive TUI.
codex exec "your prompt here" 2>/dev/null
Always append 2>/dev/null to suppress thinking tokens on stderr.
codex exec "Refactor the User model to add email validation" 2>/dev/null
echo "Review this function and suggest improvements:" | codex exec - 2>/dev/null
When stdin is piped and a prompt is also provided, stdin is appended as a <stdin> block:
cat some_file.py | codex exec "Review this code for security issues" 2>/dev/null
codex exec -i screenshot.png "What UI issues do you see?" 2>/dev/null
Control what Codex can do on the filesystem:
| Mode | Flag | Use case |
|---|---|---|
| Read-only | -s read-only | Safe analysis, review, questions |
| Workspace write | -s workspace-write | Code generation, file edits |
| Full access | -s danger-full-access | System-level tasks (use with caution) |
| Full auto | --full-auto | Shortcut for -s workspace-write with minimal approval prompts |
Default to read-only or workspace-write unless the user explicitly needs more.
Use --output-schema to get Codex to return JSON matching a schema:
codex exec "Analyze this codebase for security issues" \
--output-schema schema.json \
-o result.json \
2>/dev/null
Use --json to get all events as JSONL stream (useful for programmatic parsing):
codex exec "List all TODO comments" --json 2>/dev/null
Use -o <file> to save just the last message to a file:
codex exec "Summarize the recent changes" -o summary.txt 2>/dev/null
Continue a previous Codex session without the TUI:
codex exec resume --last 2>/dev/null
Or with a follow-up prompt:
echo "Now apply the fix you suggested" | codex exec --skip-git-repo-check resume --last 2>/dev/null
Override the default model:
codex exec -m o3 "your prompt" 2>/dev/null
Run Codex in a specific directory:
codex exec -C /path/to/project "your prompt" 2>/dev/null
codex exec -s read-only "Review the changes in the last commit. Are there any bugs or edge cases missed?" 2>/dev/null
codex exec --full-auto "Write unit tests for src/utils/parser.py and save them to tests/test_parser.py" 2>/dev/null
codex exec -s read-only "I believe this function has O(n log n) complexity. Verify my analysis: $(cat src/sort.py)" 2>/dev/null
codex exec can take 30-120+ seconds depending on the task. Use a 300s timeout for complex tasks.-o <file> to capture the last message rather than parsing stdout.--skip-git-repo-check.--ephemeral if you don't need the session persisted for later resume/fork.npx claudepluginhub ferrants/skill-codexDelegates coding tasks (debug, implement, refactor) to OpenAI Codex CLI via codex exec, skipping the Node companion runtime for faster execution. Codex writes code; Claude verifies.
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
Runs Codex CLI tasks with configurable model, reasoning effort, and sandbox mode. Handles session resume and stdin redirection to prevent hangs.