Home
Ralphify runs ralph loops.
A ralph loop is a portable directory that defines an autonomous agent loop — a prompt, the commands to run between iterations, and any files the agent needs. It's an open format (ralphloops.io): a directory whose one required file is RALPH.md. Ralphify is the CLI that runs it.
grow-coverage/
├── RALPH.md # the loop definition (required)
└── check-coverage.sh # a command that runs each iteration
---
agent: claude -p --dangerously-skip-permissions
commands:
- name: coverage
run: ./check-coverage.sh
---
Each iteration, write tests for one untested module, then stop.
## Current coverage
{{ commands.coverage }}
Each iteration starts with a fresh context window and current data — ralphify runs the commands, fills in the {{ placeholders }}, pipes the prompt to your agent, and loops.
Works with any agent CLI. Swap claude -p for Codex, Aider, or your own — just change the agent field.
Get Started The ralph loops format
Install¶
The five things you do with ralphify¶
Everything in ralphify is one of these five jobs. That's the whole tool.
-
1. Write a ralph
Scaffold a directory with a
RALPH.md— YAML frontmatter for config, a markdown body for the prompt. The only required field isagent; addargsto parameterize the loop with{{ args.<name> }}. -
2. Feed it live data
commandsrun each iteration; their output fills{{ commands.<name> }}in the prompt. The agent always sees current test results, coverage, and git log — a self-healing feedback loop. -
3. Run the loop
ralph runassembles the prompt, pipes it to your agent, and repeats with fresh context. Loop untilCtrl+Cor cap it with-n. -
4. Steer it while it runs
The prompt is re-read every iteration. Edit
RALPH.mdmid-run and the agent follows your new rules next cycle. When it does something dumb, add a sign. -
5. Share and install ralphs
A ralph is a portable directory in the ralph loops format. Version it in git, share it, install it from GitHub with agr.
Why loops¶
A single agent run fixes a bug or writes a function. The leverage of a ralph loop is sustained, autonomous work — running for hours, one commit at a time, while you do something else.
- Fresh context, no decay. Each iteration starts with a clean context window. The agent reads the current state of the codebase every loop — no conversation bloat, no degradation.
- Commands as feedback. Command output feeds into the prompt each iteration. When tests fail, the agent sees the failure and fixes it next cycle.
- Steer with a text file. Edit
RALPH.mdwhile the loop runs to redirect a running agent. - Progress lives in git. Every iteration commits.
git logshows what happened;git resetrolls it back.
Requirements¶
- Python 3.11+
- Claude Code CLI (or any agent CLI that accepts piped input)
Next steps¶
- Getting Started — from install to a running loop in 10 minutes
- How it Works — what happens inside each iteration
- Cookbook — copy-pasteable ralph loops to start from
- The ralph loops format — the open spec ralphify implements