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.

prompt
→ Claude
Ralph loop wrapped with exit heuristics: no file changes for 3 consecutive iterations = no progress → stop; same error 5 consecutive loops = stuck → stop.
claude-code

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

Run workflows with dynamic sub-agents

/goalnew

Split a task into packets, run sub-agents in parallel, synthesize results, and verify completion.

prompt
→ Claude
/goal loop and verify until complete
automationlow risk

Run agent turns until goal met

/goalnew

Agent executes repeated turns toward a condition, with a lightweight evaluator checking progress after each turn until the goal is reached.

prompt
→ Claude
/goal <condition turns a prompt into a durable objective. Thanos immediately starts a turn toward the condition, and after each turn a fresh, tool-less side-channel evaluator (a one-shot completeSimple call, not a subagent — so no extra agent turn and no re-entrancy) reads the last turn's evidence and returns MET / NOT MET . NOT MET auto-continues another turn with the reason as guidance; MET clears the goal and records the achievement. Unparseable evaluator output is treated as NOT MET (fail-safe: it never declares a false "done
automationmedium risk

Run agent until goal met

/goalnew

Queue agent turns with goal context until your objective is achieved, treating the goal as untrusted data.

prompt
→ Claude
/goal <objective , after /goal resume , and after every agent turn that leaves the goal active , the extension queues Codex's goal continuation prompt as hidden model-visible context. The objective is XML-escaped and wrapped as untrusted user data so it does not become higher-priority instructions
automationlow risk