← ClaudeAtlas

running-agent-loopslisted

Run a multi-step or unattended agent loop safely — sequential pipelines, implement→review→fix (PR) loops, parallel fan-out, and RFC→DAG orchestration. Use when the user wants to "loop", "run autonomously", "iterate until it's done", chain `claude -p` calls, fan out parallel agents on a spec, or set up an implement→verify→commit cycle. Covers the cross-iteration context bridge and the de-sloppify pass. Not for a single one-shot task.
Cristhianzl/claude-skills-czl · ★ 5 · AI & Automation · score 80
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