← Reddit

I made a message bus so my Claude Code sessions can talk to each other in real time

Reddit · Literally_A_Brain · July 27, 2026
A developer built Claudemux, a message bus that allows Claude Code sessions running in separate tmux panes to asynchronously query each other in real time. The tool uses bash, jq, tmux, and systemd to store messages as JSON files, relay responses between sessions, and support cross-machine communication over SSH. Security is maintained by reading message content from files rather than injecting text directly into sessions, eliminating the need for manual copy-paste of information between panes.

Detailed Analysis

A developer has built Claudemux, a lightweight message bus that allows multiple Claude Code sessions running in separate tmux panes to communicate with each other directly, eliminating the tedious manual relay of information between concurrent AI coding sessions. The tool addresses a specific pain point familiar to developers who run several Claude Code instances at once, one per project or terminal pane, where context discovered in one session (a port number, a model alias, a configuration detail) has no way of reaching another session except through the human operator manually copying and pasting between panes. With a simple command like `/cm ask api which port is auth on?`, the target session wakes asynchronously, reads the question, and returns an answer to the requesting pane, letting the developer continue working without acting as a middleman.

Technically, the implementation is notably minimal: bash, jq, tmux, and a single systemd user service, with no server, no open ports, and no database. Messages are stored as JSON files in per-session mailboxes, and a per-machine relay process watches those mailboxes and uses tmux's `send-keys` feature to notify the target pane when a new message arrives. This architecture reflects a broader ethos in the Claude Code power-user community of building small, transparent, auditable tools rather than heavyweight orchestration frameworks — favoring plain text files and standard Unix utilities over databases or custom servers, which keeps the system easy to inspect, debug, and trust.

A significant design consideration in Claudemux is security around cross-session communication. Because injecting arbitrary text into another AI session's context could be a vector for prompt injection or unintended command execution, the tool is careful to ensure that the only thing ever typed into a peer's pane is a fixed `/cm recv` command; the actual message content is read from a file by that command rather than being injected as a live conversational turn. Incoming messages are also explicitly framed as untrusted data. This distinction matters a great deal in agentic AI workflows, where multiple autonomous or semi-autonomous processes increasingly need to exchange information, and where careless design could allow one compromised or malicious session to manipulate another. The tool even supports cross-machine communication over SSH, extending the same message-passing model beyond a single host.

This project is emblematic of a growing trend among developers using Claude Code and similar agentic coding tools: as AI coding assistants become powerful enough to run many parallel, semi-independent work sessions, new coordination problems emerge that traditional single-session tooling never had to address. Rather than waiting for Anthropic or other vendors to build multi-agent orchestration into their products, community members are prototyping their own lightweight middleware — often open-sourced, as Claudemux is on GitHub — to solve these emergent workflow gaps. It reflects how the ecosystem around Claude Code has matured to the point where users treat individual AI sessions less like isolated chatbots and more like distributed processes or "agents" that need inter-process communication, mirroring concepts from traditional distributed systems (message queues, mailboxes, relays) but adapted for a world where the "processes" are LLM-driven coding assistants. It's a small but telling signal of how multi-agent, multi-session AI development patterns are becoming a genuine engineering discipline rather than a novelty.

Read original article →