Loop 019
The Clodex adversarial-review loop
A Claude-and-Codex workflow that opens a pull request, runs an independent Codex review, fixes blocking findings, and repeats.
Ready-to-use prompt
Copy the loop
Run /clodex [task] think hard --max-iter 5 --threshold medium. Claude plans the task, implements it, opens a pull request, asks Codex for an adversarial review, fixes findings above the accepted severity, and repeats. Keep the branch, PR, findings, verdict, and iteration state resumable. Stop when Codex approves, only accepted findings remain, progress stalls, or the iteration cap is reached. Never describe an errored or exhausted run as approved. Finish with the PR, checks, verdict, and remaining findings.
Verify / stop
The pull request reaches the configured review bar.
Codex approves it or only explicitly accepted findings remain; errors, stalls, and exhausted limits are reported as such.
Context and guidanceWhen to use it, steps, safety notes, and related loops
Use this when
Use Clodex when Claude is building a meaningful code change and Codex should independently review each repair round.
How to run it
- Choose the task, thinking level, maximum iterations, and highest acceptable finding severity.
- Have Claude plan, implement, verify, and open the pull request through Clodex.
- Run the Codex adversarial review, fix blocking findings, push, and review again.
- Persist state across rounds and finish with the verdict, remaining findings, checks, and pull-request link.
Why it works
Clodex separates the Claude builder from the Codex reviewer and turns review feedback into a bounded repair loop. Persisted state keeps the work resumable without treating an interruption as approval.
Implementation note
The source implementation uses Clodex with Codex as the adversarial reviewer. Treat the severity threshold as a ceiling for acceptable findings, not a minimum severity to inspect.