This skill should be used when the user asks to "consult Codex", "ask Codex for advice", "get implementation suggestions from Codex", "codexに相談", "codexにきいて", "実装方針を相談", "アーキテクチャをcodexに聞く", or needs deeper analysis using OpenAI's Codex model for complex implementation decisions, architecture design, or code review that benefits from extended reasoning.
This skill enables consultation with OpenAI's Codex CLI for deeper implementation analysis. Codex uses more powerful reasoning models (gpt-5.2-codex) that can provide thorough architectural guidance and implementation plans.
When to use:
Provides analysis and implementation planning without code changes.
Output includes:
Provides analysis with concrete code change suggestions in unified diff format.
Output includes:
| Argument | Description | Default |
|---|---|---|
| Task description | Required. What to analyze or plan | - |
--model=<model> | Model to use | gpt-5.2-codex |
--mode=plan|patch | Execution mode | plan |
--scope=<path> | Target directory | current repo root |
--no-web | Disable web search | web enabled by default |
To consult Codex for implementation planning:
Execute the wrapper script with task description:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh "Implement user authentication with JWT"
Read the output from /tmp/codex-consult.last.md
If output is empty or error occurs, check /tmp/codex-consult.run.log
To get concrete code change suggestions:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh --mode=patch "Refactor the database connection to use connection pooling"
To use a different model:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh --model=o4-mini "Design the caching layer"
To analyze a specific directory:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh --scope=/path/to/src "Review error handling patterns"
To run without web search:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh --no-web "Analyze this legacy code"
--scope explicitly: Use --scope=$(pwd) or --scope=/absolute/path/to/project to ensure Codex analyzes the correct project context. This is especially important in multi-repository environments.When working in directories that contain multiple git repositories (e.g., nested subprojects or monorepos), Codex may analyze the wrong project context if --scope is not explicitly specified.
Problem scenario:
/home/user/projects/
├── main-project/
│ └── submodules/
│ └── other-repo/ ← Codex may analyze this instead
└── .git/
Solution: Always use explicit --scope parameter:
# From any directory, specify the target project explicitly
bash ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh --scope=/home/user/projects/main-project "Analyze the codebase"
# Or use $(pwd) to ensure current directory is used
bash ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh --scope=$(pwd) "Analyze the codebase"
Codex CLI may encounter timeout failures (exit code 144) in the following scenarios:
Recommendations:
--scope to limit the analysis scope/tmp/codex-consult.run.log for timeout-related errorsIf Codex execution fails:
/tmp/codex-consult.run.log for error detailscodex login)references/codex-cli-reference.md - Codex CLI commands and optionsreferences/output-format.md - Output format specificationexamples/sample-consultation.md - Sample consultation outputs