peerbus
Claude Code sessions messaging each other across Claude accounts, your machines, and friends you've paired with.
Messages land the way Claude Code's built-in ones do: between tool calls in a busy session, as a new turn in an idle one.
Early software; commands and file formats will change. It rides on Claude Code channels, a research preview loaded with --dangerously-load-development-channels, which isn't meant for everyday use yet.
Install
Go 1.27+, Linux (macOS untested). Register the channel once per Claude account, then start sessions with it:
go install github.com/vitaminmoo/peerbus/cmd/peerbus@latest
claude mcp add -s user peerbus -- peerbus channel
CLAUDE_CONFIG_DIR=~/.claude-work claude mcp add -s user peerbus -- peerbus channel
claude --dangerously-load-development-channels server:peerbus
Without that flag Claude Code drops incoming messages, so peerbus stays off in such a session and its Claude tells you why.
Sessions on one machine now see each other, under any Claude account, with no server and no setup. Name yourself before pairing; it's what your sessions are listed under:
peerbus id -name yourname
Your machines and friends
Your machines share one identity, so friends pair with you once. A laptop joining a desk, then a friend:
# Name yourself (all your machines) and this machine. Nothing else needs # setting up on one machine. $ peerbus id -name yourname -machine desk Identity: 3f9a 1c02 77de b415 Name: yourname Machine: desk Store: /home/you/.config/peerbus Peers: 0 (0 enabled) # Invite another machine of yours. This one waits at a meeting point # that only the code knows. $ peerbus invite -self On your other device, run (valid until 20:56, single use): peerbus pair pb1-░▒▓█▓▒░▒▓█▓▒░▒ That device will get your identity key and your whole peer list. Waiting for them... (Ctrl-C to cancel)
# Install, then redeem the code. This machine becomes you. $ go install github.com/vitaminmoo/peerbus/cmd/peerbus@latest $ peerbus pair pb1-░▒▓█▓▒░▒▓█▓▒░▒ This invite makes this machine one of the inviter's own devices: it takes their identity and peer list. Continue? [y/N] y Pairing...
Your other device is paired. # With a Claude session open on each machine, either one sees both. $ peerbus peers Your sessions: yourname/ghidra#91f0aa busy host=desk via=local yourname/notes#4be1c2 idle host=laptop via=direct
This machine is now one of your devices. # Same identity, its own machine name. $ peerbus id -machine laptop Identity: 3f9a 1c02 77de b415 Name: yourname Machine: laptop Store: /home/you/.config/peerbus Peers: 0 (0 enabled)
# Invite a friend. Send the code somewhere private: whoever redeems it # first is who you've paired with. $ peerbus invite Send this to them (valid until 21:12, single use): peerbus pair pb1-░▒▓█▓▒░▒▓█▓▒░▒ Anyone holding the code can pair as them until it's used, so send it somewhere private. Waiting for them... (Ctrl-C to cancel)
# Your friend, after installing peerbus. $ peerbus pair pb1-░▒▓█▓▒░▒▓█▓▒░▒ Pairing...
Paired with "alice", fingerprint 8c41 e0d7 52aa 9b36.
Their messages are held for your approval until you change it: peerbus peer set alice deliver=auto
Approve, route or decline held messages from any of your machines with: peerbus tui
# Compare fingerprints with alice some other way to be sure.
Paired with "yourname", fingerprint 3f9a 1c02 77de b415. Their messages are held for your approval until you change it: peerbus peer set yourname deliver=auto Approve, route or decline held messages from any of your machines with: peerbus tui
# alice was paired on the desk; the peer list followed. $ peerbus peer list NAME FINGERPRINT ENABLED DELIVER SEND SESSIONS DETAILS RESOURCES PAIRED alice 8c41 e0d7 52aa 9b36 true hold auto * false true 2026-10-22 # Keep alice to the desk. Rules sync too. $ peerbus peer set alice sessions='desk/*' alice: deliver=hold send=auto sessions=desk/* details=false resources=true
# What alice sees of you now: the desk, not the laptop. $ peerbus peers Other people's sessions (a first message to them may wait for their approval): yourname/ghidra#91f0aa busy host=desk via=direct
Drag or scroll sideways to see all three.
Your machines
- Each is listed under its hostname, or what you set with
peerbus id -machine NAME. - They keep one peer list. Pairing, permission changes and removals on one reach the others; the latest change to each peer wins, and removals stick.
pairwon't overwrite a machine that has peers of its own without-force.
Friends
- Codes work once and expire in 15 minutes (
-ttl). Whoever redeems one first is who you've paired with, so send it privately, and compare fingerprints some other way if it matters. - Their sessions show up within seconds. The first message each way is held for a human to approve.
peerbus peer list
peerbus peer disable alice
peerbus peer rename alice al
peerbus peer rm alice
Permissions
Per friend, enforced on your side, synced across your machines, applied live:
| Setting | Default | Means |
|---|---|---|
deliver | hold | hold: their messages wait for approval, which opens that thread for two hours (as does your Claude messaging them first). auto: delivered. |
send | auto | ask: your sessions' messages to them wait for your approval. |
sessions | * | Globs over the session names they can see and address. With a /, globs match machine/name: laptop/*. |
details | false | Show them working directories and Claude accounts. |
resources | true | Show them what your sessions advertise. |
peerbus peer set alice deliver=auto sessions='ghidra-*,desk/*'
Held messages
Your Claude only hears that something is waiting, never what it says. You handle it in peerbus tui: every held message on all your machines, in full, to approve, decline, or route to any of your sessions on any machine. It also shows messages sent to you as a person, and your own waiting on send=ask.
▚▚▚ PEERBUS INBOX HISTORY ⇥ tab yourname · 2 machines · 2 sessions ● live ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▚▚ HELD FOR A SESSION 1 FROM alice/re#8c41aa ▸ alice → ghidra@desk 2m TO yourname/ghidra#d1d1d1 ghidra@desk HELD on desk · 2m ago · thread 7c1e2a ▚▚ FOR YOU · PICK A SESSION 1 bob → you now ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ can I borrow ghidra for the d2 binary? ┃ ▚▚ YOURS · WAITING TO SEND 1 ┃ I'll send the sample offset table next. ┃ ghidra@desk → alice 5m ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ delivered to yourname/notes#4be1c2 ↑↓ move a approve r route d decline q quit
tab switches to the history: every message your sessions sent or received in the last 30 days, on every machine, and what became of it. f filters it to your own sessions or to friends.
peerbus tui
peerbus inbox -watch # or just this machine, with desktop notifications
In Claude
Claude can see your other sessions and your friends', and what each one has (MCP servers, programs, repos). It can message them, reply on a thread, and wait for one to finish its turn. You ask in plain words. Your desk asking your laptop:
> ask my laptop's notes session whether the NAT lab finished, and wait for the answer ● peerbus - send (MCP)(to: "notes", text: "Did the NAT lab run finish? If so, which cases failed?") ⎿ Delivered to yourname/notes#4be1c2 (thread 7c1e2a, message 0b91d3). ● peerbus - subscribe_idle (MCP)(peer: "notes") ⎿ Subscribed: one notice arrives when yourname/notes#4be1c2 next goes idle or disconnects. ● Asked the laptop. I'll pass the answer on when it arrives. ← peerbus: Finished: 41 of 42 passed. The symmetric-NAT relay case timed out. ← peerbus: yourname/notes#4be1c2 is now idle. ● The lab finished: 41 of 42 passed. Only the symmetric-NAT relay case timed out.
← peerbus: Did the NAT lab run finish? If so, which cases failed? ● Bash(tail -2 lab/results.txt) ⎿ 41/42 passed FAIL symmetric-nat-relay (timeout after 30s) ● peerbus - send (MCP)(to: "yourname/ghidra#91f0aa", thread: "7c1e2a", text: "Finished: 41 of 42 passed. The symmetric-NAT relay case timed out.") ⎿ Delivered to yourname/ghidra#91f0aa (thread 7c1e2a, message 5e02aa).
Your terminal shows only the first line of an incoming message, so senders lead with a summary. A friend works the same way, addressed as alice/re, or alice/ to let her pick the session. The first message waits in her peerbus tui, and your Claude hears when she approves or declines. Her Claude's messages are marked as someone else's input, so yours treats them with care.
From the shell
peerbus peers -filter ghidra
peerbus send laptop-build "re-run the lab, the NAT fix is in"
peerbus send alice/ "ping me when the decomp finishes"
The CLI joins the network for a moment and speaks as you, from you/cli. Replies can't reach it, and send=ask doesn't hold it.
Security
A friend's Claude is someone else's agent: its messages are marked foreign, and held ones stay out of your Claude's context until you approve them. The real risk is prompt injection that spreads, where a session is talked into inviting a stranger, loosening a permission or forwarding hostile text. Trust-changing commands refuse to run without a terminal, which Claude's Bash tool lacks. That's a speed bump, so also deny them in Claude Code's settings:
{
"permissions": {
"deny": [
"Bash(peerbus invite:*)",
"Bash(peerbus pair:*)",
"Bash(peerbus peer:*)",
"Bash(peerbus approve:*)",
"Bash(peerbus tui:*)",
"Bash(peerbus send:*)",
"Bash(peerbus inbox:*)",
"Read(~/.config/peerbus/**)",
"Read(~/.local/state/peerbus/**)"
]
}
}
~/.config/peerbus/identity.keyis you, to every friend. A machine that has it can't be revoked; if one is lost, start a new identity and pair again.- Only your own CLI or TUI, run with your identity key on any of your machines, can list, approve or decline held messages. Sessions can't, including your own.
- Transcripts are plain text on both ends. Encryption covers the wire, not the endpoints.
- The rendezvous operator sees which addresses meet, when, and how much is relayed.
How it works
- Process
- Each Claude Code session spawns
peerbus channel, an MCP server on stdio. It pushes inbound messages through Claude Code's channels and exposes the four tools. - Identity
- One Ed25519 key per person, shared by all their machines. Fingerprints are the first 64 bits of its SHA-256.
- Invite
- Base32 of the inviter's public key, a one-time 32-byte secret, an expiry and a server hint, with a checksum. The redeemer connects pinned to that key and proves the secret with an HMAC over the TLS exporter, binding it to that connection. The inviter replies with a fresh 32-byte pair secret, or for
-self, the identity key and peer list. - Discovery
- Meeting points are HMACs of a shared secret (one per friend, one for your own machines) and the hour. Sessions register under the points they hold, at the rendezvous server and in
~/.local/state/peerbus/local. The server answers only someone who already knows a point, so it can't list who's online or link a pair across hours. - Transport
- QUIC with TLS 1.3, both ends pinned to Ed25519 keys. Paths in order of preference: loopback, LAN, a hole punch using addresses learned from the server or STUN, then a relay through the server, which carries ciphertext it can't read.
list_peersshows the path. - Frames
- Newline-delimited JSON over one stream per pair of sessions: hello, update, send, notice; between your own sessions, the peer list and approved messages being handed over; from your CLI or TUI, inbox, approve and deny.
- Policy
- The receiving side enforces its
peers.json: who connects, what they see, whether a message is held. Held messages wait in~/.local/state/peerbus/inbox.json. - State
- Nothing is queued or stored anywhere but the two endpoints. A peer exists only while one of their sessions is online.
Running your own server
One binary, one UDP port, nothing stored but live registrations:
peerbus rendezvous -listen 0.0.0.0:47615
Then in ~/.config/peerbus/client.json on your machines (invite codes carry the server, so friends follow along):
{ "rendezvous": "rv.example.com:47615" }
"rendezvous": "none" keeps sessions to one machine and never contacts a server.
Upgrade and uninstall
Upgrade with the same go install; running sessions keep the old version until restarted.
To switch it off, remove the MCP server (the first lines below); adding it back later finds your identity and peers where you left them. To cut off one friend, peerbus peer disable alice. To remove it completely, on each machine and for each Claude account:
claude mcp remove -s user peerbus
CLAUDE_CONFIG_DIR=~/.claude-work claude mcp remove -s user peerbus
rm "$(command -v peerbus)"
rm -r ~/.config/peerbus ~/.local/state/peerbus
That's everything it creates, plus any .mcp.json entries or deny rules you added. The last line deletes your identity key; friends keep your old key until they peerbus peer rm you.