Awesome Loop Engineering

Design loops,
not just prompts.

Loop Engineering is the AI and coding-agent practice of designing recurring systems that discover work, delegate it to agents, verify results, persist state, decide next actions, and run again.

Diagram of the engineering stack: Prompt, Context, and Harness Engineering improve one run; Loop Engineering governs recurring agent work over time.
15operational patterns
15loop contracts
6runnable templates
250+curated entries
8languages
Canonical definition. Loop Engineering is the AI and coding-agent practice of designing recurring systems that discover work, delegate it to agents, verify results, persist state, decide next actions, and run again on a cadence, event, or until a verifiable goal is reached.
The stack

Four layers, one recurring system

Prompt, context, and harness engineering make a single agent run better. Loop Engineering sits on top and governs agent work over time.

Prompt Engineeringwhat should I say to the model?
Context Engineeringwhat state, memory, and knowledge should the model see?
Harness Engineeringwhat tools, permissions, sandboxes, and checks surround one run?
Loop Engineeringwhat recurring system governs agent work over time?
The lifecycle

One pass of a recurring loop

Verification is a deterministic gate, not the agent's opinion. State persists outside the model. Every loop has a budget and a human exit.

Loop Engineering lifecycle: Intake, Delegate, Act, Verify, Persist, Decide; Decide retries by feeding evidence back, escalates to a human, or exits when the goal is met.
The loop contract

Every loop names the same parts

A useful loop has a contract. If a part is missing, it becomes either a manual prompt habit or an unsafe background automation.

Loop Contract cards: objective, trigger, intake, workspace, context, delegation, verification, state, budget, escalation, and exit.

Verifiable by design

Tests, typechecks, evals, traces, or reviewers decide done — never the acting agent alone.

State outside the model

Progress files, issues, checkpoints, and traces survive the next run and every context reset.

Budgeted and bounded

Retries, runtime, and concurrency are capped, with a clear human exit before anything risky ships.

Loop maturity model

Climb the model slowly

A reliable Level 3 loop with clear state and deterministic checks is usually more valuable than a flashy Level 5 loop with vague goals.

0
Manual prompting
A human reads state and writes the next prompt.
1
Scripted retry
A shell or script loop feeds errors back to an agent.
2
Scheduled loop
The agent runs on a cadence and reports findings.
3
Stateful loop
Progress survives across sessions through files, issues, or checkpoints.
4
Self-verifying loop
Deterministic checks or evaluator agents gate completion.
5
Multi-agent loop
Specialized agents split discovery, implementation, review, and judgment.
6
Production-supervised loop
Observability, budgets, approvals, rollback, and escalation are first-class.
The curated list

Browse by category

Primary sources, official docs, papers, benchmarks, and implementation-heavy write-ups — selective, not a dump. Jump into any section of the README.