Loop Engineering: Why Everyone Stopped Prompting AI Agents
Two of the most followed builders in AI coding said almost the same sentence last month. Neither one was talking about writing better prompts. Boris Cherny, who built Claude Code, said he doesn’t prompt Claude anymore, he writes loops that prompt it for him. Peter Steinberger, who built OpenClaw, posted almost the identical line on X and it pulled in millions of views. Between them, they gave a name to something builders were already doing quietly: loop engineering.
One Topic: Loop Engineering Is New AI Skill
What Is a Loop, Really?
A loop is a task with a built in check attached to it. Instead of typing a prompt, reading the reply, and typing the next one, you build a small system that runs that cycle on its own.
Here’s how one round works. The agent acts, it writes code or edits a doc. It observes what happened, a test result or a diff. It decides if that’s good enough. Then it repeats or stops.
You’re not driving anymore. You’re the person who built the car.
Where This Idea Came From
It traces back to Geoffrey Huntley, an open source developer. In 2025, he was playing Factorio with his son when his son asked why he kept doing the same coding steps by hand instead of automating them.
That question became the “Ralph Loop,” a bash script that fed an AI agent the same prompt again and again, wiping its memory clean each round so it never got confused by its own past mistakes.
On June 7, Google’s Addy Osmani published an essay that gave the whole practice a name: loop engineering. His opening line was blunt: loop engineering replaces you as the person who prompts the agent, you design the system that does it instead.
Loop Engineering vs the /goal Command
If you use Claude Code or Codex, you already know /goal. I shared in the past JustDraft newsletter. You type one big instruction, the agent plans its own steps, and it decides when it’s done. That’s using a loop somebody else built.
Loop engineering is different. You decide how many attempts are allowed. What has to pass before the agent can call it finished. When a human needs to step in. What carries over between runs.
Put simply, /goal is one part inside your system. Loop engineering is the system around it.
Three Loops You Can Try This Week
All three work with Claude Code, Codex, Hermes, or OpenClaw.
- The boring fixes loop, for repetitive, testable work like a config migration or lint cleanup.
- Pull one ticket from your backlog.
- Point goal mode at just that change.
- Let it run tests and linters, retrying on failure a few times.
- If everything passes, it opens a PR tagged ready for review.You’re not skipping review, just the manual prompting and rerunning tests by hand.
- The docs cleanup loop, for a wiki or doc set that quietly goes stale.
- Trigger it daily or weekly with a cron job, Hermes, or OpenClaw’s heartbeat.
- It scans for outdated pages or docs that no longer match the code.
- It proposes edits, checks links, and opens a PR with a Slack summary.
- If something looks off, it flags you instead of guessing.Steady doc hygiene, without anyone hunting for stale pages by hand.
- The weekly review loop, no coding needed.
- Feed it your calendar, tasks, and notes from the week.
- Ask it to draft what you actually did, what moved forward, what stalled.
- Have it check its own draft against one rule: outcomes, not just activity.
- Send yourself the summary plus your top 3 priorities for next week.A painful Sunday ritual becomes a five minute check instead of an hour of writing.
Where You Can Run This Today
- Claude Code: native /goal and /loop, plus a stop hook that won’t let the agent call itself done until a separate reviewer model agrees.
- Codex: kernel level sandboxing, so a runaway loop can’t damage your machine.
- Hermes: built by Nous Research, it saves what it learns as reusable skills, so it gets faster with every run.
- OpenClaw: runs as a background gateway with scheduled heartbeats, less a terminal tool and more an always on assistant you talk to over Slack or email.
Is It Worth the Cost?
Loops cost more than chats. A Composio test found a coding task on Claude Code used about 192,000 tokens, close to $2.50. The same task on Codex used 136,000 tokens, about $2.04. Run that across a week of unattended loops and a $20 a month plan empties fast.
It also isn’t for every task. It pays off when “done” stays the same every time, like a migration. If your goal shifts each run, you’ll spend more time rewriting checks than you save.
Even Osmani, who named this, is careful about it. He’s said it’s still early, that he’s skeptical, and that token costs swing wildly. Worth remembering before you turn a loop loose on anything important.
I will suggest, if you’re already using Claude Code or Codex daily, start with one small, boring loop instead of thinking loop engineering or before touching anything bigger. Let it earn your trust first.

Interested in travel or photography, read last week’s LensLetter newsletter about astro photography gears (but not expensive)
Read last week’s JustDraft about Hermes Desktop AI Agent.
Two Quotes to Inspire
The leaders who compound fastest aren’t the ones who repeat themselves best. They’re the ones who build the system that repeats for them.
A system becomes powerful when it knows the difference between progress and motion.
One Prompt to Steal
Read my calendar and notes from the past 7 days. Draft a weekly review covering: what I actually got done, what moved my top 3 priorities forward, and what stalled and why. Then check your own draft against this rule: does it describe outcomes, not just activity? If it fails that check, revise it once. Finish with a short list of my top 3 priorities for next week, written as actions I can start Monday morning.


