Ralph Wiggum AI Agent Autonomous Coding Loop
by @gregeisenberg
ABOUT THIS SKILL
Ralph is a simple yet powerful AI coding loop that lets non-technical founders ship entire product features overnight by breaking work into atomic user stories with clear acceptance criteria and letting Claude Opus 4.5 iterate autonomously.
TECHNIQUES
KEY PRINCIPLES (11)
Break complex features into atomic user stories that fit within a single context window.
Each story must be completable in one Ralph iteration (≈168k tokens) to avoid context overflow and ensure clean commits.
Why: AI agents have hard context limits; oversized tasks cause hallucinations and broken code.
"each story must be completable in one Ralph iteration"
Provide self-verifiable acceptance criteria so the agent knows when a task is truly done.
Write criteria as executable tests or verifiable behaviors (e.g., 'status column added with default pending').
Why: Eliminates the need for human-in-the-loop validation every cycle, enabling overnight autonomy.
"the agent needs to have a feedback mechanism so that it knows if what it's doing is correct"
Persist learnings in agents.md files so the agent gets smarter with every mistake.
Place an agents.md in any folder; the agent reads it before editing files in that folder, then appends new insights.
Why: Turns one-off fixes into compound engineering gains across future iterations and projects.
"your agent should be getting smarter every time it makes a mistake"
Model the loop on human Kanban workflows: pull story → code → test → commit → repeat.
Ralph mimics a human engineer grabbing a sticky note, implementing, and moving it to 'done'.
Why: Decades of engineering practice prove this pattern reduces risk and increases throughput.
"this is the way humans have been coding forever. And the reason why is because it works"
Autonomous loops cost ~$3 per iteration, far cheaper than human developer time.
A 10-iteration Ralph run totals ~$30, less than a single hour of senior dev time.
Why: Shifts cost curve from human hours to cheap GPU tokens, making experimentation viable for bootstrappers.
"this was three bucks. I mean, three dollars, that's less than a latte"
Start each iteration with a brand-new context window to avoid compounding errors.
Ralph spawns a fresh Claude instance per story, seeded only by PRD.json and progress.txt.
Why: Prevents long-context drift and hallucinations that plague single-threaded agent sessions.
"you're getting a fresh loop every time. So you're getting a brand new thread or a brand new instance of CLOD code every time"
Spend disproportionate time crafting the PRD and user stories; quality in equals quality out.
Allocate an hour to writing clear, small, testable stories before starting the loop.
Why: Garbage requirements yield garbage code; the agent cannot fix vague or oversized tasks.
"you should spend an hour on this, right? It's very, very, very important that you get your PRD right"
Connect the agent to a real browser for front-end acceptance testing.
Use a Dev Browser skill so the agent can click, assert, and screenshot UI elements.
Why: Front-end stories require visual validation; headless or mock testing misses real-world bugs.
"figure out how to connect your agent to a browser, right? ... this allows AMP or Cloud Code to actually use your browser and test"
WHAT'S INSIDE
This is a structured knowledge base — not a prompt file. Your AI retrieves principles semantically, understands the reasoning behind each technique, and connects to related skills via a knowledge graph.
Compatible with OpenClaw · Claude · ChatGPT
principles · semantic retrieval · knowledge graph
Free during beta · Sign in to save to dashboard