adversarial-review — Claude Code plugin: Codex review loops
Runs your plan or diff past OpenAI Codex CLI until it approves. Useful before a big change lands.
/plugin marketplace add anthropics/claude-plugins-community
/plugin install adversarial-review@claude-communityWhat adversarial-review does
The plugin adds two slash commands to Claude. /adversarial-plan <task description> handles planning before any code exists: Claude reads the codebase and drafts an implementation plan, then Codex critiques it the way a pragmatic senior engineer would, hunting real bugs instead of theoretical nitpicks. Claude revises, and the loop repeats until Codex approves or hits 20 iterations. Before code gets written, it stops and asks for your go-ahead.
/adversarial-review covers the other end: it grabs your current git diff, sends it to Codex for a pass over bugs, security and correctness, and Claude fixes critical findings on its own. Same stopping rule — approval or 20 rounds. Every review ends with APPROVED or NEEDS_REVISION.
Nothing runs without codex exec on your PATH, so the OpenAI Codex CLI has to be installed and working; Claude CLI is the other requirement. Each run writes into .adversarial-review/ at the project root — plan iterations, reviews, the final plan — and old sessions stay put, so adding that folder to .gitignore is wise. Iteration count, review prompts and the CODEX_REVIEW_TIMEOUT bound (1200 seconds by default) live in commands/ and scripts/codex-review.sh.
What it helps with
- stress-test a plan before writing any code
- get a second model's read on your git diff
- catch bugs and security holes in fresh changes
- converge on a plan in a few rounds instead of long debates
- keep a record of every review session
Example prompts for the agent
- Draft a database migration plan with
/adversarial-plan - Run
/adversarial-reviewon my current git changes - Use
/adversarial-planto plan the auth module refactor
How to install adversarial-review
Plugin marketplace
/plugin marketplace add anthropics/claude-plugins-community/plugin install adversarial-review@claude-communityStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about adversarial-review
How do I install adversarial-review in Claude Code?
Add the marketplace first: /plugin marketplace add anthropics/claude-plugins-community. Then install the plugin: /plugin install adversarial-review@claude-community. The commands become available in every project.
What does adversarial-review do?
It sets up a critique loop between Claude and OpenAI Codex CLI. Claude writes a plan or code, Codex pushes back, Claude revises, and this repeats until approval.
What do I need for it to work?
Claude CLI plus OpenAI Codex CLI on your PATH, with codex exec working. Without that command the review loop never starts.
Source text
SKILL.md · MIT
# Adversarial Review
A Claude Code plugin that orchestrates adversarial review loops between **Claude Code** and **OpenAI Codex CLI**. Claude writes plans and code; Codex tears them apart. They iterate until convergence.
## How It Works
This plugin adds two slash commands to Claude Code:
### `/adversarial-plan <task description>`
Pre-implementation planning with adversarial critique.
1. Claude analyzes your codebase and writes a detailed implementation plan
2. Codex reviews the plan as a pragmatic senior engineer — looking for real bugs, not theoretical nitpicks
3. Claude revises based on feedback
4. Loop continues until Codex approves (or 20 iterations max)
5. Pauses for your approval before any code is written
### `/adversarial-review`
Post-implementation code review on your current git changes.
1. Captures your git diff
2. Codex reviews for bugs, security issues, and correctness problems
3. Claude autonomously fixes any critical issues found
4. Loop continues until Codex approves (or 20 iterations max)
## Prerequisites
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI installed and configured
- [OpenAI Codex CLI](https://github.com/openai/codex) installed and on your PATH (`codex exec` must work)
## Installation
Add the marketplace and install the plugin in Claude Code:
```
/plugin marketplace add bobby-beckmann/adversarial-review
/plugin install adversarial-review@adversarial-review
```
The `/adversarial-plan` and `/adversarial-review` commands will be available in all projects.
## Updating
```
/plugin update adversarial-review@adversarial-review
```
## Convergence Protocol
Codex ends every review with one of:
- **`APPROVED`** — no blocking issues, work is acceptable
- **`NEEDS_REVISION`** — blocking issues that must be addressed
Reviews are calibrated to be pragmatic. A simple script doesn't get the same scrutiny as a payment system. Convergence typically happens in 2-3 iterations.
## Artifacts
Each run creates a unique session directory under `.adversarial-review/` in your project root:
```
.adversarial-review/
latest -> abcd-efgh-ijkl/ # symlink to most recent session
abcd-efgh-ijkl/
plan_v1.md, plan_v2.md, ... # plan iterations
review_v1.md, review_v2.md, ... # Codex reviews of each plan
plan_final.md # converged final plan
mnop-qrst-uvwx/
diff_for_review.md # code changes sent for review
code_review_v1.md, ... # Codex code review rounds
```
Previous sessions are preserved. You may want to add `.adversarial-review/` to your `.gitignore`.
## Customization
- **Iteration limit**: Edit the commands in `commands/` to change from the default 20
- **Review prompts**: Customize what Codex evaluates by editing `scripts/codex-review.sh`
- **Review timeout**: `CODEX_REVIEW_TIMEOUT` (seconds, default 1200) bounds each Codex run when `timeout` or `gtimeout` is installed. The script closes stdin for `codex exec`, which otherwise waits for EOF when launched from an agent tool shell and never starts.
- **Review stance**: The prompts are tuned for pragmatic review — modify them if you want stricter or more lenient feedback
## License
MIT
© bobby-beckmann · MIT · bobby-beckmann/adversarial-review