What Is Loop Engineering, and Who Owns It?
The role that shapes how AI agents halt, hold state, and recover, plus a maturity model to score your team against.
TL;DR: Loop engineering has become the hot phrase across the AI engineering community after viral posts from Boris Cherny, Peter Steinberger, and Rohan Paul. Andrew Ng at DeepLearning.AI then formalized it as three nested feedback loops for building software with AI coding agents, and Addy Osmani elaborated the practice further. This blog goes one level deeper. It defines the loop engineer role and names the three primitives inside the innermost coding loop: halt conditions, state carryover, and recovery paths. A five-level maturity model helps AI PMs, agent builders, and engineering leads assess their teams and choose the next primitive to invest in.
Loop Engineering, in Two Layers
Prompt engineering was the first discipline named around large language models. It covered how a single instruction reached the model and what came back. As tasks stretched across many calls, a second discipline came into focus. It covered what the model saw at each step, through retrieval, working notes, and sub-agent outputs. Prithvi Rajasekaran and coauthors at Anthropic formalized that discipline in September 2025 under a term that had already been coming to prominence: context engineering.

The loop sits above both.
In recent months, the phrase “loop engineering” has taken hold across the AI engineering community. Boris Cherny, who created Claude Code at Anthropic, and Peter Steinberger, who created OpenClaw, popularized the phrase in viral social posts.
Rohan Paul amplified those posts further. Addy Osmani captured the quotes and elaborated the practice into a taxonomy of automations, worktrees, skills, plugins, and sub-agents. Andrew Ng at DeepLearning.AI then formalized the term as three nested feedback loops for building software with AI coding agents:
Agentic Coding Loop: The agent writes, tests, and iterates in minutes.
Developer Feedback Loop: A human reviews the output and steers the agent over tens of minutes to hours.
External Feedback Loop: Users and testers close the loop over hours to weeks.
Ng’s framing is the right one for building software with AI agents. It also assumes that the innermost loop, the agentic coding loop, can actually iterate reliably.
Whether it can iterate depends on a layer within it: the agent’s runtime. This blog defines that layer. It names the loop engineer role, the three primitives that must be present for a runtime to count as a loop at all, and a maturity model for teams shipping production agents.
What the Loop Owns That Prompt and Context Do Not
Same model, different loop shape, different outcome. John Yang and colleagues at Princeton showed this directly with the SWE-agent in 2024. The interface a coding agent uses to read files, run tests, and edit code produced very different agent performance even when the underlying model was held constant.

Prompt and context work shape what one call sees. Loop work shapes what a sequence of calls does. As the sequence gets longer, the loop dominates. METR reported in March 2025 that the length of task a model can complete with 50 percent success has doubled every seven months for six years. That growth curve puts pressure on the runtime layer, not the prompt.
The Three Primitives Every Loop Owns
A runtime only counts as a loop when three primitives are present. Everything else is a variant of one of these three.
Halt Conditions: What ends the run?
State Carryover: What moves between iterations.
Recovery Paths: What happens when a step fails?
The absence of any one of these is a symptom of an immature runtime.
Halt Conditions.
A loop needs to know when a run ends. That signal is compound: the model’s own claim of task completion, a step cap, and a time cap. A stall detector catches the case where the model burns tokens without moving forward.
Simon Willison recommends tight budget limits on any credential the loop can spend money with, which fits naturally as another halt condition rather than a fourth primitive. Single-condition halts are the signature of an immature loop.
State Carryover.
A loop needs to carry information from one iteration to the next. Naive message history collapses fast. Kelly Hong and coauthors at Chroma tested 18 state-of-the-art models and showed that performance degrades unevenly with input length, well before the advertised context window is full.

Justin Young and coauthors at Anthropic documented a working alternative for long-running coding agents. Their harness uses a feature-list JSON, a claude-progress.txt file on disk, git commits as durable checkpoints, and browser verification through Puppeteer.
State is not the prompt. A state is a data structure that the loop engineer designs and maintains.
Recovery Paths.
A loop needs a plan for what happens when a step fails. That plan cannot be self-critique.
Jie Huang and coauthors at ICLR 2024 showed that models cannot reliably self-correct their own reasoning without an external signal. Recovery paths need external verifiers, retries with backoff, model failover, or human escalation.
Thiaga Rajan at Sierra described a shipping example in December 2025. Sierra’s constellation architecture automatically switches between equivalent models when quality degrades, rather than trying to fix the failure within the failing model’s next call.
What Loop Engineering Is Not
Loop engineering is not workflow orchestration.
Orchestration frameworks coordinate deterministic tasks with retries and backoff. Loop engineering coordinates nondeterministic model calls whose next step depends on the model’s own output.
Lenny Pruss at Amplify Partners argues that agents are dynamic workflows and durable execution engines like Temporal are the correct substrate. That argument is right about the plumbing and wrong about the primitives. Halt, state, and recovery under nondeterminism are not what workflow engines solve.
Loop engineering is not harness engineering either.
The harness engineer provides the environment in which the loop runs. That includes sandboxes, tool provisioning, sub-agent spawning, and trace collection. The loop engineer works inside that environment on halt, state, and recovery.
In practice, one engineer often owns both today. But the two roles reveal different paths to failure and different signatures at maturity.
A Maturity Model for Loop Engineers
The five levels below map how mature an agent loop can be. Find where your team sits. The primitive missing at that level is where to invest next.
Level 1: A single model call runs in a
forloop with a step cap and raw message history. Recovery paths and structured state are missing entirely. The loop fails due to tool-error contagion after the first bad step. And the simplest starter agents from frameworks like the Anthropic Agent SDK are classic examples.Level 2: The loop has multiple halt conditions and basic error handling, but no structured state or planning. It drifts off-course past ten to fifteen steps. Early production agent MVPs are the classic example.
Level 3: Structured working memory, explicit recovery branches, and per-primitive tracing, missing continuous evaluation feedback, which fails as silent regression across releases. Current Claude Code and Devin sit here.
Level 4: Continuous evaluation feedback gates releases on halt, state, and recovery independently, missing self-instrumenting improvement, which fails through eval-set drift and Goodhart effects. Sierra’s constellation architecture sits here.
Level 5: The loop reports on itself and improves itself without human input. No agent ships at this level today. Adaline is building the platform substrate that a Level 5 loop would need: one place to iterate, evaluate, deploy, and monitor the same agent.
A team that has shipped one agent to production but not yet a second usually sits at Level 2 or Level 3. The Level 2 to Level 3 transition is the hardest to make. It requires renaming the work as loop work and giving it an explicit owner.
Walden Yan at Cognition argues that single-threaded linear agents with context compression are the right default at this transition. Multi-agent collaboration, in his framing, is currently a premature optimization outside a narrow set of use cases.
When the Loop Engineer Role Emerges
The trigger for hiring a loop engineer is not team size. The trigger is incident volume attributable to loop primitives. Once halt failures, state failures, and recovery failures exceed a single engineer’s spare attention, the work needs an explicit owner, or it defaults to whoever is paged most often.
Sierra has been public about this role for two years. Natalie Meurer at Sierra described the Agent Engineer role in July 2024 as ownership of composable skills, supervisors, and orchestration across multiple model calls. That scope maps almost exactly to the three primitives above.
Decagon’s Software Engineer, Agent Orchestration posting describes the same work under a different title, framing the agent runtime as a distinct engineering surface. The role is real. The name is still being negotiated.
The Job Is the Runtime
Prompt engineering shapes one call. Context engineering shapes what that call can see. Ng’s nested-loops framing shapes how humans and users close the outer cycles around an agent. Loop engineering shapes whether the innermost loop can iterate at all.
Score your team against the maturity model. Name the primitive at your level’s boundary. Assign an owner before the next incident does it for you.



