Loop 019
The Clodex adversarial-review loop
A bounded development workflow that plans and ships a pull request, runs an independent Codex adversarial review, fixes blocking findings, and repeats.
Ready-to-use prompt
Copy the loop
Run /clodex [task] think hard --max-iter 5 --threshold medium. Plan the task, implement it, ship a pull request, run the Codex adversarial-review code path, fix every finding above the configured threshold, and repeat. Persist the plan, branch, pull request, findings, verdict, and iteration state so the run can resume safely. Remember that threshold names the highest acceptable severity. Stop when Codex approves, only sub-threshold findings remain, or max-iter is reached. Never report a stalled, errored, or exhausted run as approved.
Verify / stop
The pull request reaches the configured review bar.
Codex approves, only explicitly acceptable findings remain, or the final report truthfully discloses that the iteration cap or an error stopped the loop.
Context and guidance When to use it, steps, safety notes, and related loops
Use this when
Use this for a meaningful code change that benefits from an independent reviewer and may need several structured review-and-fix rounds.
How to run it
- Choose the task, thinking level, maximum iterations, and highest acceptable finding severity.
- Plan, implement, verify, and ship the pull request through the Clodex workflow.
- Run the Codex adversarial review, fix every blocking finding, commit and push, then review again.
- Persist state across rounds and finish with the verdict, remaining findings, checks, and pull-request link.
Why it works
Clodex separates the builder from the reviewer and turns review feedback into a bounded repair loop. Persisted state makes the work resumable without pretending an interrupted run was approved.
Implementation note
The threshold is a ceiling for acceptable findings, not a minimum severity to inspect. Use the strict approve setting for security-sensitive or production-critical changes.