Loop Engineering
Loop Engineering, a skill for designing & reviewing autonomous/semi-autonomous agent loops (Claude Code, Codex, Copilot, Gemini).
Install: git clone https://github.com/maxmilian/loop-engineering
Works with Claude Code, Codex, GitHub Copilot · 29 GitHub stars
Install
git clone https://github.com/maxmilian/loop-engineeringInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →English · 繁體中文 · 简体中文 · 日本語 · 한국어
Loop Engineering — a skill for designing & reviewing autonomous agent loops
Loop engineering is the discipline that comes after prompt engineering. A prompt optimizes a single interaction; a loop optimizes the autonomous behavior that surrounds it — when an agent runs, what triggers it, how it verifies its own work, when it stops, and when it hands back to a human.
This skill gives a coding agent a battle-tested framework for two jobs:
- Design mode — build a new self-running agent / loop / background worker.
- Review mode — audit an existing loop's stopping conditions, guardrails, verification, and escalation paths.
It distills 12 sources (Anthropic's context-engineering guidance, the Ralph loop / RPI methodology, Claude Code's agent-loop docs, and the 2026 "loop engineering" writing) into seven load-bearing principles plus reference material.
Quick start (Claude Code):
git clone https://github.com/maxmilian/loop-engineering ~/.claude/skills/loop-engineering
Start a new session — that's it. (Other tools: Install.)
In benchmark testing against a no-skill baseline on deliberately tricky cases, the skill raised the pass rate from 87% → 100% while producing more consistent, cheaper answers — its edge shows up on the subtle failure modes a strong model otherwise misses (cron stale-prompt drift, blind-retry waste, missing human-gates on irreversible actions). Reproduce it →
On a weaker model (Haiku class) the lift is far larger — +16 points (74% → 90% on an 8-case subset) — which is exactly where a coverage guarantee matters most.
The seven principles (TL;DR)
- Leverage moved from the prompt to the loop — design the control flow, not one mega-prompt.
- "Done" must be machine-checkable —
tests pass✓,improve the code✗. - Verify with deterministic tools, never the agent's self-report.
- Define all exits before going live — success / failure / budget exits, no-progress detection, escalation path.
- Treat context as a finite resource — trim tool outputs; use compaction, note-taking, sub-agents.
- Use the filesystem as memory; start each cycle with fresh context.
- The hard part is verification, stopping, and escalation — not autonomy. Prefer semi-autonomous: gate irreversible/outward actions behind a human.
What's in here
loop-engineering/
├── SKILL.md # the skill itself (frontmatter + instructions)
├── references/
│ ├── loop-patterns.md # heartbeat / cron / hook / goal + Ralph loop
│ ├── context-engineering.md # compaction, note-taking, sub-agents, JIT retrieval
│ ├── review-checklist.md # per-principle diagnostic, severity-ordered
│ └── sources.md # the 12 source articles, with one-line summaries
├── evals/ # validation case library + benchmark evidence
│ ├── evals.json # 11 graded design / review / diagnose cases
│ ├── RESULTS.md # with-skill vs no-skill results, 3 iterations
│ └── files/ # input scripts the review cases point at
└── assets/ # README hero image
Similar plugs
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…
Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
Persistent Context Across Sessions for Every Agent, Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future…
Production-grade engineering skills for AI coding agents.