Loop Engineering
In short: Loop engineering is the practice of designing the system that prompts an AI agent — on a schedule or trigger — instead of typing every prompt yourself. Where a playbook is a repeatable process you run with AI, a loop is a process the agent runs on its own: it finds the work, does it, checks the result, records what happened, and decides what to do next. This section explains the pattern and walks you through building loops you can actually trust.
This content was developed with AI assistance and is regularly reviewed for accuracy.
Why this is a sister topic to Playbooks
Playbooks and loops are two halves of the same idea — turning AI from a thing you chat with into a thing that does work for you.
| Playbooks | Loops | |
|---|---|---|
| Who drives | You, step by step | The system, on a trigger |
| Shape | A repeatable workflow you follow | A self-running process that prompts the agent |
| Best for | Tasks you do yourself, better and faster | Work that should happen without you sitting there |
| You write | A good prompt and the next prompt | The loop that writes the prompts |
If you've worked through the playbooks, you already know how to get good results from AI one turn at a time. Loop engineering is the next move: handing that turn-by-turn work to a system you designed.
What changed in 2026
For about two years, getting work out of an AI agent meant writing a good prompt, reading the reply, and writing the next prompt — holding the tool the whole time. In mid-2026 that started to flip. Coding agents became capable enough to run multi-step tasks on their own for hours, so the bottleneck moved from model capability to orchestration design: deciding what to prompt, when, and whether the result is good enough.
The term "loop engineering" was popularized in June 2026 by Addy Osmani, building on points from Peter Steinberger and Anthropic's Boris Cherny (who leads Claude Code). Cherny put it bluntly: "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." The skill shifted from writing prompts to designing the control system around the agent.
This is the natural successor to two earlier waves: prompt engineering (writing the single instruction well) and context engineering (giving the model the right information). Loop engineering wraps both inside an autonomous process.
Foundations
Start here to understand what a loop is and how to keep one safe before you build one.
| Guide | What you'll learn | Time |
|---|---|---|
| What Is Loop Engineering? | The shift from prompts to loops, and when a loop is (and isn't) the right tool | 10 min |
| Anatomy of an Agent Loop | The six parts every reliable loop needs: trigger, task selection, action, evaluation, stop condition, and memory | 15 min |
| Loop Guardrails & Safety | Cost caps, sandboxing, human checkpoints, and the failure modes that bite people first | 15 min |
Loop Recipes
Concrete, copyable loops. Each follows the same step-by-step format as a playbook — but the end result runs itself.
| Recipe | What it does | Setup |
|---|---|---|
| The Overnight Coding Loop | An agent that picks up a queued task, implements it, tests it, and opens a pull request — with guardrails so it stops safely | 60-90 min |
| The Research & Monitoring Loop | A scheduled loop that watches a topic and delivers a digest on its own | 45-60 min |
How to use this section
- Read What Is Loop Engineering? and Anatomy of an Agent Loop first — they're short and everything else builds on them.
- Read Loop Guardrails & Safety before you let anything run unattended. A loop without a stop condition is a way to spend money fast.
- Pick a recipe that matches a real task and build it with that task, not the example.
Loops reward starting small. Your first loop should do one narrow thing, with a tight budget and a human checkpoint, and earn more autonomy only after you've watched it behave.