Back to blog
·4 min read·Coding Agents / Ralph / Workflow

Trying the Ralph method: when the loop is the whole strategy

Late 2025 into early 2026 I tried the Ralph Wiggum technique for autonomous agentic coding. What I expected, what surprised me, and where it actually delivers.

Trying the Ralph method: when the loop is the whole strategy

Sometime in December 2025 I started seeing posts about a technique called Ralph - or more specifically, "Ralph Wiggum" - making the rounds in agentic-coding circles. The name comes from the Simpsons character known for being deterministically stubborn. The technique, coined by Geoffrey Huntley, is built on the same idea. Run an AI agent in a bash loop with the same prompt every iteration, let the codebase change between iterations, and trust that the model will eventually grind through to completion.

I was skeptical. Then I tried it. Then I kept using it for two months.

The setup is embarrassingly simple

In its purest form Ralph is a while ! done; do ai_agent "$PROMPT"; done loop. You write a fixed prompt that tells the agent to read the current state of the repository, pick the most important task from a plan file, do that one thing, and exit. The bash loop restarts the agent immediately with a fresh context window. The plan file persists on disk between iterations and acts as the only state the agent carries forward.

This sounds dumb. The first time you set it up you feel like you've missed something. There's no clever scheduler. No multi-agent orchestration. No memory bank. Just a loop and a prompt that doesn't change.

The trick is that the codebase changes. The prompt is the same, but the repo on disk evolves with each iteration. The agent reads the new state, does one more thing, exits, and the loop runs again. After fifty or a hundred iterations the codebase looks completely different. The agent never had to keep track of its own progress because git and the plan file did the tracking for it.

What I tried it on

I ran Ralph on a few different projects across December 2025 and February 2026 - mostly internal tools where the spec was clear and the work was repetitive. Adding tests. Cleaning up technical debt. Migrating a config layer. Things where the right next move was obvious if you read the code.

The hardest part was learning to trust the loop. The first hour I kept jumping in to "fix" what the agent was doing. By the third hour I was running other tasks while Ralph chewed through items. By the next day I checked back to find a substantial chunk of work done, with commits that made sense and a plan file marked up with what was completed.

What surprises you

A few things I didn't expect:

The fresh-context advantage is real. Each iteration starts cold, with full cognitive headroom. I'd seen long agent sessions where the model gets noticeably worse over time as context accumulates. Ralph never has that problem because the context window resets every loop. The model is at peak performance every single iteration.

State externalization works. Instead of asking the model to remember what it did, you ask it to read git history and a plan file. Disk is more reliable than context. Every iteration the agent reads what's true now, not what it remembered from earlier.

The boring iterations are the productive ones. The middle of a Ralph run looks repetitive - same prompt, same tool calls, same patterns - and that's the point. The loop is supposed to be stubborn. Stubbornness is the feature.

Where it falls short

Ralph isn't magic. The failure modes are real:

If your plan file is bad, the loop converges to a bad solution. Ralph trusts the spec. Garbage in, more elaborate garbage out.

If the model frequently runs ripgrep or similar searches and concludes "this isn't implemented" when in fact it is, you can spin in circles. The fix is to add explicit instructions that tell Ralph not to make assumptions and to search exhaustively before deciding.

If the task requires creative architectural decisions, Ralph won't make them. The loop is good at executing a plan, not inventing one. Front-loading the design work into a real spec is how you avoid wasting iterations.

My take after two months

Ralph isn't a replacement for agentic coding. It's a mode you switch into when the work is well-specified and repetitive. For exploratory work, a regular interactive session still wins. For grinding through a TODO list of unambiguous tasks, Ralph is the most efficient pattern I've found.

The bigger lesson for me was about how to think about agentic systems. Most of the multi-agent orchestration ideas circulating in late 2025 were elaborate. Ralph is the opposite. It commits to one process, one repo, one prompt. The simplicity is what makes it work. I came out of it more skeptical of clever scheduling and more interested in patterns where the system stays small.

If you haven't tried it, the bar to entry is low. Write a plan file. Write a fixed prompt. Loop. Watch what happens.