
One agent does the work. A second agent grades it. Loop engineering is designing that cycle.
A prompt gives an ai agent one instruction. Loop engineering gives it a goal, and a system that keeps trying until the goal is actually met. In June 2026, this idea reorganized how a large part of the AI community talks about working with agents. This guide explains loop engineering in plain terms, where it came from, and why the grading agent, not the working agent, is the part that actually matters most.
The short answerLoop engineering means designing a system where one agent does a task and a second agent grades the result against a goal, then the pair keeps retrying automatically until the work actually passes. Instead of you typing each instruction, you define what “done” means once, and the loop handles the rest. The idea took off in June 2026 through Peter Steinberger, Addy Osmani, and Anthropic’s Boris Cherny.
1.What is loop engineering?
A normal prompt gives an ai agent one instruction and gets one answer back. You read it, then you type the next thing. Loop engineering replaces that with a small system. First, you define a goal, such as “make every test pass” or “fix this bug without breaking anything else.” Then, the loop takes over. It runs the agent, checks the result, and decides whether to stop or try again.
In short, the skill shifts from writing the perfect instruction to designing a reliable cycle. Essentially, you are no longer the one prompting the agent turn by turn.
2.Where the idea came from
The term crystallized in a single week in June 2026. First, developer Peter Steinberger posted that people should stop prompting coding agents by hand and start designing the loops that prompt them instead. His post reportedly crossed millions of views within days. The next day, Google engineering lead Addy Osmani published an essay that named the practice loop engineering and gave it real structure.
Around the same time, Boris Cherny, who leads Claude Code at Anthropic, described his own workflow the same way: he no longer prompts Claude directly. Instead, he writes the loops that prompt Claude for him.
Loop engineering, broken into seven working parts.
3.The two-agent core: generator and verifier
At its center, a loop needs exactly two roles. The generator is the agent that actually does the work: writing code, drafting a document, or fixing an error. The verifier is a separate agent that checks that work against your goal.
This pairing is not new in concept. Anthropic described a version of it back in December 2024 as the evaluator-optimizer pattern. What changed in 2026 is the models themselves. They finally became reliable enough to run this cycle for minutes or hours. Nobody needs to check every round by hand anymore.
4.Why the verifier is the real bottleneck
Here is the part most explainers skip. The generator is rarely the weak link. It can produce work cheaply and endlessly. The verifier is what actually decides whether that work ships, gets retried, or gets rejected outright.
Consequently, a loop with a strong generator and a weak verifier is genuinely dangerous. It will confidently ship bad work, again and again, with nobody watching closely enough to notice. Writing a verifier that cannot be fooled is the actual engineering work here. It needs to check against real tests, real rules, or a real stated goal. Everything else is scaffolding around that one decision.
5.The technique that came before the name
Loop engineering did not appear from nowhere. Earlier in 2026, engineer Geoffrey Huntley described running a coding agent inside a plain while-loop. He fed it the same prompt against a written spec. It picked one task, implemented it, then started fresh and repeated. He named the technique Ralph, after the Simpsons character, because it is deterministically simple in an unpredictable world. Ralph proved the underlying idea worked before anyone had a name for the broader practice.
6.The building blocks of a working loop
Beyond the generator and verifier, a few pieces separate a working loop from one that spins uselessly. A clear goal and stop condition tell the loop when it is genuinely finished, not just when it claims to be. Meanwhile, memory, whether files, logs, or a task list, lets the loop avoid repeating work across restarts.
Finally, a human checkpoint matters before anything irreversible happens. This keeps a person in control of real risk, even while routine work runs unattended. For the technical detail behind each piece, see this original essay by Addy Osmani on O’Reilly Radar. This practical guide from AI Builder Club covers a deeper checklist.
What this means for your business
You do not need a fleet of autonomous agents to benefit from this idea. Start smaller. Pick one repetitive task with a clear, checkable definition of done, such as formatting a report correctly or matching a style guide. Build a simple two-step check: one pass that does the work, one pass that grades it against your rule. That is loop engineering at a scale any business can use, whether or not you ever run a full autonomous coding agent. For a broader look at how autonomous agents are structured, see our guide to agentic ai and multi-agent systems.
Frequently asked questions
What is loop engineering in simple terms?
Loop engineering means designing a system with two agents. One does a task. A second checks the result against a goal. The pair repeats until the goal is genuinely met, without a person prompting each step by hand.
How is loop engineering different from prompt engineering?
Prompt engineering is about wording a single request well. Loop engineering is about designing the system that keeps prompting, checking, and retrying automatically. The unit of work becomes a running loop instead of one message.
Why is the verifier considered the bottleneck in a loop?
The generator agent can produce work cheaply and endlessly. The verifier decides if that work is actually good enough to ship, retry, or stop. A weak verifier lets bad output through no matter how good the generator is.
Curious whether loop engineering fits your workflow?
TekShove’s Web Development team can help you identify one real, repetitive task worth automating with a generator-and-verifier loop, and build it properly.