Model or dataset
mikeyobrien/ralph-orchestrator avatar
mikeyobrien/ralph-orchestrator

Ralph Orchestrator: A Hat-and-Event Loop Runner for CLI Coding Agents

An improved implementation of the Ralph Wiggum technique for autonomous AI agent orchestration

3,139 stars295 forksRustMIT

At a glance

What is it?
Ralph Orchestrator is a Rust CLI that wraps Claude Code, Codex, Gemini CLI and similar tools in an iterative loop with persona switching, backpressure gates and a Telegram human-in-the-loop channel. It is worth adopting if you already trust one of those backends and want the loop, the spec artefacts and the review gates handled for you.
Who is it for?
Adopt Ralph Orchestrator if you already have a working CLI agent backend and want the loop, the spec artefacts under .ralph/specs and the backpressure gates handled by a single Rust binary. Do not adopt it if you need one control plane across several repositories, since ralph mcp serve is scoped to a single workspace root per instance, or if you object to the web dashboard being labelled alpha.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 5 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The loop problem Ralph Orchestrator is aimed at

A single prompt to a coding agent ends when the model stops talking. That is the wrong stopping condition for a multi-file change, because the model can stop while tests fail and nothing in the tooling notices. The Ralph Wiggum technique, which the README links to a post by ghuntley, replaces the model's judgement with a loop: run the agent, inspect the result, run it again, until an explicit completion signal appears. Ralph Orchestrator implements that technique in Rust and adds the parts a bare shell loop lacks.

The README states the completion condition directly: Ralph iterates until it outputs LOOP_COMPLETE or hits the iteration limit. Two bounds, one success token and one hard cap. Anyone who has written a while-true wrapper around a coding CLI has hit the failure this addresses, where a run either exits early on a half-finished edit or burns tokens indefinitely on a task the model cannot solve.

The intended user is a developer who already runs one of the supported backends from a terminal and wants orchestration without writing it. The README lists Claude Code, Kiro, Gemini CLI, Codex, Forge, Amp, Copilot CLI, OpenCode, Pi, Roo and OMP as backends. That list is the project's real surface area: Ralph is not a model and not an agent, it is the layer that decides when the agent runs, what it is told, and whether its output is accepted.

Hats, events and the backpressure gate

The mechanism the README describes is a hat system: specialised personas that coordinate through events. Rather than one agent prompt that has to plan, implement and review in sequence, the loop moves work between named roles and the transition is an event rather than a line of prompt text. The documentation site has a concepts page titled Hats & Events, so the design is treated as a first-class part of the model rather than an implementation detail.

Backpressure is the second half of the mechanism. The README describes gates that reject incomplete work and names tests, lint and typecheck as examples. This is where the loop earns its keep: if a gate fails, the iteration is not accepted, so LOOP_COMPLETE cannot be reached by a model that merely claims success. The gate has to be configured to be useful, and the README does not spell out the gate configuration keys in the material available here, so treat gate setup as something to verify against the configuration guide before you rely on it.

Two more pieces sit alongside the loop. Memories and tasks are described as persistent learning and runtime work tracking, which implies state that survives across iterations rather than a fresh context each turn. And the project ships five builtins, named as code-assist, debug, research, review and pdd-to-code-assist, with further patterns documented as examples. Those five names are the closest thing to a statement of what the tool is actually good at: assisted coding, debugging, research, review, and the planning-to-code path.

Getting from install to a running loop

Three install paths are documented. The README marks npm as recommended:

npm install -g @ralph-orchestrator/ralph-cli

A GitHub Releases installer script and cargo install ralph-cli are the alternatives. The README adds a note that Homebrew is not currently published from the repository's automated release flow, and asks readers to prefer npm, Cargo or the Releases installer. That is an unusually candid line for a README and it is worth taking at face value: if your team standardises on brew, you are on your own.

The quick start is three commands. ralph init --backend claude writes the initial configuration against a chosen backend. ralph plan "Add user authentication with JWT" opens what the README calls an interactive PDD session and produces three files under .ralph/specs/user-authentication/: requirements.md, design.md and implementation-plan.md. Then ralph run -p "Implement the feature in .ralph/specs/user-authentication/" drives the loop against that spec directory. For smaller work the README says you can skip planning and pass a prompt straight to ralph run.

The planning step is the part that distinguishes this from a wrapper script. The artefacts are plain Markdown in a predictable directory, so they can be reviewed, edited or committed before any agent touches code. The -p flag takes either a spec directory path or a free-form prompt, which means the same command covers both workflows.

There is also a web dashboard, started with ralph web. The README labels it alpha in bold and warns of rough edges and breaking changes. It needs a Rust toolchain for the ralph-api process and Node.js 18 or newer plus npm for the frontend, and on first run it detects missing node_modules and runs npm install for you. Flags include --no-open, --backend-port, --frontend-port and --legacy-node-api, the last of which opts into a backend the README calls deprecated.

The single-workspace-root constraint on the MCP server

Ralph can run as an MCP server over stdio with ralph mcp serve, which is how an MCP-compatible client drives it. The README is explicit that this mode is scoped to one workspace root per server instance, and gives the precedence order for resolving that root: the --workspace-root flag first, then the RALPH_API_WORKSPACE_ROOT environment variable, then the current working directory.

The README then states the consequence without softening it. Config, tasks, loops, planning sessions and collections all persist under a single workspace root, so multi-repo use means one MCP server instance per repository. The README calls server-per-workspace the deterministic model. That is a design boundary, not a bug, but it has an operational cost: a monorepo with several independent services inside it is one workspace, and a set of related repositories needs a process per repository plus whatever supervises them. If your mental model of an orchestrator is one daemon watching everything, this is the point where Ralph does not match it.

The same section notes that ralph mcp serve belongs in an MCP client configuration rather than an interactive terminal session, which is a small but useful warning against debugging it by hand.

Telegram as the human-in-the-loop channel

RObot is the project's name for human interaction during a run, and Telegram is the transport. The README describes two directions of traffic. Agents emit human.interact events and the loop blocks until a response arrives or times out, so a question from the agent pauses orchestration instead of being answered by the model itself. In the other direction, a human can send proactive guidance at any time and steer the agent mid-loop.

Setup is a guided flow: ralph bot onboard --telegram walks through the token and chat id, ralph bot status verifies the configuration, and ralph bot test sends a test message. The run command then takes a config file explicitly, ralph run -c ralph.bot.yml -p "Help the human", which suggests the bot settings live in a separate YAML rather than the default config. The README shows the shape of that file: a RObot block with enabled: true and a telegram block holding bot_token, with RALPH_TELEGRAM_BOT_TOKEN as the environment variable alternative to hardcoding the token.

Two details matter for anyone running more than one loop. Messages route by reply-to, by an @loop-id prefix, or fall back to the primary loop, so parallel loops share one chat. And the bot exposes /status, /tasks and /restart as commands for loop visibility. The blocking behaviour is the interesting trade-off: an agent that asks a question stops making progress until a human replies or the timeout fires, which is exactly what you want on a decision that needs a person and exactly what you do not want on an unattended overnight run.

Where Ralph Orchestrator is the wrong tool

The clearest limitation is the backend dependency. Ralph orchestrates other CLIs. Every backend in the list is an external tool with its own authentication, rate limits, pricing and update cadence, and Ralph's own npm package does not remove that. If the backend CLI breaks or changes its flags, the loop is only as stable as the wrapper around it, and the README gives no compatibility matrix tying Ralph versions to backend versions.

The web dashboard is labelled alpha by the project itself, with a warning about breaking changes. Anything built on top of it, including the /status and /tasks style of visibility if you route it through the web layer rather than Telegram, should be treated as moving. The --legacy-node-api flag is documented as opting into a deprecated backend, which tells you the dashboard has already been through one architectural replacement.

Backpressure is only as good as its configuration. The README names tests, lint and typecheck as gate categories but does not, in the material available here, enumerate the keys that define them. A loop with no gates configured reduces to a token-burning while-loop with a LOOP_COMPLETE string check, and the model can emit that string whenever it likes. The iteration limit is the only other stop, and the README does not state a default value for it.

Finally, the project is young in release terms. The release list shows v2.10.1 in June 2026 and v2.9.3 in May 2026, with the repository last pushed in September 2026. Version numbers in the 2.x range with frequent point releases suggest active development, which cuts both ways: fixes arrive quickly and interfaces can move.

How this differs from a generic agent framework

The obvious alternative is an agent framework that owns the whole stack, where you define tools and the framework runs the model itself. LangGraph and similar libraries put the graph and the model call in the same process. Ralph does the opposite: it owns the loop, the personas and the gates, and delegates every model call to a CLI you already have installed and already pay for. The practical difference is that swapping Claude Code for Codex is a backend flag rather than a rewrite, and the cost is that you inherit whatever those CLIs do with context, permissions and file writes.

A second comparison is the plain shell loop. A for or while loop around claude -p with a grep for a completion string is a few lines and has no dependencies. Ralph adds the hat system, the persistent memories and tasks, the gate concept, the PDD planning artefacts and the Telegram channel. If your task is one prompt and one file, the shell loop is the smaller and more auditable choice. The planning artefacts are what tip the balance for multi-file work, because requirements.md and implementation-plan.md are reviewable before an agent runs.

A third comparison is CI. Running an agent inside a pipeline step gives you isolation, logs and a clean checkout, but it does not give you iteration with state carried between turns, and it does not give you a human answering a question mid-run. Ralph and CI are complementary rather than competing, and the README does not describe a CI integration, so wiring it in is your work.

Licence, maintenance and what to check first

The repository is MIT licensed, which permits commercial use, modification and redistribution provided the copyright notice and permission notice are retained. That is the permissive end of the spectrum and it means the usual obligations apply: keep the notice, and note that MIT ships no warranty. This is not legal advice, and if you redistribute Ralph inside a product you should have counsel read the LICENSE file rather than a review.

Maintenance cost has three parts. The first is the Rust toolchain if you use the web dashboard, since ralph-api is Rust, plus Node.js 18 or newer and npm for the frontend. The second is the backend CLI, which updates on someone else's schedule. The third is the upgrade cadence of Ralph itself, which the release list shows moving quickly through the 2.10 line. Pinning a version in your npm install or Cargo install and reading the release notes before bumping is the low-effort hedge.

The thing to verify first is the gate configuration. Run ralph init --backend <your backend>, then ralph plan on a feature small enough to read in full, and inspect the three generated files to confirm the requirements and implementation plan match your team's conventions. After that, confirm which config keys define the test, lint and typecheck gates, and set an iteration limit you are willing to pay for. Those two settings decide whether the loop terminates on real work or on a string the model learned to print.

Editorial conclusion

Adopt Ralph Orchestrator if you already have a working CLI agent backend and want the loop, the spec artefacts under .ralph/specs and the backpressure gates handled by a single Rust binary. Do not adopt it if you need one control plane across several repositories, since ralph mcp serve is scoped to a single workspace root per instance, or if you object to the web dashboard being labelled alpha. Before committing, run ralph init --backend <name>, then ralph plan on a small feature and read the three generated files under .ralph/specs to check that the requirements and implementation plan match how your team actually writes specs.

Official sources

  1. Issues
  2. License: MIT
  3. mikeyobrien/ralph-orchestrator on GitHub
  4. README
  5. Releases
Community notes

Community notes