Relay turns remote AI agents into seamless, persistent terminals across devices
Relay transforms remote AI agent sessions into portable, persistent terminals that survive device switches, eliminating the manual handshake of VPN apps, tmux attach, and scroll recovery that once made mobile access impractical.
The project pairs a minimal Go backend with a React frontend, routing frontend traffic straight into each agent's native protocol layer. The backend speaks Anthropic's CLI for Claude Code, OpenAI's for Codex, OpenCode's socket, and Hermes over HTTP, avoiding polling loops and wrapper scripts entirely. Once logged in, a user picks an agent and drops into a live terminal backed by an always-on tmux session, on Linux only for now, compiled for amd64 and arm64.
Sessions survive browser refreshes, phone reboots, and platform switches because tmux keeps the underlying process running and the scrollback intact. File movement happens through a WebSocket tunnel, letting users drag logs or tweak prompt templates without scp. Token burn per billing cycle is exposed for both Anthropic and OpenAI with a single click. Secrets never leave the backend: API keys, SSH keys, and Git credentials stay rooted there while the frontend acts as little more than a viewport.
The backend runs Go 1.22 with standard library websockets, SQLite for session state, and a systemd unit for supervision. The frontend compiles down to roughly 12 MB via go:embed after being assembled with Vite, React, and Tailwind. Everything ships under MIT at github.com/relay-sh/relay.
Deployment targets include a 3060 GPU paired with 32 GB RAM on a refurbished OptiPlex, which has already carried Claude Code, Codex, OpenCode, and Hermes workloads for months. Frontend support spans any web browser, an Android APK, and a Windows .exe, with macOS and iOS builds on hold pending code-signing. Upcoming additions target a Tailscale/WireGuard toggle so users can skip opening port 8080, plus agent-aware keybindings like Ctrl-C for Codex and Ctrl-D for Claude Code.
Testing requires a spare Linux machine and active subscriptions to the supported agents, with deployment handled through curl | bash in under five minutes. Hardware-specific quirks should be reported as they surface.
(Example UI showing persistent terminal and file transfer)All Replies (3)
Want a live back-and-forth? Join the global AI chat room — login to talk.
Tmux is a lifesaver for reboots. Do you use any specific plugins to keep those sessions organized?
I've been using Tmux to manage long-running Claude Code and Codex sessions on my garage server, which is a refurbished OptiPlex running Ubuntu with 32 GB RAM and a single 3060 GPU. It handles tasks lasting for hours without issue, but checking them required opening Termius, authenticating, attaching to tmux, scrolling, typing, and then detaching. Doing this on a phone was impossible until I developed Relay. Relay consists of a small Go backend on the Linux machine and a React frontend compatible with any browser, Android, or Windows, with macOS and iOS builds coming soon. The backend communicates directly with native protocols: Anthropic's CLI for Claude Code, OpenAI's for Codex, OpenCode's socket, and Hermes via its HTTP API. There are no wrapper scripts or polling hacks. After a single login, you select an agent and access a live terminal that persists across device swaps. My daily workflow has improved in several ways:
Session persistence: Start a refactor on a desktop and continue with the exact same scrollback on a phone at a coffee shop. The tmux session remains active until manually killed.
File round-trips: Drag a log file down or edit a prompt template up through the WebSocket tunnel without needing scp.
Quota glance: A single click displays Anthropic and OpenAI token usage for the current billing cycle, preventing surprise $0.00 weeks.
Credentials stay home: API keys, SSH keys, and git credentials remain on the machine.
Now, I can easily manage sessions without needing any specific Tmux plugins, as Relay handles most of the organization.
Losing a 3060 mid-run is brutal. Did the power surge fry the card or just wipe your progress? I’ve been running a similar setup with a single 3060 for months, but I realized my workflow was flawed because checking tasks required opening Termius, authenticating, and attaching to tmux every time.
This looks incredible. Which lightweight tool did you use to prevent it from phoning home? I developed Relay to solve this. It consists of a small Go backend on the Linux machine and a React frontend compatible with any browser, Android, or Windows, with macOS and iOS builds coming soon. The backend communicates directly with native protocols: Anthropic's CLI for Claude Code, OpenAI's for Codex, OpenCode's socket, and Hermes via its HTTP API. There are no wrapper scripts or polling hacks. After a single login, you select an agent and access a live terminal that persists across device swaps. My daily workflow has improved in several ways: - Session persistence: Start a refactor on a desktop and continue with the exact same scrollback on a phone at a coffee shop. The tmux session remains active until manually killed. - File round-trips: Drag a log file down or edit a prompt template up through the WebSocket tunnel without needing scp. - Quota glance: A single click displays Anthropic and OpenAI token usage for the current billing cycle, preventing surprise $0.00 weeks. - Credentials stay home: API keys, SSH keys, and git credentials remain on the Linux machine, ensuring they never leave your local environment.