ralph-code
Automated task implementation with Claude Code and Codex for "Ralph Coding". What is Ralph Coding? It's a method of coding where context rot is avoided by controlling the retention of information. This method involves re-invoking claude or codex for each task, and passing information about the requirements, acceptance testing, and any progress that's made (or roadblocks/challenges faced) through files, rather than retaining all prompts + thinking + response tokens. It tends to result in more requests, some duplicated token work, but fairly consistent performance, and best of all it can largely be done unattended. Ralph now defaults to continuing past PRD-to-task conversion instead of pausing there, and non-interactive harness calls are bounded by timeouts and turn caps so stuck agent runs fail fast instead of hanging forever. Recommend Claude Max account or codex equivalent, but be aware that GPT-5 - GPT5.2's slow reasoning and response makes this ponderous, it's fine overnight.
Because LLMs are carrying out the work, we can specify a job of "Find all the python files in the project that directly or indirectly access sqlalchemy objects, and upgrade the code to work with sqlalchemy 2.* This will result in probably a single-task project, but that one task might add 50 other tasks (on per file) to the backlog, which are then processed sequentially."
Installation
pipx install ralph-code
Or with pip:
pip install ralph-code
Usage
ralph [OPTIONS] [DIRECTORY]
Recent changes
Version 0.6.3 includes:
- Safer git integration for staged-file commit checks
- Correct staged diff generation
- Deduplicated unstaged file reporting
- Clearer errors when
gitis not available
Version 0.6.2 includes:
- Bounded non-interactive harness execution with timeout and turn limits
- Structured
tasks.jsongeneration for more reliable PRD conversion - Automatic continuation after task generation by default
PRDs/as the standard task directory, with legacyPRD/compatibility- Refreshed model catalogs and current defaults
Options
--debug: Enable debug logging, logs are saved into the .ralph subdirectory of the projectDIRECTORY: Target project directory (defaults to current directory)
Usage
First create a task in PRDs/, give a short name for the task (used for the branch commits will be added to), and then give a description.
Then you run ralph, it will produce a .md file of the specifications, which will be broken into small tasks put into a tasks.json file. Each task will be worked on independently.
Requirements
- Python 3.10+
- Claude Code or Codex CLI installed and configured
License
MIT
Release files for ralph-code 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ralph_code-0.6.3.tar.gz | 88.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ralph_code-0.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 153.5 kB
Release files / ralph_code-0.6.3.tar.gz
| Download URL | ralph_code-0.6.3.tar.gz |
|---|---|
| Size | 88.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e35a96b81d4728012e47db96ceb2e547521a79e65e0a61640a668bd76d82fb93
|
|
BLAKE2b-256 checksum How to use checksums |
8ff138af9b1d207db0b99365ee05846448fdd6a5bd16c02471d1bdb3da6f6840
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / ralph_code-0.6.3-py3-none-any.whl
| Download URL | ralph_code-0.6.3-py3-none-any.whl |
|---|---|
| Size | 65.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0de9f90a358cb6a5e505d741340de49e72b1eb769e0ea9182663b79508a039d
|
|
BLAKE2b-256 checksum How to use checksums |
92a307a96b41c564224099cbb5f965c274b8b5db90f5dcad5a62dec0e1aab92a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|