Stop writing prompts. Design the loop that writes them.
Practical patterns and CLI tools for building control systems that prompt and orchestrate AI coding agents so you don't have to.

What it does
Loop Engineering is a collection of design patterns, starter templates, and three small CLI utilities (loop-audit, loop-init, loop-cost) that help developers build autonomous loops around AI coding agents like Grok, Claude Code, and Codex. Instead of typing prompts manually, you define a recursive goal—triage, dependency updates, CI cleanup—and the system iterates with sub-agents, verification gates, and external memory until it finishes or hands off to you. It is essentially an ops manual and scaffolding kit for agentic automation.
The interesting bit The project treats “prompting” as a systems-design problem rather than a craft skill. It breaks every loop into six primitives—scheduling, worktrees, skills, MCP connectors, sub-agents, and durable memory—and maps how each tool (Grok vs. Claude Code vs. Codex) implements them, so you are not locked into one vendor’s flavor of autonomy.
Key highlights
- Seven documented patterns (Daily Triage, PR Babysitter, CI Sweeper, etc.) with defined cadences, starter kits, and week-one maturity targets.
- Three npm-distributed CLI tools for auditing loop readiness, scaffolding starters, and estimating token spend.
- Explicit safety documentation including failure modes, anti-patterns, multi-loop collision guides, and a phased rollout rubric (L1 report → L2 assisted → L3 unattended).
- Cross-tool primitive matrix comparing Grok, Claude Code, and Codex capabilities side-by-side.
- The repository dogfoods its own patterns via GitHub Actions workflows and a self-describing
LOOP.md.
Caveats
- Token costs can explode with sub-agents and tight cadences; the README warns that “unattended loops make unattended mistakes.”
- Verification and comprehension debt remain your responsibility—loops can ship conflicting or incorrect work if you are not reviewing outputs.
- The README admits that two people can run the same loop and get opposite results, so consistency is not guaranteed by the framework alone.
Verdict Worth bookmarking if you are already using AI coding agents and want to move from ad-hoc prompting to scheduled, governed automation. Skip it if you are looking for a single-click SaaS; this is a design reference and scaffolding toolkit, not a managed service.