codex
Scannednpx machina-cli add skill addsalt1t/evoca/codex --openclawCodex CLI Skill
Models
| Model | ID | Use When |
|---|---|---|
| Default | gpt-5.3-codex | Accuracy & depth: complex refactoring, architecture, multi-file changes, debugging |
| Sub (Spark) | gpt-5.3-codex-spark | Speed & iteration: quick fixes, simple reviews, formatting, single-file edits, rapid prototyping |
Running a Task
-
Read defaults: Read
defaults.json(in skill base directory) using Read tool.- Defaults exist → proceed. Print:
[Codex] model: <MODEL> | reasoning: <LEVEL> | sandbox: <MODE> | background: <BOOL> - Missing/invalid → ask user via
AskUserQuestion.
- Defaults exist → proceed. Print:
-
Select model (in priority order):
- Explicit model name in user message → use exactly as given.
- Spark keyword ("spark", "fast", "quick") → use
sub_model. - Auto-select:
modelfor complex tasks,sub_modelfor simple tasks. - No signal → use
model.
-
Assemble command:
codex exec [PROMPT] -m <MODEL> -c model_reasoning_effort="<LEVEL>" -s <SANDBOX> -o /tmp/codex_output.md 2>/tmp/codex_stderr.log- Sandbox: analysis →
-s read-only. editing →-s workspace-write.danger-full-accessrequires user confirmation. - CRITICAL:
-crequires fullkey=valuesyntax. Never-c xhigh. -i <FILE>and-o <FILE>must come after[PROMPT].
- Sandbox: analysis →
-
Execute:
- Background (default):
run_in_background: true→TaskOutputblock: false(startup check) →TaskOutputblock: true. - Foreground:
timeout: 300000. - On error: Read
/tmp/codex_stderr.logfor diagnosis.
- Background (default):
-
Read results: Read
/tmp/codex_output.md(final message only). If more detail is needed → read/tmp/codex_stderr.log. -
Summarize outcome. Inform user they can continue with "codex resume".
Changing Defaults
When user says "codex config", "change codex settings", or "change codex defaults":
- Show current
defaults.json. - Ask via
AskUserQuestionwhich settings to change. - Write updated values to
defaults.jsonin skill base directory.
Error Handling
- Non-zero exit: stop and report, ask before retrying.
- Before
-s danger-full-access: confirm with user viaAskUserQuestion.
/codex-review Command
Uses native codex exec review. Only triggered when user explicitly types /codex-review. Does not support -o or -s.
Usage
/codex-review → current branch vs base
/codex-review <SHA> → specific commit
/codex-review --base main → against main branch
/codex-review --uncommitted → all local changes
Flow
- Read defaults. Print:
[Codex Review] model: <MODEL> | reasoning: <LEVEL> - Select model:
sub_model(spark) by default.modelonly if user requests deep review. - Assemble:
codex exec review [OPTIONS] -m <MODEL> -c model_reasoning_effort="<LEVEL>" 2>/tmp/codex_stderr.log--commit <SHA>cannot be combined with[PROMPT].
- Execute: Same as main skill.
- Read results via Bash:
tail -n 50 /tmp/codex_stderr.log. If cut off, increase to-n 100or more. - Summarize findings. Inform user they can continue with "codex resume".
References
- Commands, flags, models: references/commands.md
- Sessions, MCP, Cloud, config: references/management.md
Source
git clone https://github.com/addsalt1t/evoca/blob/main/plugins/codex/skills/codex/SKILL.mdView on GitHub Overview
Codex is a skill that runs the Codex CLI to analyze, refactor, or automate edits on code. It supports session management, MCP server configuration, and settings changes via codex config and the dedicated /codex-review flow. It uses defaults.json to tailor model choice and sandbox modes before executing Codex tasks.
How This Skill Works
The skill starts by reading defaults.json to determine the model and sandbox settings. It then selects a model (explicitly named, Spark for fast tasks, or auto) and assembles the codex exec command with -m, -c, and -s options. Finally it executes in foreground or background, writes results to /tmp/codex_output.md and diagnostics to /tmp/codex_stderr.log, and presents a summary to the user, who can resume with codex resume.
When to Use It
- When you want to run Codex CLI to analyze code with codex exec review or other Codex operations.
- When you need automated edits or refactoring on a codebase using Codex CLI.
- When configuring Codex defaults or changing codex settings via codex config.
- When performing a codex-review on a specific commit, base branch, or uncommitted changes.
- When you need to resume a previously started Codex task using codex resume.
Quick Start
- Step 1: Read defaults.json in the skill base directory with the Read tool.
- Step 2: Choose a model (explicit, Spark for speed, or auto) and assemble the codex exec command.
- Step 3: Run the task (foreground or background) and inspect /tmp/codex_output.md; review /tmp/codex_stderr.log if needed.
Best Practices
- Always read defaults.json first to choose the right model and sandbox.
- Let explicit model names or Spark keywords drive model selection for speed vs. depth.
- Use read-only sandbox (-s read-only) for analysis; workspace-write for edits.
- Ensure -c uses key=value syntax and avoid dangerous forms like -c xhigh.
- Check /tmp/codex_output.md for results and /tmp/codex_stderr.log for errors; resume with codex resume if needed.
Example Use Cases
- Run a quick Codex review on a single file to surface issues without changing code.
- Execute a full multi-file refactor to improve architecture and readability.
- Configure Codex defaults to set a preferred model and sandbox for ongoing work.
- Use /codex-review to compare the current feature branch against main.
- Pause a long Codex task and resume later with codex resume.