adversarial-review — плагин для Claude Code: ревью через Codex
Гоняет план или код между Claude и OpenAI Codex CLI, пока Codex не скажет APPROVED. Пригодится перед крупной правкой.
/plugin marketplace add anthropics/claude-plugins-community
/plugin install adversarial-review@claude-communityЧто делает adversarial-review
Плагин добавляет в Claude две слэш-команды. /adversarial-plan <task description> — это планирование до начала работы: Claude разбирает кодовую базу и пишет план, Codex смотрит на него как придирчивый senior-инженер и ищет настоящие баги, а не теоретические придирки. Claude правит план по замечаниям, и так до одобрения или до 20 итераций. Перед тем как писать код, цикл останавливается и ждёт вашего согласия.
/adversarial-review работает после реализации: берёт текущий git diff, отправляет его Codex на проверку ошибок, безопасности и корректности, а Claude сам чинит критичное. Тоже до APPROVED или 20 итераций. Codex завершает каждый разбор пометкой APPROVED или NEEDS_REVISION.
Без codex exec в PATH ничего не запустится: нужен установленный и настроенный OpenAI Codex CLI. Ещё понадобится сам Claude CLI. Каждый прогон складывает файлы в .adversarial-review/ в корне проекта — итерации плана, ревью и финальный план; прошлые сессии остаются, так что папку стоит добавить в .gitignore. Лимит итераций, тексты промптов и таймаут CODEX_REVIEW_TIMEOUT (по умолчанию 1200 секунд) правятся в commands/ и scripts/codex-review.sh.
Какие задачи решает
- проверить план до того, как написан код
- получить второе мнение по git diff от другой модели
- найти ошибки и дыры в безопасности в свежих изменениях
- сойтись на плане за несколько итераций вместо долгих споров
- сохранить историю ревью по каждой сессии
Примеры запросов агенту
- Составь план миграции на новую схему БД через
/adversarial-plan - Прогони
/adversarial-reviewпо текущим изменениям в git - Запусти
/adversarial-planдля рефакторинга модуля авторизации
Как установить adversarial-review
Через маркетплейс плагинов
/plugin marketplace add anthropics/claude-plugins-community/plugin install adversarial-review@claude-communityПо шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой
Вопросы о adversarial-review
Как установить adversarial-review в Claude Code?
Сначала добавьте маркетплейс: /plugin marketplace add anthropics/claude-plugins-community, затем поставьте плагин: /plugin install adversarial-review@claude-community. После этого команды доступны во всех проектах.
Что делает adversarial-review?
Организует цикл спора между Claude и OpenAI Codex CLI. Claude пишет план или код, Codex критикует, Claude правит — и так до одобрения.
Что нужно для работы плагина?
Установленный Claude CLI и OpenAI Codex CLI в PATH, чтобы работала команда codex exec. Без неё цикл ревью не стартует.
Исходный текст
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