Anatomy of /goal loops: a Ralph loop plus a verifier judge, doable in ~20 lines with Agents SDK

RobertTLange · x · 2026-11-28

RobertTLange breaks down how /goal loops in Codex, Claude Code and Pi work: it's just a Ralph loop plus a verifier judge. The goal is persisted and re-read every turn, a worker acts (edit code, run checks), then the harness runs a judge/verifier agent against the target and feeds failure reasons back into the next turn until met or abandoned via token budget/iteration caps. The bare Ralph loop simply reuses the same prompt every turn. He shows the whole mechanism can be built in 20 lines with the OpenAI Agents SDK, with sample worker/auditor agent code.

Original post →

More from coding & agent

coding & agent channel →