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.
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.
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.
Start from the problem you have
Each card opens a ready-to-adapt pattern with a trigger, verification gate, durable state, budget, and escalation path. Compare them all in the pattern matrix.
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.
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.
Pick a runtime deliberately
The same contract can run as a session command, a scheduled cloud job, a CI workflow, or a cron wrapper. The runtime selection guide compares persistence, file access, isolation, and permissions.
Claude Code /loop
Session-scoped recurring task while you are nearby.
Desktop scheduled task
Local recurring runs with file access and missed-run guardrails.
Codex automation
Unattended background task in an isolated worktree.
GitHub agentic workflow
Scheduled or event-triggered loop in GitHub Actions.
Shell / cron
Minimal wrapper that delegates to an agent CLI and records receipts.
Runnable reference
A dependency-light test-repair loop you can run today.
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.
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.