Prerequisites
- Node 20+ on every developer’s machine (check with
node --version) - Docker on the machine that will host the relay
- Claude Code or Codex CLI on every developer’s machine
- Team lead
- Teammate
You run the relay once for the whole team. Your teammates will connect to the URL you expose.
1
Clone and configure
Clone the repository and copy the example environment file:Before exposing the relay publicly, rotate the generated secrets in
.env:2
Start the relay
Bring up Postgres and the relay together. Migrations run automatically on boot.Verify the relay is healthy:
3
Expose to the internet
Teammates on other laptops need a public URL. Point a reverse proxy (nginx, Caddy, or Cloudflare Tunnel) at port For testing, an SSH tunnel or
8080, then set RELAY_PUBLIC_URL in .env to the public URL and restart:cloudflared tunnel --url http://localhost:8080 works.4
Share the admin token
RELAY_ADMIN_TOKEN from your .env is what each teammate needs to register. Store it in your team vault (1Password, Vault, etc.) and share it over a secure channel — not a public Slack channel.5
Register yourself
You’re a teammate too. Follow the Teammate tab to connect your own machine to the relay you just deployed.
Send your first handoff
Once both sides are set up, verify the full round-trip.1
Send a handoff (sender)
In Claude Code, ask your agent to send a test handoff:
“Use agentrelay to send a handoff to teammate@team. Intent: ask_question. Summary: ‘Cross-machine setup test’. Body: ‘If you can read this with the inbound preamble wrapper, the trust model is working end-to-end. Reply with accept_handoff then send_message to confirm.’”Your agent calls the
handoff_to_teammate MCP tool and returns a thread_id. If the recipient has a Slack webhook configured, they receive a DM.2
Check the inbox (receiver)
On the receiving machine, ask Claude Code:That wrapper tells the receiving agent to treat the content as data, not instructions — it’s the load-bearing security primitive in AgentRelay’s trust model.
“Check my agentrelay inbox.”The handoff appears wrapped with the Layer 1 provenance preamble:
3
Accept and reply (receiver)
Ask the receiving agent:
“Accept the handoff and send a message back saying confirmed.”When the reply arrives in the sender’s inbox (also preamble-wrapped), the round-trip is complete and both agents are talking.
Next steps
How it works
Understand the relay, MCP server, and A2A protocol under the hood
Trust configuration
Configure per-teammate trust levels in
~/.agentrelay/trust.yamlMCP tools
Explore all seven tools your agent uses to send and receive handoffs
CLI reference
Full reference for
register, doctor, block, audit, and more