feat(bridge): add a cc-peer bridge for cross-machine Claude Code relay - #148
Merged
Merged
Conversation
cc-peer speaks Claude Code's own local cross-session peer protocol
directly -- a per-session Unix socket with no cross-machine leg of its
own. This bridge relays exactly one local Claude Code peer into the
agent-comms mesh, the same "one bridge process is one agent is one
device" model every other bridge here already follows, so that session
becomes reachable from any other agent-comms bridge including one on a
different machine, riding on the mesh's own transport.
wireCcPeerBridge (bridge.ts) is the pure, dependency-injected relay
wiring: an inbound cc-peer "message" event is posted into this bridge's
own project room via buildAction/CommsTool.handle; a mesh delivery for
this bridge's own agent is relayed back to the configured target via
CcPeer.send(). run.ts does the real construction (CcPeer.create,
createBridgeMesh, CLI target parsing) and hands both to the wiring
function, kept separate so the relay logic itself is testable without a
real local Claude Code session.
Run via: npx agent-comms bridge cc-peer <target-name>
or npx agent-comms bridge cc-peer --pid=<pid>
Mearman
marked this pull request as ready for review
September 16, 2026 06:43
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 3.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #87.
cc-peer speaks Claude Code's own local cross-session peer protocol directly -- a per-session Unix socket with no cross-machine leg of its own. This bridge relays exactly one local Claude Code peer into the agent-comms mesh, matching the "one bridge process is one agent is one device" model every other bridge here follows, so that session becomes reachable from any other agent-comms bridge, including one on a different machine, riding on the mesh's own transport.
Note: #87's own body describes this "riding on the existing federation link today, and on wire-mesh's own relay/capability-token model once that lands (#51)" -- both
federation.tsand #51 no longer exist as of this session (federation was fully retired in favour ofconnectToRemote, #144). Cross-machine reach now comes fromconnectToRemote/mesh_listen/wire-mesh's own gossip-advertised listener addresses (#147) directly, with no federation fallback. This bridge itself has no dependency on that either way -- it only needs the localMeshStorethis repo already provides, same as every other bridge.Design
wireCcPeerBridge(bridge.ts) is the pure, dependency-injected relay wiring: an inbound cc-peer"message"event is posted into this bridge's own project room viabuildAction/CommsTool.handle; a mesh delivery for this bridge's own agent is relayed back to the configured target viaCcPeer.send().run.tsdoes the real construction (CcPeer.create,createBridgeMesh, CLI target parsing) and hands both to the wiring function -- kept separate so the relay logic is unit-testable without a real local Claude Code session (none exists in CI or this environment).CcPeer's own "do not split listening and sending across processes" constraint and every other bridge's own 1:1 model.Run via:
Smoke-tested directly: the real CLI path (
node dist/cli.js bridge cc-peer <target>) constructs a realCcPeerinstance, registers with the local mesh, and starts listening with no crash;--pid=/missing-target argument handling verified against the real CLI.cc-peerwas added to this account'smin-release-age-excludelist (it's an ExaDev-owned package, published 2 days ago, missing from that list -- a gap, now fixed) per the standing convention for first-party dependencies.Test plan
pnpm typecheckpnpm lintpnpm test(778/778, including 4 new tests for the relay wiring)pnpm build