session-mesh
A Claude Code plugin that lets your own Claude Code sessions (other terminals, cluster nodes, your laptop) discover each other and exchange short messages, with replies. Pure Python 3 standard library, no dependencies, Linux and macOS (WSL works like Linux).
Laptop -> cluster (most common)
You sit at a laptop (often macOS, no sshd, behind NAT) and ssh into a cluster login node. Two steps, then it just works in both directions over that one ssh connection:
- Install the plugin on both machines (laptop and cluster):
/plugin marketplace add RyanKim17920/session-mesh
/plugin install session-mesh@session-mesh
Optional CLI: meshctl lives in the plugin directory (bin/meshctl, under ~/.claude/plugins/ for an installed plugin). Either symlink it, e.g. ln -s <plugin dir>/bin/meshctl ~/.local/bin/meshctl, or git clone https://github.com/RyanKim17920/session-mesh and link bin/meshctl from there. Nothing below needs it.
- Reconnect your ssh session once (already-open connections predate the install and have no forward). Open a new Claude Code session on the laptop first (the SessionStart hook sets everything up), then
ssh cluster as usual.
That is all. On the next ssh connection the laptop's relay socket is reverse-forwarded to the cluster, the cluster side connects back over the same socket, and mesh_list_peers on either side shows the other side's sessions (via link: on the laptop, via relay: on the cluster).
What the SessionStart hook does on each machine, idempotently and in the background:
Needs OpenSSH >= 8 for the %r token (the remote user name); on older clients a fixed /tmp/cmesh-<local user>-<host>.sock is used, which only works when the remote user name equals the local one. The remote sshd must allow AllowStreamLocalForwarding (default yes).