Documentation
Installing agent-bridge
agent-bridge is a Claude Code plugin and a command of its own. Install it on every machine you want to pair: pairing runs on both sides. After pairing, a machine that only receives work needs nothing but SSH, git and its shell to run jobs; a peer you set up by hand needs no plugin at all.
Requirements
| macOS | Linux | Windows | |
|---|---|---|---|
| Shell | bash 3.2+ (the system one is fine) | bash | PowerShell 7.4+ (winget install Microsoft.PowerShell),
not Windows PowerShell 5.1 |
| Tools | git, OpenSSH, jq (/usr/bin/jq ships with macOS 15+;
older: brew install jq) |
git, OpenSSH, jq | git, the OpenSSH client (built in) |
| Finding machines (pairing) | built in (dns-sd) |
avahi-utils (apt install avahi-utils,
dnf install avahi-tools), or PowerShell 7 |
built in (agent-bridge's own mDNS responder in PowerShell 7) |
| To be a peer | Remote Login (pairing turns it on) | an SSH server (apt install openssh-server), with
Include /etc/ssh/sshd_config.d/*.conf in
sshd_config (the default on Debian 11+, Ubuntu 20.04+,
Fedora, Arch) |
OpenSSH Server (the setup script installs it) |
| On the peer, for jobs | a clone of the project | a clone of the project | a clone of the project |
You don't have to check this list by hand:
agent-bridge pair --check (below) does.
1. Install
Pick one way per machine. Each puts the same signed release on it; they differ in what updates it.
The installer works on any machine, with or without Claude Code:
curl -fsSL https://cruxbitlabs.github.io/agent-bridge/install.sh | sh # macOS, Linux
irm https://cruxbitlabs.github.io/agent-bridge/install.ps1 | iex # Windows, in PowerShell 7
It needs no administrator and never uses sudo:
- It finds the newest release tag.
- It clones agent-bridge at that tag and checks the tag's signature against the release key written in the installer itself (git's own SSH signing, git 2.34 or later). Nothing is installed when the check fails.
- It puts the release in
~/.local/share/agent-bridge/releases/<version>(Windows:%LOCALAPPDATA%\agent-bridge\releases\<version>), and theagent-bridgecommand on your PATH (section 2). - It runs
agent-bridge setup(below).
It never replaces a newer copy, or a git clone the command already
runs, unless you pass --force (-Force). More
options:
install.sh |
install.ps1 |
|
|---|---|---|
| A given version | --version X.Y.Z |
-Version X.Y.Z |
| Wire every agent CLI found without asking | --yes |
-Yes |
No setup |
--no-setup |
-NoSetup |
| Only say what it would do | --dry-run |
-DryRun |
| Update, then remove | --update, --uninstall |
-Update, -Uninstall |
With options, from the pipe:
curl -fsSL .../install.sh | sh -s -- --yes, or
& ([scriptblock]::Create((irm .../install.ps1))) -Yes.
To check the installer before running it: every release has
install.sh, install.ps1 and
SHA256SUMS signed with the release key
(SHA256SUMS.sig):
echo 'agent-bridge-release namespaces="file" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMjJkMyZFyyi70Pax1tv6LWYWyq69npKp/UN43HsJpRy' > signers
ssh-keygen -Y verify -f signers -I agent-bridge-release -n file -s SHA256SUMS.sig < SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS # macOS: shasum -a 256 -c --ignore-missing SHA256SUMS
The key is the same one in
.claude-plugin/release-signers.
Homebrew or Scoop, if you manage your tools with them:
brew install cruxbitlabs/tap/agent-bridge # macOS, Linux
scoop bucket add cruxbitlabs https://github.com/cruxbitlabs/scoop-bucket; scoop install agent-bridge # Windows
They check the checksum their formula pins, and they update
agent-bridge themselves (brew upgrade,
scoop update): agent-bridge update says so and
leaves it to them. Run agent-bridge setup afterwards.
The Claude Code plugin, in Claude Code:
/plugin marketplace add cruxbitlabs/agent-bridge
/plugin install agent-bridge@cruxbitlabs
or from a shell:
claude plugin marketplace add cruxbitlabs/agent-bridge,
then claude plugin install agent-bridge@cruxbitlabs. For a
private fork, Claude Code clones it with your own git credentials, so
git clone of it has to work for you first. The installer's
setup does the same when you say yes to Claude Code.
With the plugin, inside Claude Code sessions,
agent-bridge is on the PATH, the
/agent-bridge:* slash commands are there, and the
agent-bridge skill tells Claude how to use it.
agent-bridge setup:
the agent CLIs on this machine
agent-bridge setup # asks once for each agent CLI it finds
agent-bridge setup --yes # wires every one it finds, without asking
agent-bridge setup --status # what's here, what you answered, what's wired, which copy the command runs
agent-bridge setup --forget codex # asks about Codex again next time
It looks for Claude Code (claude), Codex, Gemini CLI,
Grok Build and Antigravity (agy), on your PATH, on a login
shell's PATH on macOS (where Homebrew puts them), or by their folders
(~/.codex...). For each one it hasn't asked about, it asks:
"Wire agent-bridge into Codex? [Y/n]". A yes installs the plugin in
Claude Code, or runs agent-bridge integrate for the
others, which prints every file it changes. Your answers are kept in
~/.config/agent-bridge/setup.json, so a second run asks
nothing new. With no terminal to ask on, it wires nothing and says
so.
2. agent-bridge in
your terminal
Claude Code keeps the plugin in a versioned folder
(~/.claude/plugins/cache/cruxbitlabs/agent-bridge/<version>/)
that moves every time the plugin updates, so it isn't on your terminal's
PATH by itself. The plugin takes care of that: the first Claude
Code session after installing it puts agent-bridge in your
terminal, so agent-bridge pair (or anything else)
works there. Open a new terminal window afterwards. The same by hand, or
to look:
agent-bridge install-cli # do it now (ask Claude to run it, or use the full path `agent-bridge config` prints)
agent-bridge install-cli --status # what's there, and whether the sessions keep it up to date
agent-bridge install-cli --dry-run # what it would do
agent-bridge install-cli --uninstall
| macOS, Linux | Windows | |
|---|---|---|
| The command | ~/.local/bin/agent-bridge |
%LOCALAPPDATA%\agent-bridge\bin\agent-bridge.cmd, plus
agent-bridge for Git Bash |
| On your PATH through | one line in your login shell's profile, only when
~/.local/bin isn't on your PATH already:
~/.zprofile (zsh), ~/.bash_profile or
~/.profile (bash) |
the folder, added to your user PATH |
| It runs the plugin from | ~/.local/share/agent-bridge/current, a link to the
plugin's folder |
the folder named in
%LOCALAPPDATA%\agent-bridge\current.txt |
The command is a small script, not a link to the plugin's files. Each
time a Claude Code session starts, the plugin's session hook puts the
command in place if it's missing and points current at the
folder that session runs from, so the command keeps working after an
update (until a session has started once with the new version, it runs
the previous one). The profile line ends in
# added by agent-bridge install-cli; for another shell
(fish...), install-cli prints the line to add instead. On Windows the
user PATH is edited in the registry as it is, so entries like
%USERPROFILE%\bin stay as they were.
The session hook never replaces a file at that path that isn't
agent-bridge's. If you'd rather not have the command,
agent-bridge install-cli --uninstall removes it, the link
and the profile line, and from then on sessions leave it out
(install-cli --status says automatic: off)
until you run agent-bridge install-cli again.
AGENT_BRIDGE_CLI=off in Claude Code's environment does the
same without removing anything. You can always run the full path that
agent-bridge config prints under plugin:
instead. (<plugin>/bin/agent-bridge, or
pwsh -File <plugin>\bin\agent-bridge.ps1 on
Windows).
3. Check the machine
agent-bridge pair --check
It reads, and changes nothing. One line per check: ok,
warn (pairing deals with it, or it only matters sometimes)
or needs the owner: with what to do. For example, on a Mac
that never had Remote Login on:
ok jq: /usr/bin/jq
ok OpenSSH: /usr/bin/ssh-keygen
ok finding machines on the LAN: dns-sd
ok this machine: laptop (macos, me@laptop.local, 192.0.2.10)
warn no SSH host key yet: pair asks for the owner's password to make it first (ssh-keygen -A; it opens nothing)
warn Remote Login is off: pairing turns it on once the code is confirmed (the owner's password), or turn it on in System Settings > General > Sharing
Ready to pair: run 'agent-bridge pair' here and on the other machine at about the same time.
and on a Windows machine without an SSH server, on a network marked Public:
needs the owner: the network 'Home' is Public, where Windows blocks mDNS and SSH: make it Private (Settings > Network & internet > Wi-Fi > Private network)
needs the owner: the SSH server, in an elevated PowerShell 7: & 'C:\...\setup\enable-ssh-windows.ps1' (it lets nobody in yet: pairing adds each peer); or pair --no-accept (this machine then only connects out)
Not ready to pair: 2 thing(s) above need the owner first.
Then pair.
What the plugin does by itself
Nothing touches the network or another machine until you pair. From the moment it's installed:
- Hooks (
hooks/hooks.json, asynchronous: a session never waits for them) write each Claude Code session's state into this machine's activity journal. Until the machine has a peer they keep only the state (working, waiting, idle); once paired, also each tool call's name with a short redacted detail and the first line of each prompt."activity": {"level": "off"}in~/.config/agent-bridge/peers.jsonturns them off. One more hook runs at a session's start, before its first answer: it gives the session one line when unread messages from other machines wait in the project's mailbox (their count, never their text). - An MCP server (
.mcp.json): tools for the session's agent (send_message,reply,read_inbox,submit_task,task_update,task_status,sessions,notify_when_idle). Each runs the CLI once; none runs a command. The same server is a two-way Claude Code channel in a session started with it as one (Messages and tasks). - A monitor (
monitors/monitors.json) runsagent-bridge watch --new --quietin each session, which delivers messages and task events from other machines into the session as they arrive. Outside a git repository, with no peers, or with"watch": {"auto": false}, it stays silent.
Updating
Three ways, on each machine:
- By itself. Turn on auto-update for the marketplace
you installed from:
/plugin> Marketplaces >cruxbitlabs> Enable auto-update (or"autoUpdate": trueon itsextraKnownMarketplacesentry in your settings). Claude Code then updates agent-bridge in the background a few minutes into a session. It's off by default for a marketplace that isn't Anthropic's, and a plugin can't turn it on for you:agent-bridge update --autosays whether it's on here, and where it's set. - From a terminal:
agent-bridge update(--checkonly says whether there is a newer version). It runs Claude Code's ownclaude plugin marketplace updateandclaude plugin update, then points theagent-bridgecommand at the new folder at once. That's the way for a machine where nobody opens Claude Code, such as a build server reached over SSH. For a git clone of agent-bridge it fast-forwards the branch from its upstream instead, and only when the clone has no changes of its own. - From
/pluginin Claude Code. - A copy from the installer updates through its own
installer:
agent-bridge updateinstalls the newest signed release intoreleases/<version>and points the command at it. The two newest releases are kept. It also updates itself once a day from a session's start, like the plugin below. A Homebrew or Scoop copy is updated bybrew upgradeorscoop update. - By itself, from 0.9. At a session's start, in the
background and at most once a day, a plugin installed from a marketplace
updates itself to a newer signed release
(
update --self; its log isupdate.login the state folder). A git clone, a developer's copy, is left to its developer.
Only a release is installed: agent-bridge update (and
the daily --self) installs a commit only when a tag on it
is signed by a key in .claude-plugin/release-signers, read
from the copy installed now. Claude Code's own auto-update doesn't make
that check.
Sessions open during an update load the new version after
/reload-plugins (or in their next session).
Every machine should run the same version. A job works across
versions (the machine that starts it sends what runs on the other), but
pairing, the mailbox and the other machine's own terminal command run
its own copy. So each peer reports the version it has installed:
agent-bridge peers and ping show it
(ab=0.6.3), peers and doctor say
which machine to update, and a pairing whose codes don't match names a
version difference as the likely cause. agent-bridge update
never updates another machine: each one updates itself.
Uninstalling
On each machine:
agent-bridge unpair <peer>for each peer. It removes the key, host-key pin, ssh config block,authorized_keysline and the peer's entry. Run it on both machines of a pair.agent-bridge advertise --uninstallif you installed the advertiser, andagent-bridge fleet leaveif you joined a fleet.agent-bridge uninstall. It lists what it will take back, and asks:- the wiring in each other agent CLI;
- the command and its PATH line (or user PATH entry);
- setup's answers;
- the releases the installer keeps.
Your configuration, keys, mail and pairings stay.
--purgeremoves those too (~/.config/agent-bridge, the state folder,~/.ssh/agent_bridge_*), after listing them. It stops while you still have peers, so no key of theirs stays trusted.--dry-runonly lists;--yesdoesn't ask.A plugin, Homebrew or Scoop copy is theirs to remove:
/plugin uninstall agent-bridge@cruxbitlabs,brew uninstall agent-bridge,scoop uninstall agent-bridge.agent-bridge uninstallsays which applies.If you want sshd back as it was:
- macOS, Linux: delete
/etc/ssh/sshd_config.d/010-agent-bridge.confand reload sshd. - Windows: remove the
agent-bridgeblock at the top of%ProgramData%\ssh\sshd_config, and theagent-bridge-sshandagent-bridge-mdnsfirewall rules (Remove-NetFirewallRule -Name agent-bridge-ssh).
- macOS, Linux: delete
On Windows, agent-bridge install-cli --status also lists
user PATH entries of an agent-bridge that's gone (an old install's
folder), and agent-bridge install-cli --fix removes those,
and only those.