Skip to main content

Autonomous development loop with context rotation

Project description

Ralph

Ralph - the supervisor

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

  1. Install and initialize

    pipx install ralph-loop
    ralph init
    
  2. 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
    
  3. Let Ralph supervise the build

    ralph run
    

    Ralph 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:

  1. Saves what Claude learned and accomplished (so nothing is lost)
  2. Starts a fresh session (so context stays clean)
  3. 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ralph_loop-0.6.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ralph_loop-0.6.0-py3-none-any.whl (57.3 kB view details)

Uploaded Python 3

File details

Details for the file ralph_loop-0.6.0.tar.gz.

File metadata

  • Download URL: ralph_loop-0.6.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ralph_loop-0.6.0.tar.gz
Algorithm Hash digest
SHA256 0ad8f1ca6ddb9e098133130e853f061475896fffecfb41f3f2b59eb20459eb20
MD5 d7fba91e0baa10d89bd17a3e8895a093
BLAKE2b-256 36fc0c0e67b06f4357faed4b2e3e2c1403fa3e50300ef4c30bdd3779e43a89f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ralph_loop-0.6.0.tar.gz:

Publisher: publish.yml on iwebercodes/ralph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ralph_loop-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: ralph_loop-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 57.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ralph_loop-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9e40c4b70e47e7ede8832f33f8c5962db5293a898ef7ca4d91b588ef4ea2a49
MD5 658a8577ac751658dc8ee58c9514b31c
BLAKE2b-256 430150b09af145523b3a1d744e15b73de70cd8a518cfcf75c53c31e4649327a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ralph_loop-0.6.0-py3-none-any.whl:

Publisher: publish.yml on iwebercodes/ralph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page