Intermediate · Systems
Loop Engineering
Visual diagram · Math · (in preparation) · Worked example · 3 difficulty levels.
TL;DR. The practice of designing repeatable systems around agents, instead of manually prompting them for one task at a time.
Technical Definition
The practice of designing repeatable systems around agents, instead of manually prompting them for one task at a time.
How it works
Loop engineering treats the agent's run-loop as the thing you design, not the prompt. Rather than crafting one perfect instruction, you build the cycle the agent repeats: how it picks up work, what feedback it reads after each action, when it checkpoints with a human, and how it knows it is finished. A well-engineered loop makes an average model reliable; a poorly engineered one makes a frontier model flail. The discipline covers stop conditions, retry and recovery policy, context hygiene between iterations, and the evals that tell you the loop is actually converging.
Visual Explanation (cycle)
Pick up task → act → observe feedback → checkpoint → repeat until done condition is met
Related Concepts
- Persistent Background Agents — Long-running autonomous agents — such as Meta's Muse Code and Replit's Agent 4 — that build, debug, and ship software over days from a single natural-language instruction.
- Agent Harness — Everything surrounding a model that makes it useful in real workflows — the tools, permissions, memory, context, and orchestration around the model itself.
- Ralph Loop — A loop-engineering pattern where you give an agent a detailed task — often from a spec or PRD — and have it keep working until the job is done.