How it works
Baton keeps the workspace list, terminal rendering, and settings on your computer. The
remote machine holds the repository and runs everything that touches the code: agents,
shells, builds, tests, and Git. Baton connects with your system's ssh, so the
hosts, keys, and jump hosts in ~/.ssh/config work as they do in your
terminal.
Your computer
- SSH terminal Keystrokes out, output back
- Data tunnel Notifications, MCP, Git status
- Preview forward Remote dev server on a local port
- rsync Only if you use a Local copy
Remote machine
~/.baton/repos and ~/.baton/worktrees
baton CLI
Requirements
ssh you@host works in your terminal, Baton can use it.
Baton itself can run on macOS, Windows, or Linux. On Windows it uses the built-in OpenSSH client or WSL, and Local copies aren't available.
Don't have a machine yet?
Any Linux or macOS computer you can reach with ssh works. It doesn't need to
be powerful: agents mostly wait on their model, so memory and CPU go to your builds and
tests.
- A computer you already own
-
A Mac mini, desktop, or old laptop that stays on and doesn't sleep. On macOS, turn on
System Settings → General → Sharing → Remote Login. On Linux, install
openssh-server. To reach it away from home without opening ports, install Tailscale on both computers and use the machine's Tailscale name as the host. - A cloud VM
- A small Linux VM from any cloud provider, such as Hetzner, DigitalOcean, or AWS Lightsail. Add your SSH public key when you create it, so you can log in without a password.
On a fresh Debian or Ubuntu machine, install what Baton needs:
sudo apt update && sudo apt install -y git tmux curl rsync
If the machine doesn't have your key yet, run ssh-copy-id you@host from your
computer (macOS and Linux). Then install the agent CLIs you use on the machine and sign in
to them there, since that's where they run.
No spare computer? A VM or container on this one works as an SSH host too; see Use a VM or container as a sandbox.
Connect a machine
-
Make sure SSH works.
From a terminal on your computer, run
ssh you@host. If your key has a passphrase, Baton asks for it when it connects and can remember it until Baton quits (on Windows, SSH terminals still ask in the terminal). Also load the key intossh-agentso Git on the remote machine can use it through agent forwarding. -
Add the machine.
Open Settings → SSH Hosts → Add SSH host and enter a host or alias, name, user, and port, plus an identity file if the key isn't your default. Fill from ~/.ssh/config… picks a host you already use. Advanced holds extra
ssharguments, saved port forwards, and the remote Baton path (~/.batonby default, fixed once connected). -
Check the machine.
Check machine tests SSH access, Git and your Git identity, tmux, the required utilities, and rsync. Password, passphrase, and host key prompts appear in Baton.
-
Set it up.
Set up machine creates Baton's folders under the remote Baton path and installs small helper scripts. If the remote machine has no Git name and email, Baton copies yours.
-
Enable agent integrations.
On <host> is ready, click Enable next to Notifications and Baton skill for each agent you use, then Done. For Codex, run
/hooksonce on the remote machine to approve Baton's hooks. -
Create a workspace.
The new machine becomes the default environment in the New Workspace dialog. Pick a project and branch. The first workspace clones the repository on the remote machine, and later ones reuse that clone. If the project has no Git remote yet, Baton offers to publish it first.
Forward SSH agent is on by default, so agents can clone private repositories and push with the keys on your computer. Read Security before you connect a machine you don't fully trust.
Working in an SSH workspace
- Agents keep running
- Every terminal runs in a tmux session on the remote machine. If your connection drops, your laptop sleeps, or you quit Baton, the agents carry on. Select the workspace to reattach. To reattach a single pane without stopping it, use More → Reconnect SSH Session in the pane's context menu.
- Join from your own terminal
- Hover the host pill in a pane header and choose Copy tmux attach command. It joins the same session from any terminal without detaching Baton.
- Files and Git
- Browse, edit, and save remote files in the file tree and editor, search their contents, and review diffs and commit history as usual. Commit, pull, push, merge, rebase, and switch branches from the toolbar. Git runs on the remote machine, and the sidebar's change counts update as files change.
- Setup steps and links
-
Workspace setup steps run on the remote machine. The
Upload .env to SSH recipe copies a local
.envinto each new workspace. Linked workspaces work between workspaces on the same machine. - Baton CLI and port forwards
-
The
batoncommand is on thePATHin SSH terminals, so agents can open tabs, start workspaces, and open previews. For services you always want forwarded, add port forwards in either direction under the host's Advanced. They bind to127.0.0.1only. - GUI apps on the host
-
On a Linux host without a display,
baton desktop run -- <app>starts the app on a virtual desktop of its own and shows it in a VNC app such as Screen Sharing, or in Baton's browser preview with--browserbefore the app. Baton suggests it when an app can't find a display. It needstigervnc-standalone-server, plusnovncandwebsockifyfor the browser preview. - Host status
- The status bar's SSH hosts item, off by default (right-click the status bar to turn it on), shows each host's connection status and forwarded ports, with a Check button to test the connection again.
Notifications, MCP, and previews
While a workspace is connected, Baton keeps a data tunnel open to the remote machine. It's an SSH reverse forward from a port on the remote loopback interface (in the 62000–63999 range) back to Baton.
-
Notifications: agent hooks run
baton notifyon the remote machine. Finished turns, input requests, and errors come back through the tunnel, and every computer connected to that host shows them. -
Baton CLI: the remote
batoncommand reaches Baton through the tunnel, so agents can set workspace titles and status items, open agent tabs and browser previews, and start new workspaces on the same machine. The Baton skill, which Baton adds to the host's agents, tells them how. Agents that only work through MCP can use Baton's MCP server, started by the remotebaton mcphelper. - Git status: the Remote Companion watches the worktree for changes and pushes status to Baton, so the sidebar stays current without polling over SSH.
-
Browser previews: when you open the preview panel, Baton looks for
localhostURLs in the workspace's terminal output and forwards that port over SSH to127.0.0.1on your computer, keeping the same port number when it's free. If it finds more than one, pick one with the preview's Pick a running server or URL button or use Forward Remote Port. Each browser tab gets its own forward. -
Terminal links: a
localhostlink from a terminal on the remote machine that opens in your default browser goes through an SSH tunnel too.
Integrations are per machine. Change them in Settings → Integrations & MCP on the tab named after the host. Baton shows Update available there when a newer hook is ready.
Use it from several computers
Start an agent on your desktop, then check on it from your laptop. Each SSH workspace keeps a small manifest on the host, and every computer with Sync with other devices turned on (the default) picks up the others' workspaces.
- What syncs: new workspaces, agent tabs, renames, archiving or stashing, and the tab order and split panes.
- Attaching: opening a synced workspace attaches to the agents still running in tmux instead of starting new ones. The computer that attaches takes over the session from the other one.
- Alerts everywhere: when an agent finishes, needs input, or fails, every computer connected to the host shows it.
- While you're away: agents can start new workspaces even when no computer is connected. The next one to connect adds them.
- Deleting: deleting a workspace removes it from the other computers too. If its files disappear from the host some other way, it shows as Missing from host.
To choose by hand instead, open the host's Workspaces panel in Settings → SSH Hosts, turn off Sync with other devices, and use Add here on the workspaces you want.
Local copy
Some work needs the files on your own disk: building a desktop or mobile app, running a simulator, or a tool that only works locally. For that, Baton can keep a Local copy of an SSH workspace.
- One way, remote to local. Baton syncs changes from the remote machine with rsync. Edits you make in the Local copy aren't sent back and can be overwritten.
-
Your local files stay. Gitignored files such as
node_modules,.env, caches, and build output stay on your computer and aren't touched by syncs. - Created when needed. A Local copy appears the first time something uses it, such as a New Local copy terminal, a setup step, or a Terminal Command. Archiving the workspace deletes it.
- Terminal Commands. The first time you run one in a project, Baton asks where Terminal Commands should run: on the remote machine or on this computer. Change it later in the project's settings under SSH workspaces → Run Terminal Commands on, or for a single Quick Command under its Advanced options.
Treat the Local copy as disposable. Make changes on the remote machine, where the agents and Git are. A Local copy needs rsync on both machines and isn't available when Baton runs on Windows.
Use a VM or container as a sandbox
An SSH host doesn't have to be another computer. A virtual machine or container on your own computer works too, as long as it runs an SSH server and meets the requirements. Agents then run inside it, so you can let them skip permission prompts without giving them your files or the rest of your machine.
-
VMs. Most VM tools, such as Lima, OrbStack, UTM, and Multipass, give a
Linux VM an SSH login. Lima writes one for each VM to
~/.lima/<name>/ssh.config: addInclude ~/.lima/*/ssh.configat the top of~/.ssh/config, then add the hostlima-<name>. -
Containers. Install an SSH server and the required tools in the image,
and publish its SSH port, such as
-p 2222:22with Docker. Add it withlocalhostas the host and that port. Agents stop when the container does. - Share no folders. Baton clones the repository inside the VM or container, so it needs none of your files. Many VM tools share your home folder by default; turn that off for a sandbox.
- Keep your keys out. Turn off Forward SSH agent for the host and give it its own Git credentials, scoped to the repositories it works on.
- Limit the network yourself. Baton doesn't restrict what the VM or container can reach. Use its own firewall or network settings to block outbound traffic.
Coming from Baton's sandbox methods? They're deprecated and can no longer be set up in Baton. Existing ones, including the Lima VM, keep working for now. Adding a VM or container as an SSH host replaces them.
Security
- Only SSH crosses the network
-
Baton opens no ports on either machine. The data tunnel's remote end listens on
127.0.0.1on the remote machine and leads to a gateway on your computer's loopback interface. The gateway labels each request with the host it came from before passing it to Baton. - Use a machine you trust
- Anything on the remote machine that can reach its loopback port can send requests to Baton for that host, including notifications and MCP calls. Anyone who can act as your remote user can also read the code and Baton's helper files. Use a machine and account you control, and avoid hosts shared with people you don't trust.
- SSH agent forwarding
-
Forward SSH agent is on by default. Your private keys stay on your computer, but while you're connected, any process running as your remote user can ask your
ssh-agentto sign with them. Turn it off in the host's settings for machines you don't fully trust, and give the remote machine its own, narrowly scoped Git credentials instead.Forwarded keys go away when the connection drops. Agents keep running in tmux, but they can't push until you reconnect, unless the remote machine has its own credentials.
- Removing a machine
- When you delete a host, Delete all Baton data from this host is on by default. It's off when other computers may still be using workspaces there.
Troubleshooting
Check machine can't connect
Run the same ssh command in a terminal on your computer. Baton uses your
system ssh and ~/.ssh/config, so put jump hosts and aliases
there or add them under Extra SSH args, one per line.
"tmux is required" or a tool is missing
Install it on the remote machine, for example sudo apt install tmux or
brew install tmux, then click Check again.
Cloning a private repository fails
Turn on Forward SSH agent for the host and make sure your key is
loaded in ssh-agent, or set up Git credentials on the remote machine.
Notifications or MCP don't arrive
Check that the integration is enabled for that agent on the host's tab in
Settings → Integrations & MCP, and apply any update shown there.
For Codex, approve Baton's hooks with /hooks.
A terminal shows as disconnected
Select the workspace or click Reconnect session. The agent keeps running in tmux while Baton is disconnected, so nothing is lost.
A preview doesn't open
Make sure the dev server listens on localhost on the remote machine, then
use Forward Remote Port in the preview panel and enter its port.
Free to download for macOS, Windows, and Linux.
Need an SSH setup Baton doesn't support yet? Get in touch.