Autonomous development loop with context rotation
Project description
Ralph
Stop cleaning up after your AI coding agent.
Ralph supervises Claude Code (and other agents soon) to actually finish what they start. When Claude loses track, declares "done" prematurely, or forgets earlier decisions -- Ralph catches it.
Who This Is For
- You use Claude Code or similar AI coding tools
- You're building real projects, not just experimenting
- You've been frustrated by half-finished AI output
- You want better results, even if it costs more tokens
Quick Start
-
Install and initialize
pipx install ralph-loop ralph init
-
Describe what you want built (in PROMPT.md)
# Goal Add a contact form that emails submissions to me. # Success Criteria - [ ] Form has name, email, message fields - [ ] Validates email format before sending - [ ] Shows success message after submission - [ ] Emails go to contact@mysite.com
-
Let Ralph supervise the build
ralph runRalph keeps Claude working until all criteria are actually met. Verified 3 times to make sure nothing was missed.
How It Works
Claude Code is powerful, but on bigger tasks it can:
- Lose context as the conversation grows
- Forget decisions made earlier in the session
- Declare "done" when things clearly aren't
Ralph solves this by breaking big tasks into fresh-context chunks.
After each chunk, Ralph:
- Saves what Claude learned and accomplished (so nothing is lost)
- Starts a fresh session (so context stays clean)
- Hands off the state (so Claude picks up where it left off)
When Claude says "done", Ralph doesn't just trust it. It verifies 3 times with fresh eyes. If anything was missed, work continues.
Result: Tasks that used to fail halfway through now complete reliably.
The Tradeoff
Ralph uses more tokens than running Claude directly. Each rotation is a fresh API call, and verification adds more.
But: You'll spend less time debugging, less time re-prompting, and less time cleaning up half-finished work. For many tasks, the extra tokens are worth it.
Commands
| Command | Description |
|---|---|
ralph init |
Initialize Ralph in the current directory |
ralph run |
Supervise Claude until the goal is complete |
ralph inspect |
Inspect a running Ralph session |
ralph status |
Show current progress |
ralph reset |
Start fresh |
ralph history |
View logs from previous sessions |
ralph --version |
Show installed version |
ralph --about |
Show comprehensive explanation (useful for AI agents) |
Configuration
The .ralph/ directory contains local state and should not be committed:
# .gitignore
.ralph/
Documentation
- Getting Started - Full setup guide
- Writing Effective Prompts - Get better results
- Troubleshooting - When things go wrong
- Full Documentation - Everything else
Built By
Ralph was created by Ilja Weber to solve my own frustrations with AI coding agents declaring "done" too early.
Follow for updates:
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ralph_loop-0.5.0.tar.gz.
File metadata
- Download URL: ralph_loop-0.5.0.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9b0897b38ff1f77bf33da61f8cd3a2e774da57b1cbe656dc952985b4b9896e6
|
|
| MD5 |
56d13e1853aa86d5333ecb37d428f0a6
|
|
| BLAKE2b-256 |
7d1ed9b148478bbed611cf10f3c7654c96161edf522b955c425f452f5e9c7434
|
Provenance
The following attestation bundles were made for ralph_loop-0.5.0.tar.gz:
Publisher:
publish.yml on iwebercodes/ralph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ralph_loop-0.5.0.tar.gz -
Subject digest:
f9b0897b38ff1f77bf33da61f8cd3a2e774da57b1cbe656dc952985b4b9896e6 - Sigstore transparency entry: 1350856096
- Sigstore integration time:
-
Permalink:
iwebercodes/ralph@61fe4139a9f42d000497d2b50b39836d0620ec13 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/iwebercodes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61fe4139a9f42d000497d2b50b39836d0620ec13 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ralph_loop-0.5.0-py3-none-any.whl.
File metadata
- Download URL: ralph_loop-0.5.0-py3-none-any.whl
- Upload date:
- Size: 48.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7490639ffe5468801231fbccf54f21f00c5e4e91e5f976ae5831cdfaf1172cca
|
|
| MD5 |
36ea76fba8fa66394710cfe530d10f55
|
|
| BLAKE2b-256 |
7598de28fd08d559e9e71959db657909473c559bbe2dbd8c6d48d1f33ee59809
|
Provenance
The following attestation bundles were made for ralph_loop-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on iwebercodes/ralph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ralph_loop-0.5.0-py3-none-any.whl -
Subject digest:
7490639ffe5468801231fbccf54f21f00c5e4e91e5f976ae5831cdfaf1172cca - Sigstore transparency entry: 1350856187
- Sigstore integration time:
-
Permalink:
iwebercodes/ralph@61fe4139a9f42d000497d2b50b39836d0620ec13 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/iwebercodes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61fe4139a9f42d000497d2b50b39836d0620ec13 -
Trigger Event:
push
-
Statement type: