Ralph loop
Running the same prompt on a coding agent again and again, one task per round, until a checklist says everything is done.
What it is
A Ralph loop is a way of working where you give a coding agent a task list and run the same instruction on repeat. Each round starts a fresh session. The agent reads the list and a short progress note, picks one unfinished task, builds it, runs the checks, saves its work, and stops. Then the loop starts the next round. It's named after Ralph Wiggum from The Simpsons, for cheerful persistence.
It suits bulk work with a clear finish line: adding tests across a project, working through forty small fixes, building a feature from a written list. You can watch the first rounds yourself, then walk away once you trust the prompt. The agent needs three things to do well: a precise definition of done, automatic checks it can't skip, and a cap on how many rounds it may run.
A Ralph loop is not one long chat, because every round forgets the last and relies on the notes and saved work instead. It's also not a cron job. A cron job fires on a clock, while a Ralph loop runs until the list is finished.
How to ask for it
“I want the AI to keep working through my whole to-do list while I'm asleep until everything is done.”
“Set up a Ralph loop: each round, read TASKS.md and progress.txt, pick one unfinished task, build it, run the tests, commit, and add a note to progress.txt. Stop when every task is checked off, and cap it at 20 rounds.”
"Keep working until done" leaves open how it picks tasks, how it remembers progress, and when it stops; "Ralph loop" names a one-task-per-round routine and the prompt adds the notes file, the checks and the cap.
You've seen this in
- LMatt Pocock's write-ups of running Claude Code in a loop to take a project's test coverage from 16% to 100%
- GGeoffrey Huntley's original post that named the technique and described it as one task per loop
- AA short shell script that reruns Claude Code or Codex up to 30 times overnight, then leaves you commits to review