Source: Ralph Wiggum as a “Software Engineer” — Geoffrey Huntley, 2025
Summary
Ralph is not a tool but a technique: an infinite loop that feeds a prompt into an AI coding agent (while :; do cat PROMPT.md | claude-code ; done). Huntley uses it to build CURSED, a new programming language with zero prior training data, and argues that Ralph is effective enough to displace a large majority of software engineers for greenfield projects, though he personally would not use it in an existing codebase. The approach requires faith in eventual consistency: each failure is a tuning opportunity, and each defect is addressed by refining the prompt. There is no perfect prompt; prompts evolve through continuous observation and adjustment specific to each project.
The technique rests on several core principles. Architecture must be monolithic, a single process in one repo, because non-determinism in multi-agent communication creates chaos. Each loop iteration should tackle exactly one task, letting the agent decide what matters most. The context window must be loaded deterministically with the same project plans and specs every time. And the agent must be instructed to search the codebase before assuming something hasn’t been implemented, because ripgrep-based code search can lead the agent to incorrectly conclude that code does not exist. Huntley calls this non-determinism Ralph’s “Achilles’ heel.” Backpressure for correctness comes from the language’s type system and static analyzers, not from the generation step itself.
In practice, Ralph requires a detailed, prioritized TODO list that gets deleted and regenerated when the agent goes off track. The agent can update its own documentation when it discovers improvements and log bugs for future resolution. When the codebase breaks beyond repair, options range from git reset --hard to crafting rescue prompts. Huntley expects roughly 90% completion on greenfield projects, and an engineer he taught the technique to delivered a $50,000 contract for $297 in API costs. He is clear that senior engineering expertise is still essential for guiding the process. Anyone claiming engineers are no longer needed is, in his view, wrong.
Quotes
“Each time Ralph does something bad, Ralph gets tuned — like a guitar.”
“You need to ask Ralph to do one thing per loop. Only one thing.”
“Any problem created by AI can be resolved through a different series of prompts.”
“There is no such thing as a perfect prompt.”
“Anyone claiming that engineers are no longer required and a tool can do 100% of the work without an engineer is peddling horseshit.”
Notes
Huntley published Ralph in July 2025, about four months before Anthropic’s Effective Harnesses for Long-Running Agents. The core idea is the same: run an agent in a loop so each iteration gets a fresh context window instead of rotting in an old one. I wonder if Ralph inspired Anthropic’s approach or if they arrived at the loop independently. Either way, it seems like an obvious response once you hit context limits enough times.
Ralph is minimal on purpose: a bash loop, one prompt, and faith that things will converge. Anthropic adds more structure: an immutable feature list, a progress file, git history for context recovery, and a startup routine that rebuilds state before each session. Huntley says he wouldn’t use Ralph on anything but greenfield projects. Does Anthropic’s extra structure move the loop closer to working in existing codebases? Parts of it help: the feature list keeps the agent from wandering, and the progress file gives it a reliable starting point. But a large legacy codebase needs more than that. The agent has to understand architecture it didn’t build, follow conventions it didn’t choose, and avoid breaking things it doesn’t fully grasp. What would actually make a looped agent repeatable and safe in that kind of environment?