Skip to main content

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.

info

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.

PlaybooksLoops
Who drivesYou, step by stepThe system, on a trigger
ShapeA repeatable workflow you followA self-running process that prompts the agent
Best forTasks you do yourself, better and fasterWork that should happen without you sitting there
You writeA good prompt and the next promptThe 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.

GuideWhat you'll learnTime
What Is Loop Engineering?The shift from prompts to loops, and when a loop is (and isn't) the right tool10 min
Anatomy of an Agent LoopThe six parts every reliable loop needs: trigger, task selection, action, evaluation, stop condition, and memory15 min
Loop Guardrails & SafetyCost caps, sandboxing, human checkpoints, and the failure modes that bite people first15 min

Loop Recipes

Concrete, copyable loops. Each follows the same step-by-step format as a playbook — but the end result runs itself.

RecipeWhat it doesSetup
The Overnight Coding LoopAn agent that picks up a queued task, implements it, tests it, and opens a pull request — with guardrails so it stops safely60-90 min
The Research & Monitoring LoopA scheduled loop that watches a topic and delivers a digest on its own45-60 min

How to use this section

  1. Read What Is Loop Engineering? and Anatomy of an Agent Loop first — they're short and everything else builds on them.
  2. Read Loop Guardrails & Safety before you let anything run unattended. A loop without a stop condition is a way to spend money fast.
  3. 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.