Quota-aware handoff
Watches each provider's usage in real time. Triggers a clean handoff before exhaustion — never a 429 mid-thought.
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.
# 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...
Watches each provider's usage in real time. Triggers a clean handoff before exhaustion — never a 429 mid-thought.
State, decisions, file context, and acceptance criteria travel forward as HMAC-signed Markdown + JSON sidecar. Tamper-detected on resume.
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.
Tag profiles with task kinds + skills. Relay picks the chain that matches. Outcomes feed back: profiles that succeed get boosted.
Twelve patterns: AWS keys, OpenAI / Anthropic / Gemini tokens, JWTs, PEM blocks, URL passwords. Scrubbed before they cross any boundary.
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).
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.
FTS5-indexed code chunks scanned at session start. /api/retrieval?q=... returns top-K snippets. LLMs get context without burning a context window.
Auto-detected on first probe. Install, sign in, or run via Ollama — directly from the desktop app.
Anthropic's claude CLI. OAuth + API key.
OpenAI Codex CLI. API key.
Google's coding IDE. Manual.
OSS terminal agent. API key.
Local LLM serving. Zero cloud.
GitHub Copilot via gh extension.
VS Code extension.
Autonomous VS Code agent.
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 │ │
│ │ ... │ │
│ └─────────────┘ │
└──────────────────────────────────────────────────────────┘