ralph-workflow — the AI agent orchestrator and software factory
The operating system for autonomous coding.
Multiple coding agents. Separate worktrees. One mainline.
Coding agents write code fast. The handoffs around them cap throughput: babysitting sessions, resolving conflicts, re-running checks, waiting in review queues.
Ralph Workflow is a free, open-source AI agent orchestrator and software factory for developers and teams who already have a coding agent: you supply the specification and the checks you trust, and it runs plan, build, verify, and fix as a configurable workflow graph across Git worktrees, returning integrated, checked software on one mainline. At the core is the simple Ralph loop: plan → build → verify → fix. Around it: agent review, retries, fallback agent chains, durable handoffs, interruption recovery, and Git integration.
The factory terms are literal: your specification and checks are the input, phases are the stations, your checks are the quality gates, agent chains are the interchangeable workers, worktrees are the parallel lines, and integration is shipping to the mainline. See concepts.
Ralph Workflow manages the harness, not the models. A harness of harnesses: coding agents such as Claude Code, Codex, and Cursor are harnesses around models, and Ralph Workflow is the workflow, review, recovery, and Git layer around those agents. There is no vendor lock-in: nine built-in agent backends ship with it, and agent chains can mix them and fall back to the next when an attempt fails. Switching or combining vendors is a configuration change, not a rewrite. Ralph Workflow needs no API key of its own and sells no model access; it launches the agent CLI you installed and authenticated, so whatever login or subscription that agent supports is what runs. Each agent defines its own authentication (a login, an API key, or either), and the agent's vendor determines model access, rate limits, and cost.
Every default ships with the package (workflow, agent chains, tools,
artifact contracts, retries, recovery, Git sync), and ralph --init seeds
your setup, so there is no setup project before the first useful run:
productive on day 1, preconfigured, and yours to tweak. See the
bundled defaults.
It runs on your machine: local, free, AGPL-3.0-or-later, no account, no hosted service, and no metering from Ralph Workflow. Your specifications, configuration, and Git history stay yours. Run one agent by hand and you are the scheduler, reviewer, and merger; run a plain loop and it repeats one prompt; Ralph Workflow runs the graph for you and lands checked work on one mainline. Move beyond pull requests: review and integration happen inside the execution graph. You define the outcome and the checks; Ralph Workflow runs the workflow; you judge the software.
It fits work with a clear finish line and checks you trust; it is not (yet) for open-ended exploration or repositories with no reliable tests or checks. If that is your repository, build the finish line first: write down what "done" means and add a test or check you trust, then come back.
Install
Requirements: Python 3.12 or newer, Git, pipx, and one coding agent
CLI you have already installed and authenticated.
pipx install ralph-workflow
ralph --version
pip install ralph-workflow in a Python 3.12+ virtual environment also
works.
From a source checkout instead? See CONTRIBUTING.md.
First run
New to Ralph Workflow? START_HERE.md walks through a first serious run.
In the git repository you want Ralph Workflow to work on:
ralph --init # user-global config, starter PROMPT.md, detected agents
ralph --list-agents # the configured agents
ralph --diagnose # pre-flight checks, every line should be green
Then edit PROMPT.md: state the outcome and the checks you expect, and
remove the <!-- ralph:starter-prompt ... --> marker at the top.
Ralph Workflow refuses to run while that sentinel remains. A small first
task looks like this:
# Goal
Reject an empty email address in the signup validator with a clear error.
## Acceptance criteria
- An empty email is rejected before a user record is created.
- Valid signup behavior and public interfaces stay unchanged.
- Tests cover both the rejected input and a valid signup.
## Verification
- Run python -m pytest and fix any failures.
Start the run with ralph. A successful first run completes with the
changes committed in a worktree and either integrated onto the mainline or
reported with the evidence it produced. Then read the summary of what
changed and which checks passed.
Built-in agent backends
Nine backends ship with Ralph Workflow. Authenticate the CLI yourself; Ralph Workflow uses each agent's own login or key. For Cursor and AGY, which run in a private per-run home, it copies your existing local login files into that home so the agent can use them; see the agent CLI lifecycle.
| Backend | CLI | Authentication | Transport and caveats |
|---|---|---|---|
| Claude Code | claude |
claude login or an Anthropic API key |
Interactive PTY; the reference agent. |
| Claude Code (headless) | claude |
Same as claude |
Same binary without a PTY. |
| Codex | codex |
codex login or an OpenAI API key |
Unattended codex exec; no session resume. |
| OpenCode | opencode |
Provider-specific keys | Headless subprocess; model selection uses -m <provider>/<model>. |
| Nanocoder | nanocoder |
Local-only TUI, no remote auth | Local-only TUI; a provider is required for model aliases. |
| AGY (Google Anti Gravity) | agy |
agy login with a Google account |
PTY transport; agy/<model> is checked against the live agy models listing (no built-in list); if that listing fails, Ralph Workflow warns with the AGY error and uses the configured model as written. |
| Pi | pi |
Provider configuration | Headless pi --mode json <prompt>. |
| Cursor | agent |
CURSOR_API_KEY or a file-backed login |
Headless --print; credentials come from file, not the Keychain, unless AGENT_CLI_CREDENTIAL_STORE=memory is set explicitly. If no valid Cursor auth file exists, Ralph Workflow copies your existing Cursor IDE login into Cursor's file-backed auth paths. |
| Kimi Code | kimi |
an interactive kimi login wires the managed:kimi-code subscription provider |
Headless; -m needs a fully configured model ID from ~/.kimi-code/config.toml. |
Model strings differ per agent: see agent compatibility.
Independent work, shared mainline
Each run works in its own Git worktree and syncs with the configured
mainline at startup, after commits, and at phase boundaries. Integration
rebases the feature onto the mainline, routes conflicts to a resolution
agent chain, falls back to an endpoint merge when resolution fails, and
fast-forwards the mainline to the landed tip once Git proves the
integration finished. Local integration is on by default with main as
the default target; remote sync publishes to the configured remote when
one exists and can be turned off for local-only operation; recovery state
is durable, so an interrupted run resumes where it stopped.
Two limits: branch protections and required checks still apply, and
Ralph Workflow does not bypass them. And the worktree holding main is
integration infrastructure: Ralph Workflow may snapshot its uncommitted
content to a recoverable ref and reset the worktree. Keep active edits in
feature worktrees. Details: auto-integration.
Make it yours
| File | What it configures | Reference |
|---|---|---|
ralph-workflow.toml |
agent chains, retries, and Git sync | Configuration reference |
pipeline.toml |
phases, routing, and loopbacks | Pipeline configuration |
mcp.toml |
MCP tool servers and web access | MCP configuration |
artifacts.toml |
artifact contracts and output types | Artifact configuration |
User-global (~/.config/) and project-local (.agent/) are separate
scopes: ralph-workflow.toml keeps one name in both, while pipeline.toml,
mcp.toml, and artifacts.toml are the project-local names for the
user-global ralph-workflow-pipeline.toml, ralph-workflow-mcp.toml, and
ralph-workflow-artifacts.toml.
Skills
Ralph Workflow installs its skills through the built-in update mechanism:
artifact skills install into the project scope and are bound to the
pipeline's artifact types: each artifact type carries at most one skill.
Four universal skills
(test-driven-development, systematic-debugging,
verification-before-completion, antislop) install user-global and can be
turned off. See the
configuration reference
for update cadence and the trust statement.
Protections
A two-stage commit review runs immediately before each commit as a damage gate
and edit phase. Stage 1 computes deterministic tripwires from tracked and
untracked pending state, with the CommitReviewPolicy defaults
(max_deleted_files 50, max_deleted_fraction 0.25, binary_size_limit
1_000_000 bytes, proposal_retention 10, max_rejections 2; see
commit review configuration);
hard mass or protected-deletion damage rejects without invoking an agent. Stage 2
applies validated housekeeping edits only and never performs source-code review. A
normal rejection saves the pending proposal under
refs/ralph/proposals/<run>/<iteration>, resets every pending-commit file, and
returns to development; a rejection at the consecutive-rejection limit or after
the cycle timebox retains the saved proposal ref and routes to failed_terminal
without another reset. Only exact deletions in the planning-analysis-approved
plan may bypass mass-deletion accounting; protected deletions never bypass, and
developer or reviewer input cannot widen the list. Ralph Workflow's own engine writes are
auto-committed in isolation at the producer boundary: each commit covers
only the exact paths the writer just modified, paths that are already
dirty are skipped and stay in the agent or user commit flow, and an
auto-commit failure is logged but never blocks the run. See the
auto-commit contract.
Next steps
- Evaluate it: START_HERE.md — a first serious run, end to end.
- Use it: the operator manual — getting started, configuration, and every reference.
- Contribute: CONTRIBUTING.md — every pull request must agree to the Contributor License Agreement.
License
AGPL-3.0-or-later: you may run, read, and modify it; if you offer a modified version over a network, you publish your changes. The Ralph loop pattern is credited to Geoffrey Huntley; Ralph Workflow is an independent implementation built on that core. No agent vendor named above endorses this project.
Project home
- Repository: https://github.com/Ralph-Workflow/Ralph-Workflow — PyPI: https://pypi.org/project/ralph-workflow/
- Issue tracker: https://github.com/Ralph-Workflow/Ralph-Workflow/issues/new
- License: LICENSE — Code of conduct: CODE_OF_CONDUCT.md
Metadata
Release files for ralph-workflow 0.9.33
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ralph_workflow-0.9.33.tar.gz | 2.3 MB | Without provenance | Details for ralph_workflow-0.9.33.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ralph_workflow-0.9.33-py3-none-any.whl | Python 3 | none | any | Details for ralph_workflow-0.9.33-py3-none-any.whl |
Total release size: 5.5 MB
Release files / ralph_workflow-0.9.33.tar.gz
| Download URL | ralph_workflow-0.9.33.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
356610ce0face002fc6c062d818f077fb76073be93359d7072f5dc5a7341350c
|
|
BLAKE2b-256 checksum How to use checksums |
f75a6f6299496bc4bbe8bdbc7156fcd27e914ba3c6857f3429413366eab20e8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Release files / ralph_workflow-0.9.33-py3-none-any.whl
| Download URL | ralph_workflow-0.9.33-py3-none-any.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6abb701cad269d598ac8b92b5856498a883963f72a4b69781fe523375d6ad539
|
|
BLAKE2b-256 checksum How to use checksums |
19c866b124c10af8f59528665e541c5eb4aa9a459337ceaf9071a9b38e7f4cc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for ralph-workflow 0.9.33
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.