AI Systems & Agents
The Ralph Loop: how I stopped babysitting AI and shipped a real product.
Standfirst: No fancy framework. No magic prompt. Basic software planning pointed at an LLM instead of a junior developer — and the first time AI did the heavy lifting for me.
After a year of doing AI’s homework for it (part 1), I kept hearing people who seemed to know where AI was heading get excited about something called a Ralph loop. Named after Ralph Wiggum from The Simpsons. I’m not joking.
The idea is almost stupidly simple
You write a proper PRD with clear acceptance criteria. You convert it into a JSON file. You drop it in a folder and tell the AI: don’t come back until it all passes.
That’s it. The loop keeps the agent iterating against the criteria until the evidence says done. No framework. No secret prompt. Just basic software planning aimed at an LLM instead of a junior developer.
I came home from the gym, got Claude Code to teach me the technique, installed it, and ran my first loop that evening.
The first build worked. Two things drove me mad.
The first build was a simple image tool — upload a headshot, get back a business headshot with a new background. It worked. A proper, functioning app. That alone was new.
But the loop burned tokens like nothing I’d seen; I’d sit for hours waiting for session limits to reset. And I didn’t know full-permission mode existed, so the agent asked before every action, and I sat there pressing yes. Yes. Yes. Yes. Still babysitting — just with a better outcome at the end.
Tuning the loop
Three changes turned a party trick into a delivery system:
- Full-permission mode. One setting, and the loop became autonomous enough to set off and walk away from.
- Agent per task. The stock setup only ran Claude Code. I had it modified so I could pick the coding agent per build — Claude for frontend, Codex for scaffolding and database.
- Model routing at planning time. While writing the PRD, Claude assessed each user story: best model for it, and which stories could run in parallel. The loop read that plan, dispatched the right agent per story, and spread the token burn across two providers’ session limits instead of one.
Then I pointed it at something real
DramMaster — the whisky education platform I’d been circling for months, and the project that had died at 15 distilleries in my copy-paste era.
Thirteen sprints. Fifteen evenings. Security, authentication, database, APIs, a quiz engine, flashcards, 96 lessons, an interactive map of Scottish distilleries, and an AI mentor called Isla, locked to a RAG database so she can only answer whisky questions.
The daily routine was simple and brutal. Evening: refine the PRD, fix bugs, convert to JSON, set Ralph off before bed with the iteration limit doubled so it could work through problems overnight. Morning: check whether it finished, test before work. UAT in the evening. Repeat.
By Christmas I had a working product. Not a Notion page — a real, deployed website. It’s live.
Why it worked (and it’s not an AI insight)
I’ve been in tech for nearly 30 years. I know what a good PRD looks like because I’ve been on the receiving end of bad ones for most of my career.
The Ralph loop worked because I stopped treating AI like a chatbot and started treating it like a developer who needed a proper spec. That’s not an AI trick. That’s a project management one — and it means the people best placed to get real work out of agents aren’t prompt engineers. They’re people who already know how to define done.
For the first time, I was orchestrating instead of copy-pasting. I felt like I had a dev team that worked while I slept.
Then I watched a video about an AI lobster, and everything changed again.
Next in the series: What running an open-source agent at home taught me — the hard way →
Following along?
I publish these as I go — every experiment, including the expensive dead ends. Get the next one by email, or connect on LinkedIn where these start as posts.