codex

AI peer review via OpenAI Codex CLI. Use when reviewing code changes, validating technical decisions, comparing implementation approaches, or getting a second opinion on architecture choices. Triggers on /codex, /codex-review, or auto-triggers when presenting significant alternatives to user.

Best use case

codex is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

AI peer review via OpenAI Codex CLI. Use when reviewing code changes, validating technical decisions, comparing implementation approaches, or getting a second opinion on architecture choices. Triggers on /codex, /codex-review, or auto-triggers when presenting significant alternatives to user.

Teams using codex should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/codex/SKILL.md --create-dirs "https://raw.githubusercontent.com/antoniocascais/claude-code-toolkit/main/skills/codex/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/codex/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How codex Compares

Feature / AgentcodexStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

AI peer review via OpenAI Codex CLI. Use when reviewing code changes, validating technical decisions, comparing implementation approaches, or getting a second opinion on architecture choices. Triggers on /codex, /codex-review, or auto-triggers when presenting significant alternatives to user.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Codex Peer Review

Consult OpenAI's Codex CLI for peer review before presenting significant decisions or completed work to user.

## When to Auto-Trigger (Without Explicit /codex)

Auto-consult Codex when about to:
- Present 2+ alternative approaches to solve a problem
- Complete a significant feature implementation
- Propose architectural decisions
- Suggest refactoring strategies
- Present trade-off analysis

**Skip auto-consultation for:**
- Trivial fixes (typos, formatting, simple one-liners)
- Direct user instructions with no ambiguity
- Information lookups / explanations
- When user explicitly said "just do X"

## Codex CLI Reference

### Code Review (Scoped)
```bash
# Review uncommitted changes (staged + unstaged + untracked)
codex exec review --uncommitted "Focus on: <specific concerns>"

# Review against base branch
codex exec review --base main "Focus on: <specific concerns>"

# Review specific commit
codex exec review --commit <SHA> "Focus on: <specific concerns>"
```

### Freeform Consultation
```bash
# Tech decisions, architecture questions, approach validation
codex exec "Given context X, should we use approach A or B? Consider: <factors>"
```

### Prompt Crafting
Claude decides how to prompt Codex. Guidelines:
- Be specific about what feedback you want
- Provide relevant context (file names, constraints, goals)
- For code review: mention what changed and why
- For decisions: frame the trade-offs clearly

## Review Loop Protocol

### Max Iterations: 3

Execute up to 3 rounds of Claude ↔ Codex exchange:

1. **Round 1**: Initial consultation
   - Send context + question/code to Codex
   - Receive Codex's feedback

2. **Round 2** (if disagreement): Counter-argument
   - If Claude disagrees with Codex's assessment, argue back
   - Provide reasoning for disagreement
   - Ask Codex to reconsider or clarify

3. **Round 3** (if still unresolved): Final exchange
   - Last attempt at consensus
   - If still disagreeing, note the impasse

### Disagreement Handling

**Do NOT blindly accept Codex feedback.** Evaluate critically:
- Does the suggestion align with project conventions?
- Is the concern valid given the specific context?
- Would the change actually improve the code/decision?

If Claude disagrees:
```bash
codex exec "You suggested X, but I disagree because Y. The context you may have missed: Z. Please reconsider or explain why X is still better."
```

### Iteration Limit Reached

If 3 rounds pass without consensus, notify user:
```
⚠️ Codex review: Reached iteration limit without consensus

**Point of contention**: [what we disagreed on]
**Claude's position**: [your stance + reasoning]
**Codex's position**: [their stance + reasoning]

Proceeding with: [which approach and why]
```

## Output Format

After consultation completes, summarize for user:

```markdown
## Codex Review Summary

**Consulted on**: [code changes | tech decision | architecture]

**Consensus reached**: Yes/No (N rounds)

### Key Points
- [Agreement 1]
- [Agreement 2]

### Disagreements (if any)
| Topic | Claude | Codex | Resolution |
|-------|--------|-------|------------|
| ... | ... | ... | ... |

### Final Decision
[What was decided and brief rationale]
```

## Invocation Modes

### Explicit: `/codex` or `/codex-review`
User explicitly requests peer review. Always execute full loop.

### Auto-trigger
When about to present alternatives or complete significant work:
1. Pause before responding to user
2. Run Codex consultation
3. Incorporate feedback (or note disagreement)
4. Then present to user with review summary

## Examples

### Code Review (Uncommitted Changes)
```bash
codex exec review --uncommitted "Review this authentication refactor. Key changes: moved from session-based to JWT. Check for security issues and edge cases."
```

### Architecture Decision
```bash
codex exec "Building a real-time notification system. Options: A) WebSockets with Redis pub/sub, B) Server-Sent Events with PostgreSQL NOTIFY, C) Polling with caching. Constraints: <1000 concurrent users, existing PostgreSQL infra, team familiar with Redis. Which approach and why?"
```

### Validating Trade-offs
```bash
codex exec "User asked for feature X. I'm proposing to implement it via Y because of Z. Are there approaches I'm missing? Any concerns with Y?"
```

Related Skills

workflow-review

5
from antoniocascais/claude-code-toolkit

Reviews Claude Code sessions and proposes workflow improvements. Use when: (1) /workflow-review command, (2) "review my workflow", "how can I improve", (3) after long sessions when nudged, (4) start of session with pending review. Analyzes tool usage patterns, CLAUDE.md configuration, and compares against CC best practices. Proposes: CLAUDE.md updates, new skills, underused CC features. Saves session summaries to .claude/workflow-reviews/ for cross-session continuity.

voice-mode

5
from antoniocascais/claude-code-toolkit

Activates voice conversation mode using Pocket TTS Docker container. Use when user says "voice mode", "let's talk", "talk to me", "speak your responses", or wants Claude to respond with spoken audio. Speaks all responses through TTS and plays via speakers.

test-quality

5
from antoniocascais/claude-code-toolkit

Guides strong, effective unit test generation using proven testing techniques. Use when writing unit tests, reviewing test quality, improving existing tests, generating test cases, checking test coverage strength, or when tests exist but may be weak. Triggers on: unit test, test quality, test coverage, write tests, improve tests, review tests, test strength, mutation testing, boundary testing.

pr-review

5
from antoniocascais/claude-code-toolkit

Reviews code changes before merging. Use when reviewing PRs, checking staged changes, reviewing diffs, code review, merge readiness check, or validating changes before commit/push.

latex-presentation

5
from antoniocascais/claude-code-toolkit

Creates impressive LaTeX Beamer presentations with modern design. Generates .tex files with theme selection, font pairing, TikZ diagrams, overlays, and best practices. Use for LaTeX slides, Beamer presentations, scaffolding decks, slide design advice, or TikZ diagram generation.

git-commit

5
from antoniocascais/claude-code-toolkit

Plans and executes git commits with optional TICKET_ID prefix. Analyzes staged changes, proposes optimal commit structure (single or multiple), generates descriptive messages with technical context, and executes after user approval. Use when committing code changes, creating atomic commits, or splitting large changesets.

ctask

5
from antoniocascais/claude-code-toolkit

Manages tasks using the ctask CLI wrapper over a local SQLite database. Use when tracking work items, creating tasks, managing dependencies, adding comments, labeling, or reviewing task status. Triggers on task tracking, ticket management, work planning, backlog management.

codemap

5
from antoniocascais/claude-code-toolkit

Generate navigational codebase maps with architecture diagrams. Use when mapping a codebase, creating architecture docs, visualizing project structure, generating infrastructure diagrams, understanding repo layout, or onboarding to a new project.

clarice

5
from antoniocascais/claude-code-toolkit

Conducts realistic mock interviews with detailed feedback and scoring. Use for interview prep, behavioral questions, technical interviews, STAR practice, system design interviews, or interview coaching.

c7

5
from antoniocascais/claude-code-toolkit

Fetches up-to-date library documentation from Context7 and saves to /tmp/context7/. Use when needing current API docs, code examples, library references, SDK documentation, or checking latest library versions. Triggers: context7, c7, library docs, fetch docs, current documentation, api reference.

Ralph Codex — OpenClaw Plugin

8
from joelhooks/openclaw-codex-ralph

Autonomous AI coding loops using Codex CLI. Spawn fresh AI sessions for each task, validate with tests, commit on success, repeat until done. 26 tools.

codex

8
from adampaulwalker/codex-claude-skill

Review code changes, implementation plans, or specific files using OpenAI Codex CLI. Triggers on "review", "check", "validate", "codex". Perfect for maker-checker workflows where you want a second AI agent to review Claude's work before committing. Requires the Codex CLI to be installed (brew install codex-cli or from https://codex.storage.googleapis.com).