A Go terminal UI that runs Claude in an autonomous loop, working through issues until there's nothing left to do.
Ralph is an AI agent that finds ready tasks from a Beads issue tracker, implements them one at a time, runs tests, and commits passing workβall without human intervention. This wrapper provides real-time visibility into what Ralph is doing.
Optionally, Ralph can report its progress to a Ralph Loop Hub server for centralized monitoring across multiple agents and repositories.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Ralph TUI [1] Homebase [2] Output [3] Analytics q:quit β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Iteration: 3/50 | Status: running | Current: 1m23s β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β [Ralph status] β
β ready_before: 5 β
β ready_after: 4 β
β task: PROJ-12 β
β tests: PASSED β
β notes: Added input validation to user registration β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β Starting iteration 4... β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Go 1.21+ (for building from source)
- Claude CLI (
claudein PATH) - Beads initialized in your project (
bd init)
curl -sSfL https://raw.githubusercontent.com/fireynis/ralph-loop-tui/main/install.sh | shThis downloads the latest release, verifies the checksum, and installs the binary to /usr/local/bin (or ~/.local/bin).
go install github.com/fireynis/ralph-loop-go@latestgit clone https://github.com/fireynis/ralph-loop-go.git
cd ralph-loop-go
go build -o ralph-loop-go# Run with defaults (50 iterations max, 2s between iterations)
ralph-loop-go
# Custom iteration limits
ralph-loop-go -max-iterations 100 -sleep-seconds 5
# Filter to a specific epic (prevents collision with other agents)
ralph-loop-go -epic BD-42
# Use a specific Claude binary
ralph-loop-go -claude-bin /usr/local/bin/claude
# Connect to Ralph Loop Hub for centralized monitoring
ralph-loop-go -hub-url https://your-hub.example.com -hub-api-key your-secret-key| Flag | Default | Env Variable | Description |
|---|---|---|---|
-max-iterations |
50 |
Maximum loop iterations before stopping | |
-sleep-seconds |
2 |
Pause between iterations (seconds) | |
-claude-bin |
claude |
Path to Claude CLI executable | |
-epic |
(none) | Filter to tasks within a specific epic (e.g., BD-42) |
|
-max-review-cycles |
3 |
Maximum reviewer/fixer cycles per iteration | |
-hub-url |
(none) | RALPH_HUB_URL |
URL of a Ralph Loop Hub server |
-hub-api-key |
(none) | RALPH_HUB_API_KEY |
API key for Ralph Loop Hub authentication |
-instance-id |
(derived) | RALPH_INSTANCE_ID |
Instance identifier (defaults to repo/epic) |
Flags take precedence over environment variables. For hub configuration, environment variables are often more convenient so you don't leak secrets in shell history.
Ralph provides three switchable screens. Press Tab to cycle through them, or press 1, 2, or 3 to jump directly.
Iteration logs and Ralph activity summary. Shows preflight census data (ready/blocked/in-progress counts and dependency graph) and per-iteration status updates as Ralph works.
Live Claude output stream. Supports two view modes:
- Parsed (default) β Tool calls, results, and text extracted from Claude's stream-json output
- Raw β The full JSON lines as emitted by Claude
Press r to toggle between parsed and raw. Press f to toggle follow mode (auto-scroll to bottom).
A four-panel dashboard showing:
- Progress β Iteration count, pass/fail rates, success percentage
- Timing β Total runtime, current/average/fastest/slowest iteration durations, estimated remaining time
- Task Tracking β Initial and current ready counts, tasks closed, last task worked on, hub connection status
- Recent Iterations β Table of the last 10 iterations with duration, verdict, review cycles, and task ID
| Key | Action |
|---|---|
q / Ctrl+C / Esc |
Graceful shutdown |
Tab |
Next screen |
1 / 2 / 3 |
Jump to Homebase / Output / Analytics |
β / β / PgUp / PgDn |
Scroll |
f |
Toggle follow mode (Output screen) |
r |
Toggle raw/parsed view (Output screen) |
Each iteration runs a multi-phase pipeline:
-
Planner β Finds the highest-priority ready task, analyzes it, and produces a structured implementation plan (approach, files to touch, edge cases, test strategy). No code is written in this phase.
-
Developer β Receives the plan and implements exactly one task: modifies code, runs tests, commits if passing, or notes failures.
-
Reviewer β Examines the git diff as a specialist reviewer (auto-detected from file typesβGo engineer, TypeScript/React engineer, Python engineer, etc.). Returns
APPROVEDorCHANGES_REQUESTED. -
Fixer (if needed) β Addresses reviewer feedback, re-runs tests, and re-commits. The reviewer/fixer cycle repeats up to
-max-review-cyclestimes.
After each iteration, Ralph checks for remaining work via bd ready. If no ready tasks remain, it outputs <promise>COMPLETE</promise> and the loop ends. The TUI also verifies this independently to catch cases where closing a task unblocks new dependent work.
If Claude encounters 3 consecutive errors, the loop stops to avoid burning through iterations on a persistent problem.
Ralph Loop Hub is a separate server that provides centralized monitoring for one or more Ralph instances. When connected, Ralph sends real-time events so you can track progress from a dashboard without needing terminal access to each running agent.
-
Deploy a Ralph Loop Hub instance β See the Ralph Loop Hub README for setup instructions.
-
Configure Ralph to report to it β Either via flags or environment variables:
# Via environment variables (recommended β avoids secrets in shell history) export RALPH_HUB_URL=https://your-hub.example.com export RALPH_HUB_API_KEY=your-secret-key ralph-loop-go # Via flags ralph-loop-go -hub-url https://your-hub.example.com -hub-api-key your-secret-key
-
Verify the connection β When hub reporting is enabled, you'll see a startup message:
reporter: hub enabled β https://your-hub.example.comThe Analytics screen (press
3) also shows hub connection status, URL, and instance ID.
Each Ralph instance identifies itself to the hub using an instance ID. By default this is derived automatically from:
- The git remote origin URL (e.g.,
fireynis/ralph-loop-go) - The epic filter, if set (appended as
/BD-42)
So a Ralph running on fireynis/my-project with -epic BD-42 would have instance ID fireynis/my-project/BD-42.
You can override this with -instance-id or RALPH_INSTANCE_ID if you need a custom identifier.
Ralph sends the following events to the hub, each including a full context snapshot (session ID, iteration count, analytics summary) so the dashboard can reconstruct state from any single event:
| Event | When |
|---|---|
session.started |
Loop begins, includes configuration (max iterations, sleep, epic, review cycles) |
session.ended |
Loop finishes, includes reason (completed, interrupted, max iterations reached) |
iteration.started |
Each iteration begins, includes iteration number and phase |
iteration.completed |
Each iteration ends, includes duration, task ID, pass/fail, review cycles |
phase.changed |
Pipeline phase transitions (planner β dev β reviewer β fixer) |
task.claimed |
Ralph picks up a task, includes task ID and description |
task.closed |
Ralph closes a completed task, includes task ID and commit hash |
Events are sent as fire-and-forget HTTP POSTs to {hub-url}/api/v1/events with a Bearer token for authentication. Failed sends are logged to stderr but never block the TUI β Ralph continues working regardless of hub availability.
To run multiple Ralph instances on the same repo without task collisions, use the -epic flag to scope each agent to a different epic:
# Terminal 1: Ralph works on the backend epic
ralph-loop-go -epic BD-10 -hub-url https://hub.example.com -hub-api-key key123
# Terminal 2: Ralph works on the frontend epic
ralph-loop-go -epic BD-20 -hub-url https://hub.example.com -hub-api-key key123Each instance gets a unique instance ID (repo/BD-10, repo/BD-20) and reports independently to the hub.
# 1. Initialize Beads in your project
bd init
# 2. Create some tasks
bd create --title="Add input validation to login form" --priority=1
bd create --title="Write tests for user service" --priority=2
bd create --title="Update README with API examples" --priority=3
# 3. Let Ralph work through them
ralph-loop-go
# 4. Or with hub monitoring
export RALPH_HUB_URL=https://your-hub.example.com
export RALPH_HUB_API_KEY=your-secret-key
ralph-loop-go -max-iterations 100Built with Bubble Tea using the Elm architecture:
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Model ββββββΆβ Update ββββββΆβ View β
β (state) βββββββ (messages) βββββββ (render) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β
βΌ
βββββββββββββββββββββ
β Phase Pipeline β
β planner β dev β β
β reviewer β fixer β
βββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββ
β Reporter β
β (HTTP β Hub) β
βββββββββββββββββββββ
Message flow:
preflight β startIterationMsg β planner β dev β reviewer β [fixer β] claudeDoneMsg β next iteration or finish
β
events sent to hub (async)
Ralph expects Claude CLI with these capabilities:
--dangerously-skip-permissionsfor autonomous operation--output-format stream-jsonfor real-time output- Access to Beads CLI (
bd) commands
- Ralph Loop Hub β Centralized monitoring dashboard for Ralph instances
- Beads β Git-backed issue tracker Ralph uses for task management
- Claude CLI β The AI that does the actual work
- Bubble Tea β TUI framework
MIT