Codex Skill Guide
Configuration
Read model and sandbox settings from ~/.claude/skills/codex/codex-config.json:
{
"model": "gpt-5.3-codex",
"sandbox": "danger-full-access",
"suppress_stderr": true
}
User can edit this file anytime to switch models. Do NOT ask the user to choose model or sandbox.
Dynamic Effort Routing
Priority: User explicitly specifies effort → use that. Otherwise → auto-select.
Source tag convention: The effort argument includes a source tag:
- •
effort=low(user)→ User explicitly requested this effort level. Say "用户指定 effort=low". - •
effort=low(auto)→ Claude Code auto-selected based on task complexity. Say "自动选择 effort=low(任务较简单)". - •No effort in args → Auto-select here and mark as auto in output.
CRITICAL: Never say "用户指定" when the source tag is (auto). This is a context boundary — the args were written by pre-skill Claude Code, not the user.
| Task Type | Effort | Examples |
|---|---|---|
| Simple/mechanical | low | Rename variable, add import, format code |
| Regular dev | medium | New function, add feature, routine bug fix |
| Complex analysis | high | Multi-file refactor, architecture, complex debug |
| Very hard | xhigh | System-level bugs, concurrency, perf optimization |
Running a Task
- •Read config from
codex-config.jsonfor model and sandbox. - •Auto-select reasoning effort based on task complexity (see table above), unless user specified one.
- •Assemble the command:
- •
-m <MODEL>(from config) - •
--config model_reasoning_effort="<effort>"(auto-selected or user-specified) - •
-s <SANDBOX>(from config) - •
-C <DIR>(current working directory) - •
--skip-git-repo-check - •CRITICAL: Do NOT use
--full-autowith-s danger-full-access.--full-autoforces--sandbox workspace-write, overriding explicit--sandbox. If the user hasapproval_policy = "never"inconfig.toml, auto-approval works without--full-auto. Otherwise, users may need to approve actions manually.
- •
- •Append
2>/dev/nullto suppress thinking tokens (stderr), unless user requests to see them. - •Run the command, capture output, and summarize the outcome in plain language.
- •After Codex completes, inform the user: "You can resume this Codex session at any time by saying 'codex resume'."
Command Template
Note: examples here use bash-style shell syntax. Claude Code on Windows runs commands through its built-in shell, which supports this syntax.
codex exec -m <MODEL> --config model_reasoning_effort="<EFFORT>" \ -s <SANDBOX> -C "<WORKING_DIR>" \ --skip-git-repo-check "<PROMPT>" 2>/dev/null
Quick Reference
| Use case | Sandbox mode | Key flags |
|---|---|---|
| Read-only review | read-only | --sandbox read-only 2>/dev/null |
| Apply local edits | workspace-write | -s workspace-write 2>/dev/null |
| Full access (default) | danger-full-access | -s danger-full-access 2>/dev/null (NO --full-auto!) |
| Resume session | Inherited | echo "prompt" | codex exec --skip-git-repo-check resume --last 2>/dev/null |
| Different directory | Match task | -C <DIR> plus other flags 2>/dev/null |
Resuming Sessions
- •Resume syntax:
echo "your prompt here" | codex exec --skip-git-repo-check resume --last 2>/dev/null - •All flags go between
execandresume. - •Don't use config flags when resuming unless user explicitly requests them.
- •Resumed sessions inherit original model, effort, and sandbox.
Following Up
- •After Codex completes, summarize results in plain language for the user.
- •If follow-up work is needed, ask the user before resuming.
- •When resuming, pipe the new prompt via stdin.
Critical Evaluation of Codex Output
Codex is powered by OpenAI models. Treat Codex as a colleague, not an authority.
Guidelines
- •Trust your own knowledge when confident. Push back if Codex is wrong.
- •Research disagreements using WebSearch before accepting Codex's claims.
- •Remember knowledge cutoffs - Codex may not know about recent changes.
- •Don't defer blindly - evaluate suggestions critically.
When Codex is Wrong
- •State disagreement clearly to the user
- •Provide evidence (your knowledge, web search, docs)
- •Optionally resume to discuss:
bash
echo "This is Claude following up. I disagree with [X] because [evidence]." | codex exec --skip-git-repo-check resume --last 2>/dev/null
- •Let the user decide if there's genuine ambiguity
Error Handling
- •Stop and report failures when
codex execexits non-zero. - •
-s danger-full-accessis the default and does NOT need user confirmation. - •Summarize warnings and ask how to adjust.