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.
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.
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.
One prompt, infinite respawns. The agent forgets; the files remember.
Run it yourself
Stripped to its essence, the original technique is one line of shell. This is the whole idea:
# 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:
- 1
prd.json— the specA checklist of features. The loop runs until every item is marked complete. This is your steering wheel.
- 2
CLAUDE.md/prompt.md— the one prompt"Read the PRD, pick the next unfinished item, implement it, test it, mark it done." The same prompt, every single pass.
- 3
progress.txt— the memoryAppend-only learnings. Since each instance starts blank, this is how turn N+1 knows what turn N discovered.
- 4
ralph.sh— the loop./ralph.sh [max_iterations]spawns fresh agent instances back-to-back. Caps iterations so a runaway can't burn forever.
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.
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.
Sources
- repo snarktank/ralph Ryan Carson's runnable version: ralph.sh + prd.json + progress.txt.
- primary Geoffrey Huntley — "Ralph Wiggum as a software engineer" The original idea: one prompt, an infinite loop, surprisingly far.
- reading Geoffrey Huntley — specs / "you are using Claude Code wrong" Why a spec folder + a loop beats hand-holding the agent.