his is not magic. It is not "build it once and never look again."
Small Loop vs Big Loop
π Small Loop (Inner Loop)
Every agent has a tiny cycle running inside it:
send context β model asks for tools β run tools β add results β repeat
This stops when the model itself decides it's done. Problem: nothing checks whether the model is actually right β it's just judging its own work. That's why agents confidently say "Done! All fixed" without ever running the tests.
Fix = Outside stops β conditions that don't depend on the model's own opinion:
- A checked condition (prove the work with a real test)
- A limit (max number of tries)
- A no-progress check (stop if nothing's improving)
- A separate checker (a second process grades the work)
π§ Big Loop (Outer Loop)
The small loop is one worker doing one task. The big loop is the manager β it decides:
- Which task to give
- When to start
- How to grade the result
- What to remember for tomorrow
One full run of the small loop = one "beat" of the big loop.
ποΈ The 4 Layers (each nested inside the next)
| # | Layer | What it covers | |---|-------|-----------------| | 1 | Prompt engineering | The words you send | | 2 | Context engineering | Everything the model sees in one turn | | 3 | Harness engineering | The code around the model (running tools, handling errors) β where the small loop lives | | 4 | Loop engineering | The outer cycle: what the system works on, when it starts, how it knows it's done |
Each layer stops a different kind of failure:
- No context β the model guesses
- No harness β you are the only checker
- No loop β the schedule is still on you
π― Key Takeaway
The useful question isn't "is my prompt good enough?"
It's: "Which of these layers am I still doing by hand?"