Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead.

#Definition

Where prompt engineering asks "what should I say to the model?" and harness engineering asks "what environment does the agent need?", loop engineering asks "how does the agent keep going without me?"

Coined and defined by Addy Osmani, with key articulations from Anthropic's Boris Cherny ("I don't prompt Claude anymore. I have loops running that prompt Claude") and PSPDFKit's Peter Steinberger ("You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents").

Loop engineering encompasses:

#The Five Building Blocks

Osmani identifies five primitives, plus one cross-cutting concern:

  1. Automations — scheduled tasks that do discovery and triage by themselves
  2. Worktrees — isolated checkouts so parallel agents don't step on each other
  3. Skills — codified project knowledge the agent reads instead of guessing
  4. Plugins / Connectors — MCP-based bridges to real tools (issue trackers, CI, Slack)
  5. Sub-agents — separate agents for ideation, implementation, and verification

Plus State — a markdown file or board that lives outside any single conversation and tracks what's done and what's next. The agent forgets between runs; the repo doesn't.

For the full breakdown with concrete examples across Codex and Claude Code, see Addy Osmani's definitive article.

#Relationship to Other Disciplines

Loop engineering sits one floor above harness engineering. The harness equips a single agent run — tools, rules, context. The loop keeps poking agents on a schedule, spawning helpers, feeding itself state, and deciding what to do next.

#Sources