claudex — Adversarial Claude+Codex Plan Review Loop
A Claude Code plugin that pressure-tests a plan before any code is written: Claude writes PLAN.md, Codex adversarially reviews it from three different reviewer angles in rotation, and a Stop hook drives the draft-critique-revise cycle autonomously in one terminal window until the plan survives review or a round cap is reached.
Implementation note
Plan-mode only writes PLAN.md and .claude/claudex/ state files — does not touch source code (a separate review mode for code diffs is read-only in v1, no auto-apply). Stop hook is fail-open on every error (explicit ERR trap) so a broken loop can't trap the session; includes concurrent-loop detection and a 15-minute stale-loop sweep. Requires a ChatGPT Plus/Pro/Team/Enterprise account since Codex authenticates against it — a cross-vendor cost/dependency worth calling out to users evaluating it.
Source: promptadvisers/claudex ↗
More planning loops
loop-init, loop-audit, loop-cost CLI patterns
Three starter CLI tools that turn loop design into a repeatable workflow: scaffold a loop with a goal, budget, and verify step; audit an existing loop design; and estimate cost before you run.
Ralph the PRD backlog
The canonical Ralph loop: each iteration starts fresh, reads the PRD and guardrails, ships exactly one backlog item end-to-end, and records what it learned.
Set agent continuation budget
Configure max turns before agent stops, preventing runaway loops and controlling execution cost.