Open source · Tool-agnostic · Production-ready · L3 dogfood · 7 patterns · Interactive tools

Design the system
that prompts your agents

Loop engineering moves you from "I prompt → agent responds → I prompt again" to "I design the autonomous system that discovers work, verifies results, and drives progress."

Clone a Starter → Read the Essay Primitives Matrix

Or try instantly: npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok      npx @cobusgreyling/loop-audit . --suggest

Loop Engineering
"You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents."
— Peter Steinberger
"I don't prompt Claude anymore. I have loops running that prompt Claude. My job is to write loops."
— Boris Cherny, Head of Claude Code
"Build the loop. But build it like someone who intends to stay the engineer, not just the person who presses go."
— Addy Osmani

Anatomy

What one loop looks like

You design it once. You're not prompting every micro-step.

⏱ Schedule 👁 Triage skill 📋 STATE.md 🌲 Worktree ⚙️ Implementer ✓ Verifier 🔗 MCP / PR 🧑 Human gate

Building blocks

Five primitives + memory

The same shape works in Grok, Claude Code, and Codex. Tool names differ; capabilities converge.

Scheduling

/loop, cron, automations

🌲

Worktrees

Parallel without collisions

📚

Skills

Intent written once

🔌

Connectors

MCP → real tools

🔀

Sub-agents

Maker / checker split

💾

State

Memory outside the model

Grok Build Claude Code Codex GitHub Actions

Full cross-tool matrix →

Copy & run

Production patterns

Documented loops with scheduling, skills, state schemas, verification, and honest failure modes.

Most popular

PR Babysitter

Shepherd PRs through review, CI, rebase, and merge. Human stays in the judgment seat.

⏱ 5–15m ◆ Medium risk
Read pattern → Starter →
Start here

Daily Triage

Morning scan of CI, issues, and commits. Report-only week one, then small auto-wins.

⏱ 1d–2h ◆ Low risk
Read pattern → Starter →
High frequency

CI Sweeper

React to failing checks with minimal fixes. Classify flakes. Escalate after 3 attempts.

⏱ 5–15m ◆ Medium risk
Read pattern → Starter →
Off-peak

Post-Merge Cleanup

TODOs, deprecations, and tech debt after merges. Small PRs overnight.

⏱ 1d–6h ◆ Low risk
Read pattern → Starter →
Security

Dependency Sweeper

Patch CVEs and stale deps in worktrees. Majors and denylist stay human-gated.

⏱ 6h–1d ◆ Medium risk
Read pattern → Starter →
New · Low risk

Changelog Drafter

Scan merges & commits, produce polished categorized release notes drafts. Human approves before publish. Huge leverage, tiny risk.

⏱ 1d or tag ◆ Low risk
Read pattern → Starter →
6
Patterns
8
Starter kits
L0→L3
Readiness levels
100
Audit score max

5 minutes

Get started

Clone a starter, audit your project, run report-only for one week.

terminal — minimal loop
# Scaffold starter (or copy manually)
npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok

# Score loop readiness (PRs get audit comments in CI)
npx @cobusgreyling/loop-audit . --suggest

# Grok — report only, week one
/loop 1d Run loop-triage. Update STATE.md. No auto-fix.

# Also try the new low-risk pattern
/loop 1d Run changelog-scan + draft-release-notes. Write RELEASE_NOTES_DRAFT.md. Human review only.

All starters · Design checklist · Production stories

Play with it

Interactive Pattern Picker & Readiness Simulator

Pick your pain. See the exact loop + commands. Simulate your score live.

What's hurting right now?

CI red / flaky checks
PRs stalling on review/CI
Morning chaos — what should I do?
Dependabot / CVE noise
Merge debt / TODOs piling up
Stale release notes / changelogs

Live Loop Readiness Simulator (mirrors loop-audit)

Check the boxes you already have (or plan to add). Score updates live.

10
/ 100
L0Not loop-ready — start with a starter.
Client-side approximation of loop-audit v1.4 scoring. L3 requires verifier + state + cost observability + proven activity.

Deep dives

Engineering, not hype

Failure Modes

Infinite fix loops, verifier theater, token burn — with mitigations.

Read catalog →

Safety & Guardrails

Path denylist, auto-merge policy, MCP least privilege.

Read safety doc →

loop-audit CLI

Loop Readiness Score 0–100. Know before you ship unattended.

Run audit →

Pattern Picker

CI red? PRs stalling? Morning chaos? Pick the right loop first.

Choose pattern →

Stay in control

Observability & cost

Loops should be boring and transparent. Use state files, run logs, and budgets.

STATE.md + pattern state

The durable memory spine. Every loop reads it at start and writes outcomes.

See example →

Run logs & budgets

Structured JSON per run + daily token / spawn limits. Detect problems before they explode.

See sample logs →

loop-audit on every PR

Automated Loop Readiness Score + suggestions. The reference dogfoods it.

Run it →

Ready to stop prompting?

The best loops are boring, reliable, and transparent.

Star on GitHub Contribute a pattern