Loop engineering designs the system that prompts agents, instead of a person sitting inside every turn.1 A loop is a schedule plus a decision that reads state, acts, checks feedback, and chooses whether to continue.1
Overview
The harness runs one agent, and the loop finds work, spawns helpers, verifies, and feeds itself.1 A loop needs feedback and a halt: missing validation and loops without an exit are gaps,2 and stops such as max iterations and max cost belong in hard logic, not in a prompt the model can talk past.3 Skills inside the loop are the reusable asset, so a tick does not re-derive the project.
Mechanism
- A small program prompts, reads the result, and prompts again only if the work is not done.1
- The layer is named: execution, task, product, system, or oversight.4
- Durable state sits on disk, and the loop calls skills instead of pasting a giant prompt.1
- The maker is split from the checker,5 and iterations and cost are capped.3
- Context is seeded once before the loop when the question needs an opening retrieval.6
Applications
Loop engineering applies when work should repeat under a halt condition instead of a human prompting every turn.
Limitations
A fan-out with no return into a next cycle is not a loop. An uncapped loop that grades its own completion is excluded by the halt requirement.3
Worked example
Question’s Gambit is an opening move run once before a search agent’s loop.6
- The question is split into clues that can be searched in parallel, not ordered sub-answers.
- Each clue is turned into complementary searches.
- The results are pooled and deduplicated, and the pool is reranked against the full question.
- The top-ranked documents are handed to the agent as its first observation.
- The usual search loop then runs unchanged, verifying and filling gaps. The paper attributes the gain to the opening context, not to a different loop or tool.
See also
- Karpathy LLM wiki foundation – the compiled wiki
- Ephemeral wiki compile-lint – an opening seed for a per-question compile
- Verification and stop conditions – decision density in loops and confidence-gated escalation
- Agentic harness engineering – the audit template
- Harness runtime – per-turn runtime internals
- Thin harness, fat skills – the thin-harness philosophy
- Skillify authoring – skills inside loops
- Autoresearch loop – a system-loop cousin
Further reading
- https://x.com/omarsar0/status/2102171057612566585
- https://x.com/mvanhorn/status/2063865685558903149
- https://x.com/0xmovez/status/2062164743448633393
- https://x.com/morganlinton/status/2064486406203035807
- https://x.com/0xmovez/status/2067291911468044494
- https://x.com/0xnicc0/status/2096408872575521228
- https://x.com/callanxai/status/2098507120224145581