Reference · Cheat sheet

Loop anatomy

One page. Print it. The eight steps, and the checks before you let one run unattended.

The cycle

  ┌─────────────────────────────────────────────┐
  │                                             │
  │   1. AUTOMATION fires on a cadence          │
  │              │                              │
  │              ▼                              │
  │   2. SKILL reads CI, issues, commits        │
  │              │                              │
  │              ▼                              │
  │   3. STATE file records the findings  ◄──┐  │
  │              │                           │  │
  │              ▼                           │  │
  │   4. WORKTREE opens per finding          │  │
  │              │                           │  │
  │              ▼                           │  │
  │   5a. SUB-AGENT drafts the fix           │  │
  │   5b. SUB-AGENT (different) verifies it  │  │
  │              │                           │  │
  │              ▼                           │  │
  │   6. CONNECTORS open PR, update ticket   │  │
  │              │                           │  │
  │              ▼                           │  │
  │   7. Leftovers → YOUR triage inbox       │  │
  │              │                           │  │
  │              └───────────────────────────┘  │
  │            8. tomorrow resumes from state   │
  └─────────────────────────────────────────────┘

Pre-flight checklist

CheckWhy
State file exists and has a do not retry sectionStops the loop repeating a known bad path every morning
The verifier is a different agent, told it did not write the codeA model grades its own work too kindly
Every stopping condition is machine-checkable"Tests pass and lint is clean", not "the code is good"
Connectors are read-only for the first weekWrite access to production is not recoverable
Parallelism ≤ diffs you can honestly review per dayThe orchestration tax. You are the ceiling
Skills carry the reason, not only the ruleA future agent will otherwise decide the rule is obsolete
Token spend measured after week oneOsmani's own opening caveat. Sub-agents multiply cost
You read the diffsComprehension debt has no other mitigation

Command quick reference (Claude Code)

NeedReach for
Repeat a prompt on a cadence/loop, cron, scheduled tasks
Run until a condition is true/goal <verifiable condition>
Fire on an agent lifecycle eventhooks
Keep running after the laptop closesGitHub Actions
Isolate parallel workgit worktree add, --worktree, isolation: worktree
Write project knowledge down.claude/skills/<name>/SKILL.md
Add a verifier.claude/agents/<name>.md
Reach an external toolMCP server / connector

Source: Addy Osmani, Loop Engineering.