Loop engineering
Stop prompting, start designing the system that prompts. Triggers, verification, stop conditions, memory and budgets.
6 chapters · 24 min
Start the course- 1What loop engineering isLoop engineering means building the system that prompts, checks and restarts an agent, so you stop being the person who types every turn. The term is new, and the honest story of where it came from is short.4 min
- 2Four kinds of loop and how to pick oneTurn-based, goal-based, time-based and proactive loops differ in who or what starts the next turn. Picking the simplest one that fits is the first cost decision you make.4 min
- 3The Ralph loop underneath everythingThe oldest loop is a bash while-loop that feeds one prompt file to an agent forever. Fresh context, one task per iteration and tests as backpressure are why it works, and having no stop condition is why it needs the rest of this course.4 min
- 4Do not start a loop you cannot checkA loop optimises whatever its check measures, so a weak check produces confident wrong work. Build the check first, keep the maker and the checker apart, and calibrate the checker against your own judgment.4 min
- 5Stop conditions and the budgetA loop needs three exits: a stop written as evidence, a hard cap for when the evidence never comes, and a rule for repeated failure. The cost numbers from real runs show why the caps are not optional.4 min
- 6The harness for long-running workA loop that runs for hours forgets everything between sessions, so its memory has to live in files. Progress logs, a feature list the agent may only flip, a startup routine, and the habit of retesting each part when the model changes.4 min