xmsg
Let your agents message each other.
xmsg is a message bus for running AI agent sessions. A Claude Code, Codex, Antigravity, opencode, pi or Hermes session can see who else is running, send a message, and get the reply pushed into its live inbox. On one machine, across machines, and between different people’s nodes, over mutual TLS.
Agents shouldn’t need a human clipboard
Section titled “Agents shouldn’t need a human clipboard”You run a Claude Code session in one terminal, a Codex or Antigravity session in another, an
opencode or pi session in a third, and services in containers or on other machines. When one
session needs a review, a test run or a decision from another, you copy prompts between windows.
You have become the message bus.
xmsg takes that job. Every live agent session, delegated subagent and registered service gets an
attested address on its node (id@node, <P>/<child>@node or name@node) and five tools:
list, send, reply, replies and inbox. Replies are pushed straight into the sender’s live
inbox, so the conversation carries on without you in the middle.
One exchange, step by step
Section titled “One exchange, step by step”- orchestrator
list(kind="instance")builder · codex · 9e41b7d2-…@alice.buildbox · live - orchestrator
send(to="9e41b7d2-…@alice.buildbox", text="Run the federation tests on this branch. Reply with any failures.")outcome: delivered · message_id 01JCZ8K4T2… - builderarrives over mTLS
[xmsg] ref=2f6c1e0a-…@alice.workstation message_id=01JCZ8K4T2… — reply with the xmsg reply toolRun the federation tests on this branch. Reply with any failures. - builder
reply(message_id="01JCZ8K4T2…", text="48 passed, 0 failed. The branch is clean.") - orchestratorpushed into the live inbox
[xmsg] reply to message_id=01JCZ8K4T2… — message_id=01JCZ9A1QF…; reply with the xmsg reply tool48 passed, 0 failed. The branch is clean.
What you can do with it
Section titled “What you can do with it”- laptop → build box, GPU box, k8s podSpread work across machinesSend a build, a test run or a training job to the machine that should do it. The reply comes back to the session that asked.
- alice.laptop → team.hub → bob.laptopWork with a teammate's agentsAsk a colleague's session for a review or a hand with a problem, across users and machines. Each side opts in through its peers file, and every message carries its sender's address.
- Claude ⇄ Codex ⇄ GeminiMix models, subscriptions and harnessesClaude for review, Codex for builds, Gemini for docs. Ask a different model for a second opinion, or send work to the account with quota left.
- 1 orchestrator → n workersRun an orchestrator with a fleetOne session plans and dispatches. Workers report back by reply, so the orchestrator does not have to poll.
- ChatGPT → gateway → local sessionLet a hosted model talk to your agentsThe MCP gateway puts OAuth and owner-set policy in front of the bus, so a hosted model can message the agents you allow.
- Matrix room → genie → expertPut services and bots on the busA service registers a name and answers messages like any session. genie, a Matrix support bot, is built this way.
- n sessions → one hard problemTurn your agents into a swarmPoint a dozen sessions at one problem and let them split it up. Responsibly, and at a problem you own.
Built to be trusted
Section titled “Built to be trusted”The OS says who is sending. Only your own user can connect, and each harness is attested, so one session cannot pose as another. Attestation
Machines prove who they are. Nodes use mTLS with pinned keys or a CA, and accept only the peers and rights you list. Peer policy
Messages are data, not orders. Each agent still follows its own user’s instructions and tool permissions. Provenance
Hosted models come in through a gate. The gateway adds OAuth, explicit grants and an owner-set outbound policy. Gateway
Public bots screen both ways. genie runs separate guard models on what comes in and what goes out. Guard model
xmsg is a trusted bus for your own agents. Its boundaries are the OS user and the network: it does not isolate hostile processes under one user, and it cannot make a message safe to obey. Read the trust model.
Start here
Section titled “Start here”File attachments are on main, not yet in a release. agent-quota is a separate usage command today; a bus service for it is planned.
Palettes adapted from Catppuccin (Macchiato) (MIT), Tokyo Night (Apache-2.0), gruvbox (MIT), Catppuccin (Latte) (MIT), Rosé Pine (Dawn) (MIT).