Prompt engineering shaped the turn. Context engineering shaped what the model sees. The next discipline is loop engineering: shaping the trajectory.
Project description
Prompt engineering shaped the turn. Context engineering shaped what the model sees. The next discipline is loop engineering: shaping the trajectory. The shift in one line: the model is the CPU, the loop is the program. As models get more capable, the thing that decides whether your agent finishes, stays on task, recovers from a failed tool call, or quietly burns $40 is not the prompt. It is the loop wrapping it. So I wrote a framework for it — a methodology, not another library. A few of the ideas: - Most "agent loops" are really two loops at different speeds: a fast tactical inner loop (observe, decide, act, check) inside a slow strategic outer loop (plan, reflect, replan). The inner has to settle before the outer intervenes. Reflect on every step and you have built an unstable controller. - Evaluate the trajectory, not just the outcome. A loop can return the right answer through a 40-step flailing path. Outcome-only eval is blind to that. - 11 principles, each paired with a named anti-pattern (the Runaway, the Thrasher, the Sisyphus) and a scorecard row you can grade your own loop against, 0 to 2. It is built to be read by both audiences: a manifesto for people, and a structured JSON encoding plus llms.txt for the models that will actually run these loops. And because a framework about loops deserved a loop you can watch, I made a 40-second explainer — rendered entirely in code with Remotion, in black and white. What is the failure mode that bites your agents most: runaway cost, drift, or livelock? #AI #LLM #Agents #AIEngineering
Support this project
Upvote
