Overnight Autonomous Build — Structure Research¶
Date: 2026-06-09 Purpose: how to run the Argus build with ~0 human interaction overnight, and where Fable 5 fits.
The proven structure: the Ralph loop¶
Geoffrey Huntley's "Ralph" is the canonical unattended-build pattern, now with several Claude Code implementations. Core idea:
while :; do cat PROMPT.md | claude -p --dangerously-skip-permissions ; done
Fresh context every iteration; the filesystem (not conversation history) is the memory. One task per loop.
Filesystem-as-memory files:
- PROMPT.md — the standing instruction, reread every loop.
- fix_plan.md — priority-sorted checkbox todo of remaining work; empty = done. (This is what writing-plans should produce.)
- AGENT.md / CLAUDE.md — build/test procedures the agent discovers and updates as it learns.
- specs/* — the specifications anchoring generation (our design spec + memory research).
Why it fits Argus: Huntley is explicit that Ralph is for greenfield, single-repo work ("no way in heck would I use Ralph in an existing codebase"; "stick to monolithic single-process Ralph in one repo"). Argus is greenfield and we just chose a self-contained single repo — ideal Ralph conditions. (Validates that decision.)
Production guardrails (from frankbria/ralph-claude-code)¶
- Dual-gate exit: loop exits only when completion indicators ≥2 AND the agent explicitly emits
EXIT_SIGNAL: true. Heuristics alone never exit. - Circuit breaker: opens after 3 loops with no file changes or 5 loops repeating the same error → stops spinning; auto-recovers after cooldown.
- Rate-limit handling: detects the Claude 5-hour cap; unattended mode auto-waits. (We do better — see F12 fallback below.)
- Progress tracking: git commits per loop, file-change monitoring,
fix_plan.mdcheckboxes (items under "Optional/Future" don't block exit), per-loopmetrics.jsonl. - Timeouts: per-call (default 15 min) + session expiry (24h).
Critical gotchas → how we counter them¶
- Search non-determinism — agent misses existing code, assumes not-implemented. → Prompt: "search before changing, use subagents, don't assume."
- Placeholder implementations — LLMs write minimal stubs to satisfy compilation. → "NO PLACEHOLDERS — full implementations."
- Context clipping — 200k degrades ~147–152k. → one task per loop; subagents for expensive reads.
- TDD self-deception — agent writes tests that confirm its own broken assumptions (code wrong in the same direction as tests). → protected tests (can't modify a test to make it pass without a gate), plus independent verification, not just agent-written tests. (This is literally Argus's verifiability thesis applied to its own build.)
- Build/test races — serialize build+test (one runner) while parallelizing search/writes.
- Irreparable break — operator resets (
git reset --hard) in the morning; keep commits frequent so reset points exist.
Fable 5 (launched today, 2026-06-09)¶
Anthropic's first public Mythos-class model, purpose-built for long-horizon autonomous coding — "agentic tasks that last days," plans its approach, checks progress against the goal, and refines as it goes. 80.3% SWE-Bench Pro; $10/$50 per M tokens. This is literally the model class for an overnight build.
Honest status: it's hours old — there are no public "I ran an overnight Ralph with Fable" reports yet, only launch announcements + benchmarks. We'd be early adopters. Upside: Fable's built-in plan/check/refine reduces reliance on the external loop (it does more long-horizon work in-context); the Ralph scaffolding (fresh-context, fix_plan, circuit breaker, protected tests) still applies as the safety net.
What this means for the Argus plan¶
writing-plansshould output a Ralph-readyfix_plan.md: priority-sorted, checkbox, one independently-testable item per loop, each with its TDD gate.- Add an
AGENT.mdin the repo (build/test commands; the agent updates it as it learns). - Bake guardrails into
PROMPT.md: no-placeholders, search-before-assume, serialize build/test, protected tests, explicit halt-and-alert conditions, and the F12 runtime fallback (Fable/Anthropic → Codex → local) so a rate-limit falls over instead of just waiting. - Harness: the local
ralph-loopskill (or aralph-claude-code-style runner) + superpowersexecuting-plans. Run in a git worktree; commit every loop. - Realistic expectation: "0 human interaction" means wake up to mostly-built + a morning review/reset, not literally zero touch. Greenfield + tight spec + protected tests is what makes it work.
Loop mechanisms (verified on this box) — corrects an earlier conflation¶
Three distinct things, with different context behavior:
/loop— BUILT-IN Claude Code command (no skill file; backed byScheduleWakeup). Runs a prompt/command on an interval or self-paced. Keeps conversation context across iterations. For recurring tasks/polling, not fresh-context builds./ralph-loop— PLUGIN (claude-plugins-official). A Stop hook intercepts the exit attempt and feeds the same prompt back, in the current session (context accumulates → relies on compaction). Flags:--max-iterations N(primary safety) +--completion-promise "TEXT"(exact-string completion; the agent must NOT emit it falsely). Greenfield + clear criteria + auto-verification.- External bash Ralph (
while :; do cat PROMPT.md | claude -p; done) — spawns a NEW process each loop → fresh context every iteration, filesystem is the only memory.
Correction: "fresh context per iteration" is ONLY the external bash form. /loop and /ralph-loop keep/accumulate context and lean on compaction + filesystem state. With Fable's long-horizon design, in-session + compaction is fine — so /ralph-loop is the right engine for us (and it matches Anthropic's pattern below).
Anthropic's long-running-agent harness (authoritative best practices)¶
From Anthropic's engineering guide — the gold standard for a Claude/Fable build:
- Two prompts, one model: an initializer (runs once — scaffolds env, git repo,
init.sh, the structured feature list, a progress log) + a coding agent (runs repeatedly, one feature at a time). Different prompt for first vs. subsequent sessions; NOT different models. - Filesystem as durable state:
claude-progress.txt(running log),feature_list.json(structured requirements, each"passes": false),init.sh(reliably start the dev server), git history. - Session-init ritual every loop:
pwd→ read progress → reviewgit log→ consult feature list → runinit.sh→ baseline smoke tests → only then new work. (Detects stale/broken state; "never infer what happened — it's all in files + git.") - Protected tests, concretely: the agent may only flip
passestrue/false — "it is unacceptable to remove or edit tests." This is the anti-self-deception gate. - End-to-end verification: verify as a user would (browser automation / real API calls), not just unit tests — Anthropic reports this "dramatically improved" results and is what stops "marked done but doesn't work."
- Self-verify before
passes=true, then commit + update progress. Notably Anthropic did not use a separate maker/checker agent — self-verification with real tools sufficed (they flag single-vs-multi-agent as an open question). - Test infra must exist FIRST — no test runner = the agent has no signal and spins. So M0 stands up the harness before any feature.
- Escape hatches: always cap iterations; on stuck, document the blocker rather than blind-retry (blind retry = the #1 failure mode).
What this means for our plan: writing-plans should output the Anthropic-harness shape, not just a markdown fix_plan: a structured feature_list.json (each item = concrete verification steps + passes flag, tests protected) + init.sh + a claude-progress.txt convention + the initializer and coding prompts. Engine = /ralph-loop with --max-iterations + a completion promise. That drops straight into an overnight Fable run.
Sources¶
- Ralph technique — ghuntley.com/ralph, ghuntley.com/loop
- Claude Code implementations — github.com/snarktank/ralph, github.com/frankbria/ralph-claude-code, github.com/snwfdhmp/awesome-ralph
- Overnight Claude Code best practices — thenewstack.io, sitepoint.com (2026), dev.to autonomous TDD
- Fable 5 — github.blog changelog (2026-06-09), azure.microsoft.com, digitalapplied.com agentic-coding deep dive, aboutamazon.com (Bedrock)
- Anthropic — Effective harnesses for long-running agents (authoritative): anthropic.com/engineering/effective-harnesses-for-long-running-agents
- ralph-loop plugin (claude-plugins-official) — local:
~/.claude/plugins/.../ralph-loop - 2026 best-practices roundups — kilo.ai/articles/beyond-autocomplete, lushbinary.com loop-engineering