← Agentic coding The loop · Technique

Ralph

The dumbest agentic technique that actually works: take one prompt, run it against your codebase, and then do it again. And again. In a loop. Until there's nothing left on the list.

01

What it is

Ralph is a technique, not a tool. Geoffrey Huntley named it after Ralph Wiggum — cheerful, not clever, but he never stops. You hand a coding agent a spec and a single instruction ("pick the next unfinished thing and do it"), then wrap it in a shell loop. Each turn the agent reads the plan, makes one slice of progress, writes down what it learned, and exits. The loop immediately starts it again with a fresh context window.

Ryan Carson's snarktank/ralph is a runnable version of exactly this: a bash script plus a few plain files. No framework.

02

The loop

Every pass is a clean instance — no memory of the last turn except what's written to disk. That's the whole trick: state lives in files, not in the conversation.

prd.json the work list
fresh agent empty context
do one item edit + test
write notes progress.txt
tick the item prd.json
list not empty → respawn
✓ done list empty → stop

One prompt, infinite respawns. The agent forgets; the files remember.

03

Run it yourself

Stripped to its essence, the original technique is one line of shell. This is the whole idea:

the-whole-thing.sh
# the boulder never stops
while :; do
  cat prompt.md | claude -p "--dangerously-skip-permissions"
done

Carson's repo wraps that with guardrails. The four files that matter:

04

Why it works — and where it bites

Why it works

A fresh context every turn means no compounding confusion — the agent never drowns in its own backscroll. Small bounded tasks are where models are strongest. And progress is durable: kill it, restart it, it picks up from the files. Cheap to start, surprisingly far.

Where it bites

It's "deterministically bad" — it will confidently do the wrong thing in a loop if your spec is vague. It burns tokens like a furnace. Without an iteration cap and tests as guardrails, it can thrash. Ralph is a chainsaw: powerful, and happy to take your leg.

05

How I actually use it

My take

I don't point Ralph at "build the app." I point it at a tight, well-specced PRD I've already argued through (that's what the planning passes are for), with a real test command as the guardrail. Then the loop is just stamina — it grinds the boring middle while I'm away. The phrase that follows me around my whole setup — "the boulder never stops" — comes straight from here.

06

Sources