Loop engineering is replacing yourself as the person who prompts the agent — you design the system that does it instead. A loop is a recursive goal: you define a purpose and the agent iterates until it’s complete. The leverage point moves from writing good prompts to designing the system that writes them.

Source: Loop Engineering (Addy Osmani, 2026-06-08).

The two statements the post is built on

Peter Steinberger: “You shouldn’t be prompting coding agents anymore. You should be designing loops that prompt your agents.”
Boris Cherny (head of Claude Code, Anthropic): “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.”

For two years the workflow was: write a prompt, read the reply, type the next thing — you hold the tool the entire time, one turn after another. Loop engineering ends that. You build a small system that finds the work, hands it out, checks it, records what’s done, and decides the next thing, then let it poke the agents instead of you.

Where it sits in the stack

Osmani stacks three layers explicitly:

  1. Harness — the environment one agent runs inside (see Harness Engineering, Agent Harness Engineering).
  2. Factory model — the system that builds the software.
  3. Loop — the harness, but it runs on a timer, spawns helpers, and feeds itself.

The shift he flags: this is no longer a tooling problem. A year ago a loop meant a pile of bash you maintained forever (the Ralph Loop). Now the pieces ship inside the products, and Steinberger’s list maps almost exactly onto both the Codex app and Claude Code. Once you see the shape is identical, you stop arguing about which tool and design a loop that works in either.

The five pieces (plus a memory)

#PieceWhat it doesClaude CodeCodex
1AutomationsScheduled discovery + triage; the heartbeat/loop, cron tasks, hooks, GitHub ActionsAutomations tab → Triage inbox
2WorktreesParallel agents don’t collide on filesgit worktree, --worktree, isolation: worktreebuilt-in worktree support
3SkillsProject knowledge written down so the agent stops guessingSKILL.md folders$//skills, auto-match on description
4Plugins & connectorsPlug into your real tools (issues, DB, Slack)MCP connectors; plugins bundle themMCP connectors; plugins
5Sub-agentsOne has the idea, a different one checks it.claude/agents/, agent teamsTOML in .codex/agents/
6MemoryState outside the conversation: what’s done, what’s nextmarkdown file / Linear boardmarkdown file / Linear board

The memory is the load-bearing trick every long-running agent depends on: the model forgets everything between runs, so state lives on disk, not in context. “The agent forgets, the repo doesn’t.” (This is the same insight as Long-Running Agents and the durable-artifacts pattern in Long-Running Agents - Initializer + Coding Pattern.)

/loop vs /goal — the primitive that matters most

  • /loop re-runs a prompt or command on a cadence.
  • /goal keeps going until a condition you wrote is actually true, and after every turn a separate small model checks whether you’re done — so the agent that wrote the code isn’t the one grading it. Give it “all tests in test/auth pass and lint is clean” and walk away. Both Codex and Claude Code have it.

/goal is the maker/checker split applied to the stop condition itself — the same separation behind dynamic workflows’ adversarial verification and Cursor’s judge role.

The decisive structural move: split maker from checker

The single most useful thing in a loop is separating the agent that writes from the agent that checks. The model that wrote the code is too generous grading its own homework (the self-preferential bias again). A second agent — different instructions, sometimes a different model — catches what the first talked itself into. The usual triple: one explores, one implements, one verifies against the spec.

Because the loop runs while you’re not watching, a verifier you actually trust is the only reason you can walk away. Sub-agents burn more tokens (each runs its own model + tools), so spend them where a second opinion is worth paying for.

What one loop looks like

A morning automation calls a triage skill that reads yesterday’s CI failures, open issues, and recent commits, and writes findings to a state file (markdown or Linear). For each finding worth doing, the thread opens an isolated worktree, sends a sub-agent to draft the fix, and a second sub-agent reviews it against the project skills and tests. Connectors open the PR and update the ticket. Anything the loop can’t handle lands in the triage inbox for you. The state file is the spine — tomorrow’s run picks up where today stopped.

You designed it once. You prompted none of the steps.

What the loop does not do for you

Three problems get sharper as the loop gets smoother, not easier. This is the part that ties loop engineering back to the vault’s whole AI-skepticism cluster:

  • Verification is still on you. A loop running unattended is a loop making mistakes unattended. “Done” is a claim, not a proof. Your job is to ship code you confirmed works. (The human ceiling — Orchestration Tax.)
  • Understanding rots if you let it. The faster the loop ships code you didn’t write, the bigger the gap between what exists and what you grasp — Comprehension Debt. A smooth loop grows it faster unless you read what the loop made.
  • The comfortable posture is the dangerous one. When the loop runs itself, it’s tempting to stop forming an opinion — Cognitive Surrender. Designing the loop is the cure when done with judgement and the accelerant when done to avoid thinking. Same action, opposite result.

The thesis

Two people can build the exact same loop and get opposite results. One uses it to move faster on work they understand deeply; the other uses it to avoid understanding the work at all. The loop doesn’t know the difference. You do.

That’s why loop design is harder than prompt engineering, not easier — Cherny’s point isn’t that the work got easier, it’s that the leverage point moved. Build the loop. But build it like someone who intends to stay the engineer, not just the person who presses go.

Where it sits in the vault

See Also