relay
Open source · Apache-2.0 · Go + Rust

One task.
Every agent.

Relay rotates a coding task across Claude Code, Codex, Copilot, Cursor, Cline, Continue, Antigravity, and OpenCode. When the active agent hits its usage limit, it pauses at a safe point and hands off through a signed continuation contract carrying intent, plan, and in-flight code to the next one.

~/my-project
# install
curl -fsSL https://raw.githubusercontent.com/dbisina/relay/main/scripts/install.sh | bash

# initialise
cd my-project && relay init

# run
relay run "add a refund flow to orders service"

  ✓ Routed to profile "backend" (claude → codex → ollama)
  ✓ Worktree: .relay/sessions/f3a8c2/ on branch relay/f3a8c2
  ✓ Context loaded: CLAUDE.md, AGENTS.md, Cursor rules
  ⚠ claude 74% used, handoff at 85%
  ✓ Continuation contract signed (HMAC-SHA256)
  → handing off to codex...

What you get

11 capabilities
01

Quota-aware handoff

Watches each provider's usage in real time. Triggers a clean handoff before exhaustion, never a 429 mid-thought.

02

Signed continuation contracts

State, plan, decisions, file manifest, and in-flight code travel forward as HMAC-signed Markdown plus a JSON sidecar. Tamper-detected on resume.

03

Detect and adopt running agents

relay detect finds Claude Code, Codex, Copilot, Cursor, Cline, Continue, or Antigravity already running on your machine and can adopt a session mid-flight onto another provider.

04

Account-aware failover

Multiple logins per provider. Exhaust one Claude account, resume on another before ever crossing to a different provider.

05

Quota wallet + predictive handoff

Every provider and account's remaining quota and burn rate in one panel. Forecasts time to exhaustion and hands off before the wall, not after.

06

Per-session git worktree

Agents work on a dedicated branch in .relay/sessions/<id>. Your main tree is never touched. Merge if you like the result, discard if you don't.

07

Multi-agent pipelines

Compose a DAG of agents: one per part of a task, fallback providers on failure, acceptance commands gating each step.

08

Time machine

Every handoff snapshots git plus a signed contract. Diff what any agent did, or non-destructively rewind to any step.

09

Profile routing

Tag profiles with task kinds and skills. Relay picks the matching chain. Profiles that succeed get boosted over time.

10

Secret redactor

AWS keys, OpenAI, Anthropic, and Gemini tokens, JWTs, PEM blocks, URL passwords: scrubbed before they cross any boundary.

11

MCP server

Wire Relay into Claude Desktop, Cursor, Cline, or Continue. Eleven tools, including relay_handoff and relay_retrieve, drive the orchestrator from prose.

Eight providers, one orchestrator

Auto-detected on first probe. Install, sign in, or run via Ollama, directly from the desktop app.

Claude

Anthropic's claude CLI. OAuth + API key.

Codex

OpenAI Codex CLI. API key.

Antigravity

Google's coding IDE. Manual.

OpenCode

OSS terminal agent. API key.

Ollama

Local LLM serving. Zero cloud.

Copilot

GitHub Copilot via gh extension.

Continue

VS Code extension.

Cline

Autonomous VS Code agent.

Built right

A single Go binary serves the API. egui in Rust renders the desktop client. Bubble Tea drives the TUI. All three talk to the same daemon.

     ┌──────────────────────────────────────────────────────────┐
               relay (Go binary, daemon + CLI)              
     │  ┌─────────────┐  ┌──────────────┐  ┌────────────────┐    │
     │  │ orchestrator │  │ HTTP :4748  │  │ graph store    │    │
     │  │ FSM · quota  │  │ WebSocket    │  │ audit log      │    │
     │  │ redactor     │  │ stdin reply  │  │ contract bld   │    │
     │  │ circuit      │  │ diff · cost  │  │ instructions   │    │
     │  │ worktree     │  │ approvals    │  │ outcomes       │    │
     │  │ detect       │  │ pipelines    │  │ verify gate    │    │
     │  └──────┬──────┘  └──────┬───────┘  └────────────────┘    │
     │         │                                                
     │  ┌──────▼──────┐  ┌──────▼───────┐                        │
     │  │ adapters    │  │ relay-ui     │   (Rust, egui, native) │
     │  │ claude      │  │ relay tui    │   (Go, Bubble Tea)     │
     │  │ codex       │  └──────────────┘                        │
     │  │ ollama                                                  
     │  │ ...                                                     
     │  └─────────────┘                                          │
     └──────────────────────────────────────────────────────────┘