Teach Claude Code how to invoke OpenAI's Codex CLI for advanced code analysis, refactoring, and automated editing.
A Claude Code skill that enables Claude to leverage OpenAI Codex CLI's advanced reasoning models for code reviews, refactoring, security audits, architecture analysis, and automated transformations.
This filesystem-based skill automatically activates when you mention Codex-related tasks. Simply ask Claude to review or refactor your code, and it will:
- Select optimal model (
gpt-5.2vsgpt-5.2-codex) and reasoning effort - Execute Codex CLI with appropriate parameters and sandbox settings
- Handle session resume, error recovery, and multi-step workflows
- Summarize results and suggest next steps
Before installing this skill:
- Codex CLI installed: The
codexcommand must be available on yourPATH - Codex configured: Valid credentials in
~/.codex/config.toml - Verify installation: Run
codex --versionto confirm setup
If you don't have Codex installed, see the Codex CLI documentation.
Clone and copy the skill to your .claude/skills directory:
Personal Installation (all projects):
# Unix/Linux/macOS
git clone --depth 1 https://github.com/sypsyp97/claude-skill-codex.git /tmp/codex-skill && \
mkdir -p ~/.claude/skills && cp -r /tmp/codex-skill/.claude/skills/codex ~/.claude/skills/codex && \
rm -rf /tmp/codex-skill
# Windows (PowerShell)
git clone --depth 1 https://github.com/sypsyp97/claude-skill-codex.git $env:TEMP\codex-skill; `
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude\skills"; `
Copy-Item -Recurse -Force "$env:TEMP\codex-skill\.claude\skills\codex" "$env:USERPROFILE\.claude\skills\codex"; `
Remove-Item -Recurse -Force "$env:TEMP\codex-skill"Project-Specific Installation:
# Unix/Linux/macOS
git clone --depth 1 https://github.com/sypsyp97/claude-skill-codex.git /tmp/codex-skill && \
mkdir -p .claude/skills && cp -r /tmp/codex-skill/.claude/skills/codex .claude/skills/codex && \
rm -rf /tmp/codex-skill
# Windows (PowerShell)
git clone --depth 1 https://github.com/sypsyp97/claude-skill-codex.git $env:TEMP\codex-skill; `
New-Item -ItemType Directory -Force -Path ".claude\skills"; `
Copy-Item -Recurse -Force "$env:TEMP\codex-skill\.claude\skills\codex" ".claude\skills\codex"; `
Remove-Item -Recurse -Force "$env:TEMP\codex-skill"Verify: Check that ~/.claude/skills/codex/SKILL.md or .claude/skills/codex/SKILL.md exists. Claude Code will automatically discover it.
Simply mention Codex in your conversation with Claude Code:
Review my Python code for security issues using codex
Use codex to refactor this module to async/await
Analyze the architecture of this codebase with codex
Resume the last codex session and apply the suggested changesClaude will automatically activate the skill, ask for preferences (model and reasoning effort), and execute the appropriate command.
Example:
codex exec -m gpt-5-codex \
--config model_reasoning_effort="high" \
--sandbox read-only \
--full-auto \
"Analyze this repository..." 2>/dev/nullNote: Thinking tokens (stderr) are suppressed by default. To see them for debugging, ask: "Show me the thinking tokens from codex"
| Task Type | Recommended Model | Reasoning Effort |
|---|---|---|
| Quick syntax fixes | gpt-5.2 |
minimal |
| Code review | gpt-5.2 |
medium |
| Refactoring | gpt-5.2-codex |
medium |
| Architecture analysis | gpt-5.2 |
high |
| Security audit | gpt-5.2 |
high |
| Algorithm optimization | gpt-5.2-codex |
high |
| Documentation generation | gpt-5.2 |
low |
- read-only: Analysis and documentation (default)
- workspace-write: Code modifications and file creation
- danger-full-access: System operations (rarely needed)
For complete details including workflows, CLI reference, error handling, and best practices, see SKILL.md.
- SKILL.md - Complete documentation with workflows and CLI reference
- GitHub Issues - Report bugs or request features
- Claude Code Skills - How skills work
- Codex CLI Reference - Codex documentation
Contributions welcome! Fork the repository, edit .claude/skills/codex/SKILL.md, test locally, and submit a pull request.
See LICENSE for details.
Inspired by skills-directory/skill-codex with extensive enhancements for production use, including comprehensive CLI documentation, multi-platform support, workflow orchestration, advanced error handling, and detailed troubleshooting guides.
