Ralph Loop
An autonomous build loop: iterate over spec files, invoke an AI agent per spec, assemble the whole system.

A Ralph Loop is a bash loop that walks through spec files one at a time, hands each to an AI agent (Claude Code), and lets the agent build that component autonomously. When it finishes, the loop advances to the next spec. Three rules: single-spec scoping (the agent sees only ONE spec, not the whole project), error tolerance (no set -e : failure on one spec doesn’t abort the loop), and throwaway-first (the loop builds what’s described; production architecture comes later). Distinct from a Karpathy Ratchet: the Ralph Loop builds new things, the ratchet improves existing ones.
How It Works
Write ordered spec files → bash script iterates → for each spec, invoke claude --no-confirm < spec.md → agent builds, commits, exits → loop advances. Anti-dependency bias: reference file paths in specs, never paste content inline.
Example
The Kiro CLI Factory was the first Ralph Loop: a multi-component system scaffolded entirely by Claude Code iterating over spec files with zero human intervention. The key discovery was prompt anti-dependency bias : inline content caused agents to inject unnecessary dependencies. Detailed in Ralph Loop: Autonomous Build.