How Adversarial-Review Enables Claude Code and Codex CLI to Collaborate on Code Review

The adversarial-review plugin creates an iterative convergence loop where Claude Code generates implementation plans and code while Codex CLI performs rigorous static analysis, returning structured JSON feedback that drives automated refinement until review criteria pass.

The adversarial-review plugin, hosted in the anthropics/claude-plugins-community repository, stitches together two AI-driven development agents into a self-correcting pipeline defined in its marketplace metadata. While the integration configuration resides in .claude-plugin/marketplace.json, the orchestration scripts that manage the dual-agent workflow live in the external bobby-beckmann/adversarial-review repository.

The Dual-Agent Architecture Behind Adversarial-Review

Planning-Review Convergence Loop

According to the anthropics/claude-plugins-community source code, the plugin defines a planning-review convergence loop detailed in .claude-plugin/marketplace.json at lines 387-388. Claude Code initiates the workflow by generating a change plan or implementing code directly. Codex CLI then receives these artefacts and executes a heavyweight, model-agnostic static analysis via OpenRouter models, returning structured findings. The loop repeats iteratively until Codex signals that all review criteria are satisfied.

Bidirectional Delegation via CC-Suite

The broader cc-suite infrastructure enables seamless hand-offs between the two agents. As implemented in .claude-plugin/marketplace.json (lines 3182-3184), Claude Code hooks into Codex-compatible AGENTS.md files, allowing commands like /cc-suite:audit, /cc-suite:review, /cc-suite:implement, /cc-suite:verify, /cc-suite:bug-analyze, and /cc-suite:review-plan to delegate work to Codex CLI. Results return to Claude's session state automatically, maintaining workflow continuity.

Structured Review Output and Safety Gating

Codex CLI supplies machine-readable assessments containing severity, confidence, and actionable recommendations in JSON format, as specified in .claude-plugin/marketplace.json (lines 2879-2881). Claude Code consumes this payload to update its internal plan and may invoke additional safety hooks—including cost-tracking per review—before committing changes. Because Codex acts as a skeptical reviewer, Claude must address concrete, evidence-backed criticisms rather than vague suggestions, significantly reducing false-positive feedback.

Persisting Collaboration State

The loop maintains state across sessions through the .claude/ directory, which stores plans, review artifacts, and cost accounting data. This persistence enables developers to resume multi-agent collaboration exactly where previous sessions ended, supporting long-running refactoring projects that require multiple adversarial iterations.

Implementing the Adversarial-Review Workflow

The following commands demonstrate the practical orchestration provided by the adversarial-review plugin, which internally manages the Claude ↔ Codex delegation lane.

First, initiate an adversarial review of the current worktree:

claude code review --adversarial

Generate a structured change plan with Claude:

claude code plan --target src/feature --output plan.json

Delegate the review to Codex CLI, which returns structured JSON feedback:

codex cli review --input plan.json --output review.json

Claude automatically consumes the review and updates the plan:

claude code apply-review --plan plan.json --review review.json

When Codex reports "no issues", the loop terminates and changes are ready for commit:

git commit -am "Implemented feature with adversarial review"

These thin wrapper commands trigger the heavy lifting inside the delegated loop, transparently managing the convergence process between the two agents.

Summary

  • Adversarial-review implements a dual-agent workflow where Claude Code generates plans and Codex CLI provides rigorous static analysis through an iterative convergence loop defined in .claude-plugin/marketplace.json.
  • The cc-suite infrastructure enables bidirectional delegation via commands like /cc-suite:review and /cc-suite:audit, mirroring Claude Code hooks into Codex-compatible AGENTS.md files.
  • Codex returns structured JSON output containing severity, confidence, and recommendations, which Claude consumes to refine implementations while tracking costs per review.
  • Collaboration state persists in the .claude/ directory, allowing sessions to resume across multiple adversarial iterations.
  • This architecture transforms two complementary LLM agents into a single, self-correcting code-review pipeline that reduces false positives through concrete, evidence-backed criticism.

Frequently Asked Questions

What is the adversarial-review plugin?

The adversarial-review plugin is an open-source integration hosted in the anthropics/claude-plugins-community repository that connects Claude Code with OpenAI Codex CLI to create an iterative code-review loop. It enables Claude to generate implementation plans while Codex acts as a skeptical reviewer, returning structured feedback that drives automated refinement until the code passes all criteria.

How does the bidirectional delegation between Claude Code and Codex CLI work?

The plugin leverages the cc-suite infrastructure to mirror Claude Code commands into Codex-compatible AGENTS.md files. Commands such as /cc-suite:audit, /cc-suite:implement, and /cc-suite:review hand work to Codex CLI and return structured results to Claude's session state, as defined in .claude-plugin/marketplace.json at lines 3182-3184.

What structured output does Codex CLI return during the review process?

Codex CLI returns machine-readable JSON containing severity levels, confidence scores, and actionable recommendations for each identified issue. This structured format, specified in .claude-plugin/marketplace.json (lines 2879-2881), includes cost tracking per review and enables Claude Code to programmatically update plans without manual parsing.

Where is the collaboration state stored between adversarial-review sessions?

The plugin persists loop state—including plans, review artifacts, and cost accounting—in the project's .claude/ directory. This storage mechanism allows developers to resume multi-agent collaboration across separate sessions, maintaining continuity for long-running refactoring tasks that require multiple review iterations.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →