Agent skill
codex-cli
Invoke OpenAI Codex CLI for second-opinion code review, approach validation, and task verification. Use when you need cross-AI validation, a fresh perspective on implementation, or automated code review. Takes 1-10 minutes per request.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/codex-cli-alexandrbasis-wythm-claude-workflo
SKILL.md
Codex CLI Integration Skill
This skill enables Claude Code to invoke OpenAI Codex CLI (gpt-5.3-codex with high reasoning) for one-shot code review, approach validation, and cross-AI verification.
When to Use This Skill
Ideal Use Cases
-
Second Opinion / Cross-Validation
- Verify your implementation approach before writing code
- Get a different AI perspective on your solution
- Validate architectural decisions
-
Code Review
- Review uncommitted changes before commit
- Review changes against a base branch before PR
- Security-focused code review
-
Task Verification
- Confirm implementation meets requirements
- Validate that refactoring preserved behavior
- Check for missed edge cases
-
Approach Validation
- Before starting complex implementation
- When choosing between multiple approaches
- For architectural decisions
When NOT to Use
- Simple, quick tasks (overhead not worth 1-10 min wait)
- Tasks requiring interactive conversation/refinement
- When immediate response is critical
- Trivial changes (typos, formatting)
Core Commands
Approach Validation
codex exec "Review this approach: [description]. Is it sound? What are the tradeoffs?" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1 && echo "Codex completed"
# Then: Read tool /tmp/codex-result.md
Code Review - Uncommitted Changes
codex exec review --uncommitted -m gpt-5.3-codex --full-auto > /tmp/codex-review.md 2>&1
# Then: Read tool /tmp/codex-review.md
Code Review - Against Branch
codex exec review --base main -m gpt-5.3-codex --full-auto > /tmp/codex-review.md 2>&1
# Then: Read tool /tmp/codex-review.md
Custom Analysis
codex exec "[prompt]" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1 && echo "Codex completed"
# Then: Read tool /tmp/codex-result.md
Important Notes
-
One-Shot Only: Codex runs non-interactively. No follow-up questions possible.
-
Takes Time: Expect 1-10 minutes depending on complexity. Use
run_in_backgroundfor long tasks. -
Model: Always use
-m gpt-5.3-codexfor explicit model selection. -
Full Auto:
--full-autoenables workspace-write sandbox with auto-approval. -
Output File: Use
-o /tmp/codex-result.mdto capture just the final response. -
CRITICAL - Token Optimization: Always redirect stdout to
/dev/nulland read from file. See "Output Handling" below.
Output Handling Best Practice
Why this matters: Without optimization, Bash returns ~4700+ tokens of verbose output (reasoning steps, tool calls, MCP logs). With optimization, you get ~30 tokens + clean file read.
For codex exec (custom prompts)
# Run with output file + suppress verbose stdout
codex exec "prompt" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1 && echo "Codex completed"
Then read result with Read tool (not cat): /tmp/codex-result.md
For codex exec review (no -o flag support)
# Redirect all output to file
codex exec review --uncommitted -m gpt-5.3-codex --full-auto > /tmp/codex-review.md 2>&1
Then read result with Read tool: /tmp/codex-review.md
Workflow
- Run codex command with output redirection
- Read result file with Read tool (not Bash cat)
- Summarize findings to user
Critical: Provide File Paths in Prompts
Codex has NO context from Claude Code conversation. Always include explicit file paths in your prompts:
For Task Review
codex exec "Review the task specification at tasks/task-2026-01-09-feature/tech-decomposition.md
Is the implementation plan complete? Any gaps or risks?" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1
# Read: /tmp/codex-result.md
For Code Review with Context
codex exec "Review implementation in these files:
- backend/src/application/sessions/use-cases/create-session.use-case.ts
- backend/src/infrastructure/web/dto/sessions/create-session.dto.ts
Check against requirements in: tasks/task-2026-01-09-feature/tech-decomposition.md" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1
# Read: /tmp/codex-result.md
For Approach Validation
codex exec "I'm implementing the feature described in tasks/task-2026-01-09-feature/tech-decomposition.md
My approach:
1. [Step 1]
2. [Step 2]
Is this aligned with the requirements?" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1
# Read: /tmp/codex-result.md
Best Practice
Always include:
- Task file path - so Codex knows the requirements
- Implementation file paths - so Codex knows what to review
- Directory path - for broader context (e.g.,
backend/src/application/sessions/)
Background Execution Pattern
For tasks that take longer, run in background:
# Run in background using Bash tool with run_in_background=true
codex exec "[complex prompt]" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1 && echo "Codex completed"
Then read result with Read tool: /tmp/codex-result.md
Example Workflows
Pre-Implementation Validation
codex exec "I'm about to implement [feature] using [approach].
Review this plan:
1. [Step 1]
2. [Step 2]
3. [Step 3]
Is this approach sound? What issues might I encounter?" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1
# Read: /tmp/codex-result.md
Security Review
# Built-in review command (redirect to file)
codex exec review --uncommitted -m gpt-5.3-codex --full-auto > /tmp/codex-review.md 2>&1
# Read: /tmp/codex-review.md
# Or with custom focus:
codex exec "Review the uncommitted changes for security vulnerabilities including XSS, injection, auth issues" -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1
# Read: /tmp/codex-result.md
Cross-AI Verification
codex exec "I implemented [feature]. The key files are:
- path/to/file1.ts
- path/to/file2.ts
Verify the implementation is correct and complete." -m gpt-5.3-codex --full-auto -o /tmp/codex-result.md > /dev/null 2>&1
## What's New in Codex CLI 0.96.0
Highlights from the latest CLI release:
- `unified_exec` enabled on non-Windows platforms for smoother exec flows.
- Websocket rate-limit signaling via the new `codex.rate_limits` event.
- `thread/compact` available in the v2 app-server API with async behavior and status tracking.
Source: https://developers.openai.com/codex/changelog
# Read: /tmp/codex-result.md
See Also
templates.md- Prompt templates for common operationsreference.md- Complete command and flag reference
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?