// This skill should be used when the user asks to "use Codex", "ask Codex", "consult Codex", "Codex review", "use GPT for planning", "ask GPT to review", "get GPT's opinion", "what does GPT think", "second opinion on code", "consult the oracle", "ask the oracle", or mentions using an AI oracle for planning or code review. NOT for implementation tasks.
| name | oracle-codex |
| description | This skill should be used when the user asks to "use Codex", "ask Codex", "consult Codex", "Codex review", "use GPT for planning", "ask GPT to review", "get GPT's opinion", "what does GPT think", "second opinion on code", "consult the oracle", "ask the oracle", or mentions using an AI oracle for planning or code review. NOT for implementation tasks. |
Use OpenAI Codex CLI as a planning oracle and code reviewer. Codex provides analysis and recommendations; Claude synthesizes and presents to the user.
Critical: This skill is for planning and review ONLY. Never use Codex to implement changes.
Before invoking Codex, validate availability:
~/.claude/skills/oracle-codex/scripts/check-codex.sh
If the script exits non-zero, display the error message and stop. Do not proceed without Codex CLI.
| Setting | Default | User Override |
|---|---|---|
| Model | gpt-5.2 | "use model X" or "with gpt-5.2" |
| Reasoning | Dynamic (based on complexity) | "use medium reasoning" or "with xhigh effort" |
| Sandbox | read-only | Not overridable (safety constraint) |
| Timeout | 5 minutes minimum | Estimate based on task complexity |
| Profile | quiet (notify=[]) | User opts into another profile or notifications |
When invoking codex exec via the Bash tool, always set an appropriate timeout:
Select reasoning effort based on task complexity:
| Complexity | Effort | Examples |
|---|---|---|
| Simple | low | Single file review, syntax check, quick question |
| Moderate | medium | Multi-file review, focused feature planning, bug analysis |
| Complex | high | Architecture analysis, cross-cutting concerns, security audit |
| Maximum | xhigh | Large codebase planning, comprehensive design, deep reasoning |
Selection heuristics:
low: Task involves <3 files, simple question, or quick validationmedium: Task involves 3-10 files or requires moderate analysishigh: Task spans multiple modules or requires architectural thinkingxhigh: Task requires comprehensive codebase understanding or critical decisionsFor available models and reasoning levels, consult references/codex-flags.md.
Run the check script. On failure, report the installation instructions and abort.
Build a focused prompt for Codex based on mode:
Planning prompt template:
Analyze this codebase and provide a detailed implementation plan for: [user request]
Focus on:
- Architecture decisions and trade-offs
- Files to create or modify
- Implementation sequence
- Potential risks or blockers
Do NOT implement anything. Provide analysis and recommendations only.
Review prompt template:
Review the following code for:
- Bugs and logic errors
- Security vulnerabilities
- Performance issues
- Code quality and maintainability
- Adherence to best practices
[code or file paths]
Provide specific, actionable feedback with file locations and line references.
Before executing, assess task complexity to select appropriate reasoning effort:
Use HEREDOC syntax for safe prompt handling. Always use the Bash tool's timeout parameter (minimum 300000ms / 5 minutes).
Redirect output to a temp file to avoid context bloat:
# Select EFFORT based on complexity assessment (low/medium/high/xhigh)
# Bash tool timeout: 300000-900000ms based on complexity
codex exec \
-m "${MODEL:-gpt-5.2}" \
-c "model_reasoning_effort=${EFFORT}" \
--profile "${CODEX_PROFILE:-quiet}" \
-s read-only \
--skip-git-repo-check \
2>/dev/null <<'EOF' > /tmp/codex-analysis.txt
[constructed prompt]
EOF
Important flags:
-m: Model selection-c model_reasoning_effort=: Reasoning depth (low/medium/high/xhigh) — select based on Reasoning Effort Guidelines--profile quiet: Default for this skill (suppresses notify hooks); change only if the user explicitly wants another profile/notifications-s read-only: Prevents any file modifications (non-negotiable)--skip-git-repo-check: Works outside git repositories2>/dev/null: Suppresses thinking tokens from outputBash tool timeout: Estimate based on task complexity (see Timeout Guidelines above). Never use the default 2-minute timeout for Codex operations.
Read the analysis from the temp file and display to the user with clear attribution:
cat /tmp/codex-analysis.txt
Format the output with clear attribution:
## Codex Analysis
[Codex output from /tmp/codex-analysis.txt]
---
Model: gpt-5.2 | Reasoning: [selected effort level]
For very large outputs (>5000 lines), summarize key sections rather than displaying everything.
After presenting Codex output:
AskUserQuestion to clarify user preferences before finalizing the plan~/.claude/plans/[plan-name].mdExitPlanMode to present the plan for user approvalWhen to use AskUserQuestion:
Skip clarification when:
| Error | Response |
|---|---|
| Codex not installed | Show installation instructions from check script |
| Codex timeout | Inform user, suggest simpler query or lower reasoning |
| API rate limit | Wait and retry, or inform user of limit |
| Empty response | Retry once, then report failure |
User: "Ask Codex to plan how to add authentication to this app"
high reasoninggpt-5.2 and high~/.claude/plans/ and call ExitPlanModeUser: "Have Codex review the changes in src/auth/"
src/auth/ directorymedium reasoningmediumreferences/codex-flags.md - Complete model and flag documentationscripts/check-codex.sh - Prerequisite validation (run before any Codex command)