Home→Glossary→Ralph Loop

Ralph Loop

Ralph Loop

A named pattern: a fresh Claude Code instance per iteration, memory carried by git and a progress file, not a continuous conversation

✓ Runtime & Session
Talk to AY Automate ↗
Fresh context per iterationMemory via git + progress fileNamed pattern, real pluginOne task per iteration, fully done

What is a Ralph Loop

Ralph Loop, also called the Ralph Wiggum Loop, is a named autonomous-coding pattern originated by Geoffrey Huntley in July 2025. It is now an official Anthropic-listed plugin. The mechanism is specific: a fresh Claude Code instance runs each iteration with a clean context window, reads a PRD or progress file to see what's left, picks the single highest-priority incomplete task, and implements it fully, no stubs, no partial attempts left for later.

Each iteration then runs tests and type-checks against its own change, updates the progress file to reflect what just got done, and commits. The next iteration starts as a genuinely new instance with an empty context window, not a continuation of the same conversation. What makes this pattern coherent rather than amnesiac is where memory actually lives: not in a persisted conversation, but in git history, the progress file, and updates to AGENTS.md, which future iterations read automatically at the start of their own clean run.

This is a stronger claim than an ordinary loop makes. A generic loop can reuse the same context across iterations if it wants to, Ralph Loop specifically does not, on purpose. The clean-slate discipline is what prevents a long-running autonomous build from accumulating the noise, half-finished threads, and context rot that a single, ever-growing session eventually runs into. The tradeoff is that anything not captured in git, the progress file, or AGENTS.md is genuinely gone by the next iteration, which is why those three artifacts carry real weight in this pattern.

One Ralph Loop iteration, start to commit

The context window resets every iteration. What survives to the next one is not conversation history, it's git history, the progress file, and AGENTS.md, read fresh by the next clean instance.

AY Automate

Build your own agent skills, not just prompts.

We design, build, and ship the Claude Code skill libraries production teams actually run on.

Talk to AY Automate ↗

Key properties

✓Each iteration is a genuinely new instance, not a continued conversation
✓Picks the single highest-priority incomplete task, implements it fully, no stubs
✓Memory persists across iterations through git history, a progress file, and AGENTS.md

Compare

Ralph Loopvs Loop →