relay
v0.3 · Apache-2.0 · Go + Rust

One task.
Every agent.

Relay rotates a coding task across Claude, Codex, Antigravity, OpenCode, Ollama, Copilot, Continue, and Cline. Quota-aware handoff. Signed continuation contracts. Per-session git worktrees. Live cost meter. Vision fallback.

~/my-project
# install
curl -fsSL https://relay.dev/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
  ✓ Vision polling started (every 2.5s)
  ⚠ claude 74% used — handoff at 85%
  ✓ Continuation contract signed (HMAC-SHA256)
  → handing off to codex...

What you get

Quota-aware handoff

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

Signed contracts

State, decisions, file context, and acceptance criteria travel forward as HMAC-signed Markdown + JSON sidecar. Tamper-detected on resume.

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.

Profile routing

Tag profiles with task kinds + skills. Relay picks the chain that matches. Outcomes feed back: profiles that succeed get boosted.

Secret redactor

Twelve patterns: AWS keys, OpenAI / Anthropic / Gemini tokens, JWTs, PEM blocks, URL passwords. Scrubbed before they cross any boundary.

Vision fallback

For IDE-only providers, opt in to a screenshot-based observation loop with a local Ollama vision model or cloud (Gemini, GPT-4o, Claude vision).

MCP server

Wire Relay into Claude Desktop, Cursor, Cline, Continue, or Zed. Your LLM can call relay_handoff, relay_retrieve, and 9 other tools to drive the orchestrator from prose.

Code retrieval

FTS5-indexed code chunks scanned at session start. /api/retrieval?q=... returns top-K snippets. LLMs get context without burning a context window.

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       │    │
     │  └──────┬──────┘  └──────┬───────┘  └────────────────┘    │
     │         │                                                
     │  ┌──────▼──────┐  ┌──────▼───────┐                        │
     │  │ adapters    │  │ relay-ui     │   (Rust, egui, native) │
     │  │ claude      │  │ relay tui    │   (Go, Bubble Tea)     │
     │  │ codex       │  └──────────────┘                        │
     │  │ ollama                                                  
     │  │ ...                                                     
     │  └─────────────┘                                          │
     └──────────────────────────────────────────────────────────┘