Claude Code plugin · v0.4.24

Your coding agent, anywhere you are.

Chat with your live Claude Code session over Matrix. From your phone on the bus, a laptop at the café, a second machine at home, any device. Real-time, in the same conversation. Not a one-shot bot. Not a poll loop. Your actual running agent.

install
$ claude plugin marketplace add arikw/claude-code-matrix-bridge
$ claude plugin install rx-claude-matrix-bridge@arikw
$ claude --dangerously-load-development-channels plugin:rx-claude-matrix-bridge@arikw
MIT licensed Runs on your machine Works with any Matrix client
claude · my-project
> let's also extract that auth middleware into its own file
Refactoring `src/middleware/auth.ts`...
• Created file
• Updated 3 imports
• Tests still pass
[channel src=matrix-bridge user=@you ts=14:32]
  also add a jsdoc comment to the new file
Adding doc comment...
src/middleware/auth.ts
$

How it works

Three pieces. Always-on daemon, per-session MCP relay, your matrix client.

1. Daemon listens to Matrix

A small Node.js daemon stays connected to your Matrix homeserver (Synapse, Tuwunel, Conduwuit, Dendrite, hosted matrix.org — anything spec-compliant). Auto-joins rooms you invite the bot to and forwards every message from the configured owner account.

2. Plugin routes per session

An MCP server runs per Claude Code TUI. It registers your session with the daemon and binds it to a Matrix room via the /mx-link-chat slash command. Each room talks only to its bound session.

3. Live push, not poll

Matrix messages arrive in your TUI as Claude Code Channels-API notifications — part of the same conversation Claude is already having with you. Replies go back to Matrix via the reply tool.

data flow (both directions)
Matrix world
Your matrix client  <->  Matrix homeserver
m.room.message events in both directions
/sync long-poll (inbound)  ·  PUT /rooms/…/send (outbound)
Always-on background process
rx-claude-matrix-bridge daemon
owns the matrix connection, maintains the session_id -> room map (links.tsv), routes events
AF_UNIX socket (line-JSON)  ·  inbound / reply / link_chat messages
MCP relay — one per Claude Code TUI
stdio MCP server
registers (session_id, cwd) with the daemon, forwards inbound matrix events to its TUI, forwards reply tool calls back to the daemon
stdio  ·  notifications/claude/channel (inbound)  ·  reply tool call (outbound)
Your terminal
Live Claude Code TUI session
sees inbound matrix events as channel notifications in the running conversation; calls the reply tool to send back

When the TUI is offline, the daemon falls back to spawning claude --print --resume <sid> in headless mode — same path back to the room, no live session needed.

Why you'd want this

Not just for phones. For any time you're away from your terminal.

Continue from anywhere

Phone, second machine, dev container, hotel laptop. Any device that runs a Matrix client can drive your live coding agent. No browser tab. No remote desktop. No SSH tunnel.

Real-time, same context

Messages arrive in the running Claude session as Channels-API notifications. Same conversation Claude was already having with you — your previous prompts, the project dir, everything in the session's context. Not a fresh process spawned per turn.

Survives anything

Closed your terminal? Headless claude --print --resume takes over so your message still gets answered. Re-opened with --resume? Routing reattaches. Plugin updated? Stale-version auto-detected.

What's in the box

Built for long coding sessions, not toy demos.

Live push via Channels API

Matrix events wake your live TUI conversation instantly. Same agent, same context — no spawned subprocess, no key-injection.

Multi-session routing

N rooms <-> N TUI sessions. Each Matrix room talks only to its bound Claude Code session. Different projects stay isolated.

Headless fallback

TUI offline? Daemon spawns claude --print --resume <sid> automatically. Replies post back to the room — when you re-open the TUI with --resume, the headless turn is already in the transcript.

Owner-only access

Only messages from your configured matrix account drive Claude. Other room members are silently ignored. Single-user trust model.

Interactive setup wizard

First-run /mx-link-chat kicks off a guided wizard: homeserver detection, optional bot creation (Synapse admin only), one-shot password login to obtain an access token, config written to disk with chmod 0600.

Context-switch recap

Switched from TUI to phone mid-task? The bridge auto-prepends a recap instruction so Claude summarizes the other channel before answering. No black box.

StatusLine at a glance

Persistent indicator in your Claude Code statusLine. 🔗 mx:<room> when linked, ✏️ when the other side is typing, ⛓️‍💥 when the channels flag is missing, when config is incomplete, 🔄 when the plugin was updated mid-session. Problems surface immediately — no silent failures.

Works with any matrix client + any matrix homeserver

Element
iOS, Android, web
FluffyChat
cross-platform
SchildiChat
Android, desktop
Cinny · Nheko · CLI
+ any spec-compliant client

Homeservers: Synapse · Tuwunel · Conduit · Conduwuit · Dendrite · self-hosted or hosted matrix.org. Use whatever you already trust.

How it compares

A few Matrix-side plugins for Claude Code exist now. Different trade-offs. This one is the only one with built-in multi-session routing and a headless fallback when the TUI is offline — but other options have E2EE today, or a permission-relay UX, or attachment tools that this one doesn't.

Transport
rx-claude-matrix-bridge Channels API push
elkimek/matrix-bridge MCP tool calls (pull)
nazbav/…matrix-channel Channels API push
Kholtien/…matrix-integration Channels API push
Wakes live TUI session
rx-claude-matrix-bridge yes
elkimek/matrix-bridge no — agent must call read_messages
nazbav/…matrix-channel yes
Kholtien/…matrix-integration yes
Multi-session routing
rx-claude-matrix-bridge built-in
elkimek/matrix-bridge no
nazbav/…matrix-channel no
Kholtien/…matrix-integration single-room
Headless fallback when TUI offline
rx-claude-matrix-bridge auto
elkimek/matrix-bridge no
nazbav/…matrix-channel no
Kholtien/…matrix-integration no (systemd + tmux scaffold)
Interactive setup wizard
rx-claude-matrix-bridge yes
elkimek/matrix-bridge manual
nazbav/…matrix-channel partial (skill)
Kholtien/…matrix-integration yes (configure skill)
End-to-end encryption (E2EE)
rx-claude-matrix-bridge roadmap
elkimek/matrix-bridge built-in (vodozemac)
nazbav/…matrix-channel no — encrypted rooms dropped
Kholtien/…matrix-integration built-in (Rust Olm)
Permission relay (approve tools from matrix)
rx-claude-matrix-bridge no
elkimek/matrix-bridge no
nazbav/…matrix-channel no
Kholtien/…matrix-integration yes (reactions or text)
Attachments / reactions / edits
rx-claude-matrix-bridge text only
elkimek/matrix-bridge text + send_and_wait
nazbav/…matrix-channel edit, react, download_attachment
Kholtien/…matrix-integration reactions for permission UX
Common to all Channels-API plugins

Every plugin in the table above that uses Claude Code's Channels API push transport (rx-claude-matrix-bridge, nazbav/…matrix-channel, Kholtien/…matrix-integration) needs the launch flag --dangerously-load-development-channels plugin:<plugin-name>@<marketplace>. CC's matcher splits the MCP server-id on : and rejects the legacy server:<name> form for plugin-loaded servers (notifications silently dropped). The persistent setting "channelsEnabled": true in ~/.claude/settings.json is additionally required on Team/Enterprise tiers and on accounts with a managed-settings policy file; on plain personal accounts it's a no-op. elkimek/matrix-bridge avoids both because it doesn't use the Channels API at all — it exposes MCP tools the agent calls explicitly.

This plugin's wizard sets the setting and prints a tailored shell-rc alias for the flag so the user doesn't have to remember either. The other Channels-API plugins leave both as manual steps.

Questions

Do I need to run my own matrix server?

No. Any matrix homeserver works — matrix.org, your company's homeserver, or whatever a friend already runs. Self-hosting (Synapse, Tuwunel, Conduit, Conduwuit, Dendrite) gives you more control and is recommended long-term, but isn't required to get started.

What if my Claude Code session is offline when I message?

The daemon spawns a headless claude --print --resume <sid> to handle the message, and posts the reply back to the matrix room. When you re-open the TUI with claude --resume, it sees the full transcript including that headless turn.

Will my coworkers see my conversations?

Only if you add them to the matrix room. The bridge routes per-room and per-session — you control sharing at the matrix-client layer. Invite, kick, leave, anytime.

What about multiple projects?

Each Claude Code session links to its own room. The bridge can create one room per project (or you can pick existing rooms via an interactive picker). Inbound traffic in a room only ever reaches the session that owns it.

Why is the launch flag scary-named?

The Channels API is still a Claude Code research preview, and dangerously is Claude Code's convention for unstable / preview surfaces (same family as --dangerously-skip-permissions). If the API graduates to a stable name, the plugin will move with it.

Windows support?

Via WSL2 only. The plugin uses bash for hooks + the setup wizard. Native cmd.exe / PowerShell isn't supported and isn't planned.

End-to-end encryption?

Rooms are unencrypted by default in the current release — your matrix homeserver operator can read traffic. Use a homeserver you trust or self-host. E2EE (olm/megolm sidecar) is on the roadmap.