What is “loop engineering?” - by Gergely Orosz
The Pragmatic Engineer
SubscribeSign in
Deepdives<br>What is “loop engineering?”<br>There’s talk about loop engineering, but what is it exactly? I looked into it, and found triggers, cron jobs, AI slop & more. Is it a “here today, gone tomorrow” trend?
Gergely Orosz<br>Jul 14, 2026<br>∙ Paid
164
Share
“Loop engineering” has become a trending topic in the past month, after some high-profile folks at Anthropic and OpenAI revealed that they have stopped writing prompts, and started designing loops. At Anthropic’s developer conference, Boris Cherny, creator of Claude Code, said (emphasis mine):<br>“I don’t prompt Claude anymore. I have loops running that prompt Claude and figuring out what to do. My job is to write loops. ”
Soon after, Peter Steinberger, creator of OpenClaw, preached loop design in a post:
Source: Peter Steinberger<br>Elsewhere, Addy Osmani, formerly of Google, wrote an article, ‘Loop Engineering’:<br>“Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead.”
That’s three mentions in quick succession of this new approach, which is a novel one and therefore pretty abstract to me. To find out more, I turned online to some of the folks who read these articles. In replies, you told me what “loop engineering” means to you and gave some examples of loops in your work.<br>Today, we cover:<br>Where it began: “Ralph Wiggum” loop. A year ago, software engineer Geoffrey Huntley shared how he builds “loops.” In December, the approach went viral and “Ralph loops” were born.
The /goal command ships in all major harnesses. By May this year, the major AI coding harnesses added support to run a loop from a single prompt, using the /goal command.
Loops which devs use: triggers and cron jobs. I asked devs how they use loops. Most use cases involve responding to events or running scheduled jobs. They are useful, but don’t feel like brand new workflows.
Helpful loops for devs. Open PRs for newly-recorded app issues, have notes ready when an oncall joins an outage Slack channel, “babysitting” and fixing nightly end-to-end tests, and more.
Disappointment and “tokenmaxxing” . Several devs reject looping after trying it. Agents drifting, and the “human in the loop” having better results are some reasons. Also, at companies that pay API prices for tokens, loop engineering gets expensive fast.
Was looping a hack while tooling caught up? Distinguished engineer Max Kanat-Alexander believes the “loop” might have just been a temporary hack while the harnesses added the ability to do the same from a single prompt.
Does “context engineering” matter more for devs? Except for engineers building AI infra, there seems little benefit in going deep into loop engineering. Instead, becoming familiar with AI context windows – also part of building loops – could be more useful.
1. Where it began: “Ralph Wiggum” loop
Exactly a year ago, software engineer Geoffrey Huntley published the article ‘Ralph Wiggum as a software engineer’. The name references the naive son of the local police chief in The Simpsons, who is extremely eager to always be helpful. In engineering, “Ralph” is intended to continuously nudge the agent in the right direction. Geoff described it:<br>“Ralph is a technique. In its purest form, Ralph is a Bash loop:<br>while :; do cat PROMPT.md | claude-code ; done<br>Ralph can replace the majority of outsourcing at most companies for greenfield projects. It has defects, but these are identifiable and resolvable through various styles of prompts.<br>That’s the beauty of Ralph - the technique is deterministically bad in a nondeterministic world.”
The article expands on the idea of the Ralph loop:<br>Start the agent with a prompt that captures the task and defines a goal
Create a plan of work, each item with a success criteria
Start the loop:<br>Take one item per loop
When the agent is done, check if the goal is achieved
If not: start the agent again, with a clear context window<br>Start loops if needed: spawn subagents as and when necessary
Geoff published the experiments he did with this approach, such as building a new programming language last summer, and said it requires skill:<br>“Engineers are still needed. There is no way this is possible without senior expertise guiding Ralph. Anyone claiming that engineers are no longer required and a tool can do 100% of the work without an engineer is peddling horses***.”
The “Ralph method” blew up late last year with the arrival of better models which were surprisingly capable of building ambitious projects. Software engineer Matt Pocock created a tutorial, ‘Ship working code while you sleep’ with the Ralph Wiggum technique. He said:<br>“One of the dreams of coding agents is that you can wake up in the morning to working code, where your coding agent has worked through your backlog. It has spit out a whole bunch of code for you to review, and it works.”
Before the Ralph loop, Matt did this in two...