Amnesia as a Feature

Ralph-style loops launch fresh workers and keep state in files. How they differ from an in-session Stop-hook plugin, and what verification and isolation they require.

Amnesia as a Feature — AI

The useful idea in Ralph-style automation is a replaceable worker with durable state outside its conversation. Repetition alone is not completion; a controller still needs verified stopping conditions and resource limits.

# Illustrative controller: helper interfaces need an implementation.
# Oracle statuses: 0 verified complete, 1 work remains, other = verification failure.
# An external supervisor must also enforce wall-clock and spend limits.
attempt=0
while :; do
  ./done_oracle.sh "$BATCH"
  status=$?
  case "$status" in
    0) exit 0 ;;
    1) ;;
    *) printf '%s\n' 'Verification unavailable; stopping.' >&2; exit 2 ;;
  esac
  if [ "$attempt" -ge 20 ]; then
    printf '%s\n' 'Attempt budget reached; work is not complete.' >&2
    exit 6
  fi
  ticket="$(./ready_set_next.sh "$BATCH")" || exit 3
  [ -n "$ticket" ] || exit 4
  ./run_one_ticket.sh "$ticket" || exit 5
  attempt=$((attempt + 1))
done

The example above is a bounded schematic with helper interfaces that require implementation. It illustrates a fresh-process controller, not a command to run forever or bypass permissions.

Separate the mechanism from the anecdotes. A new worker can reconstruct the current task from files and accepted changes. Whether that helps quality and cost depends on the work and the evidence preserved between attempts.

What Ralph actually is

The rule that makes it work is the one people skip: one task per loop. Only one. Each iteration spins up a brand-new agent with an empty context window. It remembers nothing about the last pass — not the plan, not the bug it just fixed, not what it tried an hour ago.

So how does it make progress if it forgets everything? Because the memory doesn't live in the context window. It lives on disk. Each fresh agent reconstructs the world by reading files:

  • PROMPT.md — the loop body, the same instruction every pass (“read the plan, do the next thing, run the tests, commit”).
  • specs/ — the specifications, the source of truth for what “done” means.
  • fix_plan.md — a priority-sorted list of unfinished work; the agent pops exactly one item.
  • AGENT.md / CLAUDE.md — how to build, run, and test, plus learnings the loop appends as it goes.
  • git history — the durable record of everything already done.

The repository and task records carry continuity. Those records still need provenance and validation; persistence does not make every statement left by the previous worker true.

Why amnesia beats memory

Long sessions can accumulate stale assumptions and large histories. Fresh task boundaries are one way to reduce that burden. There is no universal token count or elapsed-time threshold at which every model becomes unreliable.

A new process starts a new context, but that invocation can still load a large amount of material, fill its window or compact. The gain is a deliberate boundary between tasks, not a guarantee that context never fills.

The plugin that forgot how to forget

Anthropic’s ralph-loop plugin is an in-session adaptation. Its published README describes a Stop hook that feeds the prompt back when the agent tries to stop.

That is a different lifecycle from an external controller launching a new process. Inspect the plugin version’s stop, cancellation and iteration-limit behavior before using it.

Neither lifecycle is inherently the correct one for every task. Fresh workers repeat some reads; a retained session carries more prior context. Evaluate the tradeoff using accepted outcomes and measured usage.

What published experiments establish

A reported experiment is evidence about its stated setup. It is not an independently reproduced benchmark or a universal estimate for the next project.

EvidenceWhat it supportsWhat it does not establish
Anthropic compiler experimentThe author reports 16 agents, nearly 2,000 sessions and about $20,000 API costIndependent reproduction or a universal project budget
Official ralph-loop READMEAn in-session Stop-hook implementationFresh-process context resets
A completion sentinelA worker emitted a particular stringIndependent acceptance of the work

Anthropic’s compiler report describes a substantial experiment with a specific model, harness and test setup. Its reported cost is not a quote for an arbitrary compiler project, and it does not establish that every long-running loop has the same reliability.

The operator still owns the task

The practical requirements are a scoped specification, bounded execution and a trustworthy acceptance path.

Treat unsupported throughput, cost and completion stories as anecdotes. Prefer public repositories, test procedures, scoped measurements and stated limitations when deciding whether a technique fits your work.

An unclear specification can produce repeated plausible work without convergence. Define what the worker may change, what it must preserve and how the controller will know the result is acceptable.

The two things that make it work, and the one that wrecks you

Strip away the theater and Ralph reduces to a short list of requirements.

Use an independent verifier tied to the accepted revision. A worker-printed completion sentinel is a coordination signal, not proof. Enforce attempt, time and resource limits externally. Worktrees prevent ordinary file collisions but do not isolate the host. Container or VM boundaries depend on their mounts, credentials and network configuration, and unattended execution does not inherently require permission bypass.

Hot takes

The transferable idea is replaceable workers with durable evidence. Preserve the distinction between an in-session plugin and a fresh-process controller, and measure the result instead of borrowing another project’s headline numbers.

Sources: Official Ralph Loop README; Anthropic compiler experiment. Documentation checked September 20, 2026.