Skip to content

Patterns

Pattern: clodex-adversarial-review

A real maker–checker pair, not one pass grading itself: Claude implements and fixes a PR, a genuinely separate adversarial reviewer (Codex, or a…

A real maker–checker pair, not one pass grading itself: Claude implements and fixes a PR, a genuinely separate adversarial reviewer (Codex, or a subagent standing in for it) checks it against a severity threshold, and the two iterate up to 5 rounds. Its sharpest rule: an iteration-cap exit with open findings is reported as exhausted, never as approved — this course's own "green ≠ done," independently arrived at.

Quick facts

FieldValue
CategoryB · PR & review
Heartbeatevent (PR)
Cadenceper PR
LevelL1 (report-only, drafts-not-pushes)
CostMedium
GroupB — Forward Future Loop Library

The six parts

PartThis kit
Heartbeatevent — a PR opened or updated fires a beat; up to 5 iterations per PR
Bodyreads the PR diff; runs an adversarial review; for findings at or above threshold, drafts a fix in a throwaway worktree; writes only clodex-review-report.md, its own state file, and the run log
Spineclodex-adversarial-review-state.md — per-PR iteration count, findings history, verdict; resumable
Stopping conditionthe source's own, verbatim: "Codex approves, only accepted findings remain, progress stalls, or the iteration cap is reached"
Checkerthe adversarial reviewer is the checker by design — a genuinely separate pass, never the maker grading itself
Human gateyou read the verdict and findings and apply the drafted fixes to the real PR yourself

The three valid stops

  • Success — the reviewer approves, or only accepted findings remain — the source's own spec, verbatim.
  • Limit — 5 iterations or 400k tokens.
  • No progress — 2 consecutive iterations with the same findings unresolved → escalate the disagreement to the human, don't keep iterating.

Source: Loop #9, "The Clodex adversarial-review loop," from Forward Future's Loop Library, original prompt by Lukas Kucinski. Full attribution: resources/sources.md.