Jan 2, 2026 · 5 min read
Most developers use AI agents like a chat buddy. You open a window, paste in a request ("Make the button blue"), wait for the code, paste it into your editor, fix the inevitable bugs, and repeat.
It is faster than coding by hand, but you are still the bottleneck. You have to be there. You are the human router passing data back and forth.
A new pattern called "Ralph" flips this model. Instead of a conversation, it’s a loop. You give the AI a plan, a set of tools, and a simple script. The AI wakes up, grabs the first task, finishes it, commits the code, and then restarts itself to do the next one. You go to sleep, and you wake up to a stack of completed features.
Ralph isn't a product you buy; it's a technique you use. It relies on a few simple text files and a bash script working together.
The core philosophy is Fresh Context. Long conversations make AI stupid. They get confused by their own history. Ralph solves this by wiping the agent's memory after every single task. It starts fresh every time, looking at the code as it exists right now, not remembering the mistakes it made ten minutes ago.
To make this work, you need three things:
claude).PRD.md) that lists what needs to be done.progress.txt) where the agent writes notes to its future self.Here is the exact setup you can use to run a Ralph loop on your own machine.
Create a folder in your project (e.g., ralph/) and add these files:
This is your backlog. The trick is to be extremely granular. Don't write "Build Login." Break it down so each step fits in one context window.
This is the engine. It runs the agent, captures the output, and checks if the job is done.
The most brilliant part of this architecture is the progress.txt file.
Since the agent's memory is wiped every time the loop restarts, how does it avoid making the same mistake twice? It writes it down.
If the agent tries to run a database migration in Iteration 1 and fails because of a missing library, it fixes it and writes in progress.txt: "Note: The migration command requires the 'ts-node' flag."
In Iteration 2, the new agent starts up. It has no memory of Iteration 1, but it reads progress.txt. It sees the warning. It avoids the error.
By the tenth iteration, your agent has built up a customized handbook for your specific codebase. It knows your quirky naming conventions, your testing commands, and your architecture better than a human contractor would.
Running Ralph isn't magic; it requires a new kind of engineering discipline.
npm test or npm run typecheck) that the agent can run to verify its own work before committing.rm and git commit commands while you sleep, you should run this inside a Docker container. This prevents the agent from accidentally deleting your home directory.We are moving from Copilots to Coworkers.
A Copilot helps you type faster. A Coworker takes a ticket, disappears for four hours, and comes back with a finished feature. Ralph is the first primitive version of that AI Coworker.
Your job changes from "writing code" to "managing the loop." You become the architect who writes the PRD and the reviewer who merges the PRs. The actual implementation becomes a background process, an infinite loop running quietly on a server, building your software one commit at a time.