The Ralph Loop is an agent execution pattern where a worker and a separate judge iterate against a user-defined completion condition until the condition is met, locking the agent on a target across turns.
The pattern decomposes into three roles. The worker is the main agent doing the task. The judge is a separate model call that reads the transcript after each turn and decides whether the stated completion condition has been satisfied. The loop is the harness that drives the next turn whenever the judge returns "not yet." Because the judge runs as a distinct inference rather than a self-grade by the worker, the pattern does not share the worker's confirmation bias on its own output, which is the structural reason it converges more reliably than a single self-graded run.
Ralph Loop is the execution substrate behind the wave of /goal commands shipped across agent platforms in spring 2026 — OpenAI's Codex first in late April, then 📝Claude Code's 📝/goal skill in version 2.1.139 on May 12, then 📝Hermes Agent's 📝/goal command in v0.13.0 — three independent products converging on the same primitive within roughly a month. Reliability across all three implementations depends on the same gating heuristics. Completion conditions must be measurable so the judge can evaluate them, scoped so the loop can converge in a tractable number of turns, and self-served so the worker can act without blocking on human input. Goals that violate any of those three tests degrade the loop into wasted turns and judge timeouts rather than convergence.
