Everyone's loop-engineering this month. Here's how I run mine, and the one ring that keeps me up at night.
One fine day, amongst the deluge of articles we dump into our Slack channels, I noticed the whole field had grabbed the same word. Loop. And then wouldn't let go of it.
Peter Steinberger said stop prompting your agents, start designing the loops that prompt them. Boris from Anthropic said it plainer: "I write loops, and the loops do the work." Addy Osmani wrote a whole essay literally called Loop Engineering. swyx has Loopcraft, the art of stacking loops. Geoffrey Huntley has the Ralph loop. LangChain shipped their own take. There was a whole track at the AI Engineer World's Fair about it.
Great. Everyone named a loop. But nobody was pointing at the same thing.
Then Aparna Dhinakaran (with Seldo) did the one genuinely useful thing in all that noise. She drew the map. Counted four different things hiding behind that one word, and lined them up so you could finally tell which loop someone meant. Go read hers, it's the best thing in the pile.
So I'm not here to re-explain her map. I'm here to do two things she didn't. Tell you how I actually run these loops (the dumb tricks that stopped me shooting my own foot). And draw the one ring none of them put on the diagram. The one that, being a security guy, keeps me up at night.
The four loops
Here's the map. One line each. Names go to whoever coined the piece.
- 1 The execution loop
The one you picture when you say "agent". Call a tool, read the result, pick the next action, repeat till there's no tool calls left. It works on steps inside one task. It ends on feedback (test output, API response). Or, and here's the catch, whenever the agent just decides it's done.
- 2 The task loop Geoffrey Huntley's Ralph loop
You restart the agent against the same spec, again and again, fresh context window every single time, one task per loop. Sounds wasteful. But that waste is the point. It kills the context rot that quietly eats long sessions. Ends on the spec passing.
- 3 The product loop the "software factory"
Loudest version at the conference. Zach Lloyd at Warp is the poster child. The whole lifecycle on a loop. Triage, spec, build, review, verify, ship, monitor. Its exit signals come from outside the code entirely. New issues, prod logs, users complaining.
- 4 The system loop "the loop is the product"
The one swyx stacks at the top and Aparna calls the loop that is the product. Inner loop does the real work. Outer loop studies the inner one and makes it better. It iterates on prompts, harnesses, model choices, even the evals. Think Karpathy running experiments overnight.
Four loops. One word. No wonder the timeline is confused. There's a fifth ring Aparna names too, the oversight loop. Set goals, hand out budget, kill dead work. Its exit condition is you.
Where they can't agree
Once you have the map, every big fight this month is really about one question: how far up do you turn the autonomy dial.
One camp says turn it up. Zach Lloyd wants to ratchet the auto-merge rate from 20% toward 60%. Build the factory. The other camp says the dial has a stop. Geoffrey Litt at Notion called factories "a depressing vision", and argued the people who delegate understanding get replaced by the agent. Paul Bakaus put it flatter: "there is no auto, and there will be no auto." Dex Horthy from HumanLayer isn't anti-loop at all (he helped make the Ralph loop a meme), he just keeps pointing at context engineering as the actual hard part.
I don't fully sit in either camp. But here's the bit both camps skip. They're all arguing about the quality dial. Nobody's arguing about the safety brake. And those are not the same knob.
How I actually run these
I'm a security guy. Not an AI researcher. I don't build fancy harnesses. But I run agents all day for real grunt work. Scraping, recon, crunching data, drafting stuff. And I've collected a few scars. Here's the tricks.
- 1 Make "done" something the agent can't fake.
The execution loop stops when the agent decides it's done. Not when it's actually done. That's the whole trap. So never take its word for it. Wrap the loop in an outer check that's dumb and external: a passing test, a row count, an exit code. If done-ness is the agent's opinion, you don't have a loop. You have a vibe with extra steps.
Last week I had an agent clean a messy CSV of leads. It said "done, all rows normalized." My check was one line: every row needs a valid email and no duplicates. It failed on 40 rows the agent swore were fine. The check caught it, not me.
- 2 Fresh context beats a long session.
Long sessions rot. The window fills with old turns, compaction quietly eats the middle, and the agent slowly forgets its own instructions. Throwing the session away and re-feeding the full spec into a clean window every pass feels wasteful. It isn't. A clean start beats a cheap rotting session almost every time. This is Ralph loop thinking.
A scraping job I ran was perfect for the first 100 pages. By page 500 it had dropped half the fields I asked for. The fix was stupid: restart it every 100 pages with the same spec. Slower per page, but the output stopped drifting.
- 3 Your acceptance check IS the loop.
A loop with no check doesn't run till it's right. It runs till something else stops it: a timeout, a crash, your patience. So write the check first. It isn't a formality you bolt on at the end. It's the thing that closes the loop.
I looped an agent to pull all my X bookmarks. It proudly stopped at around 750 and said done. I almost believed it. The only reason I didn't: a dumb count-plus-dedupe check I'd bolted in front. It screamed. Real number was 1,346. Without it I'd have built a whole analysis on half the data and never known.
- 4 Know when it's a loop and when it's just a pipeline.
Fanning out agents is not looping. Dispatch, gather, validate is a pipeline: nothing feeds back into a next cycle. As Aparna puts it, "a loop without feedback is just a
forstatement." You tune them differently. A pipeline you make wider (more workers). A loop you make converge (better feedback).For some competitive research I ran two agents over the same posts, one hunting security angles, one bucketing topics, then diffed them. That's a pipeline. I made it better by adding a third lens, not by "looping" it. The real loop was the outer one: re-run the whole thing when new posts landed.
- 5 Stop prompting, start designing.
The shift isn't writing better prompts. It's designing the loop and holding the judgment. As Addy Osmani put it, "that inner loop is capability, the outer loop is agency." Set the goal, define what "correct" means, let it run in the background, review only at the boundaries. Your leverage moves up a level.
I don't hand-hold a recon agent call by call anymore. I give it the scope, define "correct" as a deduped list of subdomains that actually resolve, and let it churn while I do something else. I only look at the boundary: the final list. The babysitting is gone.