A TUI application for running Claude Code iteratively on design documents
Project description
ralph-py-cli
Note: this is a cli that allows one to run claude code in yolo mode for a given number of iterations. Use caution and other best practices when going degen mode.
A CLI tool for running Claude Code iteratively on a project until completion.
What is a Ralph Loop?
A Ralph loop automates repeated Claude Code runs against a codebase. Instead of running Claude Code once and manually re-running it to continue work, Ralph handles the iteration automatically.
Each iteration:
- Sends your plan/design document to Claude Code
- Claude works on the task and reports progress
- If the task isn't complete, Ralph starts another iteration
- Continues until the task is done, an error occurs, or max iterations reached
This is useful for larger tasks that require multiple Claude Code sessions to complete.
Installation
# Install dependencies (requires UV)
./install.sh
CLI Usage
Ralph provides two commands: run and plan.
Running the Loop
# Run with inline plan
ralph run ./my-project --plan "Build a REST API with user authentication" --iterations 5
# Run with plan from file
ralph run ./my-project --plan-file design.md --iterations 10
# With options
ralph run ./my-project \
--plan-file design.md \
--iterations 10 \
--timeout 600 \
--model claude-sonnet-4-20250514 \
--verbose
Options:
--plan, -p- Plan text describing what to build--plan-file, -f- Read plan from a file--iterations, -n- Maximum iterations to run (required)--timeout, -t- Timeout per iteration in seconds (default: 300)--model, -m- Model override for Claude Code--verbose, -v- Show detailed output
Exit codes:
0- Task completed successfully1- Error occurred (timeout, process error, etc.)2- Max iterations reached without completion
Improving a Plan
The plan command restructures your plan into small, atomic steps optimized for iterative execution:
# Improve a plan from text
ralph plan --plan "Build a web app with login, dashboard, and settings pages"
# Improve a plan from file
ralph plan --plan-file rough-ideas.md
# Save improved plan to file
ralph plan --plan-file rough-ideas.md --output optimized-plan.md
Options:
--plan, -p- Plan text to improve--plan-file, -f- Read plan from a file--output, -o- Write improved plan to file--timeout, -t- Timeout in seconds (default: 120)--model, -m- Model override for Claude Code--verbose, -v- Show detailed output
Example Workflow
- Write a rough plan for what you want to build
- Use
ralph planto optimize it for iterative execution - Use
ralph runto execute the plan iteratively
# Start with a rough idea
echo "Build a CLI todo app with add, list, and delete commands" > plan.txt
# Optimize for iterative execution
ralph plan --plan-file plan.txt --output optimized-plan.txt
# Run the loop
ralph run ./todo-project --plan-file optimized-plan.txt --iterations 5
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_py_cli-0.1.0.tar.gz.
File metadata
- Download URL: ralph_py_cli-0.1.0.tar.gz
- Upload date:
- Size: 49.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8689a13ce870903c4bc3a94656018839987a035053a39d0fa40685bb73f1d462
|
|
| MD5 |
d831c876accb15b6540866f22595e840
|
|
| BLAKE2b-256 |
a7efb365bc6e351fd2866c65f5710f90f6338f9bae9743007f90366b6bf7be0f
|
File details
Details for the file ralph_py_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ralph_py_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58ba8960f952b08ef3ad966cc3ae3d81b8202d462419caaa240dd46b2348a054
|
|
| MD5 |
01dabea4080dc8dac1fc71f64c31aacc
|
|
| BLAKE2b-256 |
99fa12101aef37919cb816c97c43563aff455186db9db78b12d12eabdd5990cd
|