Skip to content

RalphAutonomousCodingLoop

Dennis Lee edited this page Sep 14, 2026 · 1 revision

title: Ralph (Autonomous Coding Loop) radar_quadrant: Techniques radar_ring: Assess radar_position: inner

Ralph (Autonomous Coding Loop)

Ralph is a named technique, originated by Geoff Huntley, for running an AI coding agent unattended over many iterations by deliberately clearing its context between each one and relying on files on disk, rather than conversation memory, to carry state forward.

Radar Assessment

Long unattended coding runs face a common failure mode: an agent's context window fills with its own accumulated exploration and mistakes, and quality degrades the longer a single continuous session runs. Ralph's answer is to stop trying to keep one long-lived session coherent and instead run many short, fresh ones. Each iteration starts with a clean context, reads the same fixed prompt and an AGENTS.md operating-notes file, does one unit of work, commits it, and ends -- with all memory of what has been done living in files (a plan document, specs, git history) rather than in the model's own context.

The ralph-playbook, a community-written operational guide to the technique, organizes it into three phases and two prompts sharing one loop mechanism. Phase one is a human-and-LLM conversation that breaks a project into Jobs to Be Done and writes a specification file per topic. Phases two and three reuse the identical loop machinery with different prompts: a PLANNING prompt that compares specs against existing code and writes a prioritized IMPLEMENTATION_PLAN.md with no code changes, and a BUILDING prompt that picks the next task from that plan, implements it, runs tests as a check against regressions, updates the plan and operating notes with what it learned, and commits, before the loop clears context and starts the next iteration fresh.

The technique is deliberately simple to the point of looking naive: a fixed prompt run in a loop, backed only by the discipline of writing everything that matters to disk. Its author's own framing, referenced in the playbook, cautions against over-engineering it further. It relates to two techniques already on this radar covering similar ground: Scaling Long-Running Autonomous Coding, which addresses the same context-degradation problem through checkpointing and sub-agent decomposition rather than full context resets, and Loop Engineering, a more general treatment of building autonomous discover-execute-verify loops. Ralph is a specific, named instance of that same family, with strong recent community attention: the playbook alone has passed 1,000 GitHub stars.

There is no first-person production use of this technique in this radar owner's own work yet, so it sits at Assess.

References

Clone this wiki locally