running-agent-loopslisted
Install: claude install-skill Cristhianzl/claude-skills-czl
# Running agent loops
Patterns for driving work across **many steps or iterations** — possibly unattended — without the run drifting, looping, or shipping slop. The core trade is **isolation vs. continuity**: a fresh context per step avoids bleed, but you must deliberately carry forward what matters.
## Read first (always)
List `learnings/` and read anything relevant. Project-specific loop conventions, budgets, and stop signals live there and override this file.
## Principles (apply to every loop)
- **Fresh context per step beats one long context.** Each `claude -p` / subagent call starts clean — no bleed, no drift. The cost: it forgets. Bridge it deliberately (below).
- **The reviewer is never the author.** Put review/verify in a separate step/context so it isn't anchored to the implementation.
- **Two focused passes beat one constrained pass.** Don't pile negative instructions onto the implementer — add a separate **de-sloppify** pass (below). Quality from constraints decays; quality from a dedicated cleanup step doesn't.
- **Every loop has an explicit stop condition.** Bound it by max-runs, max-cost, max-duration, or a completion signal — never "until it feels done".
## The patterns (pick the simplest that fits)
| Pattern | Use when | Shape |
|---|---|---|
| **Sequential pipeline** | A known series of steps on one unit of work | implement → de-sloppify → verify → commit, each a fresh context |
| **PR loop** | Iterate a branch toward green | branch → implement → revi