Ralph with circuit-breaker exit detection
A safe Ralph variant that solves runaway loops with circuit-breaker heuristics: it halts automatically when iterations stop producing file changes or keep hitting the same error.
Implementation note
When to use: unattended Ralph runs where the failure mode that scares you is the runaway — a loop that spins for hours making no progress or repeating the same error while the bill grows. How it works: a standard Ralph loop wrapped with two exit heuristics that watch the loop from outside. No file changes for three consecutive iterations means no progress is being made, so it stops. The same error appearing five consecutive loops means the agent is stuck, so it stops. Both are cheap, observable signals that need no model judgment to evaluate. Safety: the circuit breakers are the whole point — they convert the two classic runaway shapes, idle spinning and error loops, into automatic halts instead of morning surprises. They bound waste rather than damage: the iterations that do run still change files and commit, so the usual sandbox, branch, and review discipline still applies underneath.
Source: frankbria/ralph-claude-code ↗
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.