How to Create Loops with Claude
This article advocates shifting from writing single prompts to designing loops—automated systems that keep AI agents working without human intervention. It breaks down a loop into six components: automation triggers, git worktrees for parallel isolation, skills (procedure manuals), connectors, sub-agents, and persistent memory files (e.g., STATE.md). The evaluator-optimizer pattern is highlighted: one agent generates, another verifies against objective gates like test suites or type checkers. Stop conditions must be checkable by external signals, not the agent's own claim. An autonomy ladder (suggest, draft, apply low-risk, full auto) helps gradually earn trust. The article also warns about token costs and the need for command allowlists in unattended loops.