claude-loop — iterative sessions with cost tracking
An automation harness that runs repeated Claude Code sessions while tracking cost and tokens per iteration — the reference answer to the number-one objection to agent loops: runaway spend.
Implementation note
When to use: you are sold on iterative agent sessions but not on surprise bills — this harness exists specifically to answer the number-one objection to agent loops, runaway spend. Inspired by Dex Horthy's context-engineering talk. How it works: an automation toolkit that runs repeated claude sessions in a loop while recording cost and token usage per iteration, so you can see exactly what each cycle consumed rather than discovering the total afterward. The per-iteration granularity is what makes the data actionable: an iteration whose token count spikes is visible immediately, and trends across a run tell you whether the loop is converging or thrashing. Safety: measurement is the rail here — per-iteration cost visibility is what lets you set informed caps and kill a run that is trending wrong. Pair it with hard limits (iteration caps, budget ceilings), since tracking alone observes spend rather than stopping it.
More automation loops
Ship production-grade apps autonomously
Hand an idea to Claude Code; it authors specs, designs, builds, tests, secures, and ships until enterprise done or budget exhausted.
claude-progress.txt harness pattern (Anthropic)
Anthropic's first-party file-as-memory harness for long-running agents: every fresh-context session recovers state from a progress file and the git log, does one unit of work, updates the file, commits, and exits.
Complete all tasks in tasks.md
Work through your tasks.md file, completing each task until none remain or max iterations is reached.