Loop Engineering
Loop Engineering is a new concept that spread rapidly through the AI programming community in June 2026, systematically organized by Google engineer Addy Osmani, with Anthropic Claude Code lead Boris Cherny and developer Peter Steinberger independently proposing similar views in public.
This article will take you from zero to understanding what Loop Engineering is, its essential difference from Prompt Engineering, the six core elements that make up a complete Agent Loop, and how to design your first runnable Loop.
### The Evolution of AI Engineering
Over the past two years, the focus of AI development has been constantly changing: from researching how to write good prompts (Prompt), gradually developing to organizing context (Context), orchestrating tools and processes (Harness), and then building loop systems (Loop) that can run autonomously and continuously deliver results.
Prompt: How to ask AI βContext: What information to give AI βHarness: How to organize AI's capabilities βLoop: How to let AI continuously create results
!(#)
| Engineering Phase | Core Idea | Focus | Input Content | AI Capability | Human Role | Typical Scenarios |
| --- | --- | --- | --- | --- | --- | --- |
| Prompt Engineering | Get better output through designing prompts | How to ask questions | Prompt / Instructions | Single-turn generation | Question asker | Chatting, writing, code generation |
| Context Engineering | Organize and provide complete background information | What information to give AI | Knowledge base, history, constraints, context | Context understanding | Information organizer | RAG, AI search, code assistant |
| Harness Engineering | Connect models, tools, and data to form workflows | How to invoke capabilities | Context + API + Toolchain | Execute tasks | System designer | Agent, automation workflows, multi-tool collaboration |
| Loop Engineering | Build goal-driven autonomous closed-loop systems | How to continuously achieve goals | Goals, state, memory, verification mechanisms | Plan β Execute β Verify β Fix β Continuous operation | Rule setter | Claude Code, AI programming, automated operations, AI employees |
* * *
## The Origin of Loop Engineering
Loop Engineering has a clear time point: June 2026.
### The Spark: Two Sentences, Million Retweets
In early June 2026, Anthropic Claude Code lead **Boris Cherny** said in a public speech:
> "I don't prompt Claude anymore. I have loops running. They're the ones prompting Claude and figuring out what to do. My job is to write loops."
A few days later, on June 7, 2026, developer **Peter Steinberger**βcreator of the open-source AI Agent project OpenClaw (the fastest-growing new repository in GitHub history)βtweeted twelve characters:
> "You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents."
* **Prompt Engineering** is "teaching AI how to do"
* **Loop Engineering** is "designing a system so AI does it continuously on its own"
!(#)
These two sentences sparked huge discussion in the AI developer community because they precisely described a trend many had felt but hadn't yet named: **whether you write good prompts is no longer the bottleneck; the bottleneck is the entire operating system you design for the Agent**.
Subsequently, Addy Osmani published a long article on Substack, formally naming and systematizing this practice as Loop Engineering, making it an independent engineering discipline.
### Background: Three Generations of AI Programming Tools Evolution
Loop Engineering didn't come out of nowhere; it's the natural result of the evolution of AI programming tool capabilities.
| Stage | Representative Tools | How It Works | Bottleneck |
| --- | --- | --- | --- |
| First Generation: Auto-completion | Early versions of GitHub Copilot | Complete current line or function, human leads all decisions | Can only assist, cannot act autonomously |
| Second Generation: Conversational | ChatGPT, Claude.ai | Ask one, answer one, human manually advances each step | Human becomes bottleneck, speed limited by typing speed |
| Third Generation: Agent Autonomous Loop | Claude Code, OpenAI Codex Agent | Agent autonomously plans, executes, verifies, iterates until completion | How to design a system that makes Loops run reliably |
The emergence of third-generation tools means the core competency of engineers has changed from writing prompts to designing Loops.
* * *
## What Is Loop Engineering
Loop Engineering is the engineering practice of designing, operating, and continuously improving feedback loops that enable AI programming Agents to autonomously complete planning, execute code modifications, observe results, and accomplish tasks through multiple iterations.
In one sentence:
> **Loop Engineering is the discipline that transforms you from "the person prompting the Agent" into "the designer of the system that prompts the Agent."**
### What Is a Loop
A Loop is a recursive goal system: you define a purpose, and the Agent iterates until the work is truly complete.
Every Agent already has a built-in "inner loop" when executing tasks: Perceive β Reason β Act β Observe, then loop again.
Loop Engineering works on the **layer above** this inner loop:
| Layer | Who Drives | What It Does |
| --- | --- | --- |
| Inner Loop (Built into Agent) | The Agent itself | Read file β Modify code β Run tests β Read error β Modify again |
| Outer Loop (You design) | Your designed system | Discover tasks on schedule β Assign Agent β Verify results β Record state β Start next round |
You no longer sit beside the Agent, typing a command for each step. You're designing an external system that drives the inner loop for you, while you do work of higher judgment value.
### Difference Between Loop Engineering and Prompt Engineering
| Dimension | Prompt Engineering | Loop Engineering |
| --- | --- | --- |
| Optimization Target | Your manually written single instruction | The entire system that automatically decides "what to prompt, when to prompt, and whether results are acceptable" |
| Unit of Work | One conversation turn you manually input | A complete workflow that runs automatically across multiple turns |
| Success Metric | Quality of the first response | Quality of the final output |
| Failure Mode | Model gives a poor answer | Poor Loop design: loop stops too early, ignores error signals, cannot verify completion |
| Perspective on Agent | A tool you hold | A long-running process you schedule |
!(#)
> Prompt Engineering hasn't died. A Loop is composed of multiple Prompts; poorly written Prompts placed in a Loop will just produce bad work at a faster speed. Loop Engineering is a layer above Prompt Engineering, not a replacement for it.
The complete technology stack at three levels:
| Level | What Is Optimized | Unit of Work |
| --- | --- | --- |
| Prompt Engineering | How to phrase one instruction | One conversation you manually input |
| Context Engineering | What content to put in the context window: documents, history, tool definitions | The environment conditions surrounding one response |
| Loop Engineering | The self-running system that decides what to prompt, when to prompt, and whether results are acceptable | An automatic workflow spanning multiple inner loops |
* * *
## The Core Loop
The basic structure of an Agent Loop consists of five phases, connected end to end, continuously iterating.
| Phase | English Name | What It Does | Typical Signal Sources |
| --- | --- | --- | --- |
| Intent | Intent | Define the goal result: what success looks like, what constraints are | Developer or external system (Issue, CI report) |
| Context | Context | Collect relevant code, docs, error logs, conventions | Codebase, test output, historical conversation |
| Action | Action | Edit files, run commands, call tools, draft solutions | Agent executes autonomously |
| Observation | Observation | Get test results, compile errors, runtime output, code diff | Test framework, type checking, CI, human review |
| Adjustment | Adjustment | Update plan based on observation, repeat loop until task is complete or blocked | Next inner loop iteration |
> The power of a Loop isn't in any single step, but in the **closed loop**. A test failure isn't just an error messageβit's new context. A type error isn't just a blockerβit's a signal about a wrong assumption. A Code Review comment isn't just feedbackβit's a new observation
YouTip