[ open source · MIT ]

ccmux

Persistent, self-healing Claude Code sessions in tmux

A single daemon per machine keeps a fleet of long-running agent sessions alive: it heals crashed ones, brings them back on reboot, and resumes the same conversation by a pinned uuid. Sessions are full interactive claude processes — ccmux supervises them, it does not reimplement them.

Install
curl -fsSL https://github.com/max-listov/ccmux/releases/latest/download/install.sh | bash

Requires macOS (launchd) or Linux (systemd), plus tmux.

Version
v0.1.19
Commits
43
Last commit
25 Jul 2026
License
MIT

The whole fleet from one CLI

Pick a command to see what it actually prints. These are real outputs, taken from a running install — not mock-ups.

ccmux list
$ccmux list
SESSION        MODEL     CTX              STATE    UPTIME  RC             DIR
cc-api         Opus 5    890.0k/1.0M 89%  working  16m     prod-api       ~/code/api
cc-web         Opus 5    420.0k/1.0M 42%  idle     3d11h   prod-web       ~/code/web
cc-infra       Opus 5    740.0k/1.0M 74%  idle     3d20h   prod-infra     ~/infra
cc-docs        Opus 4.8  100.0k/1.0M 10%  waiting  3d20h   prod-docs      ~/code/docs

Context left, state and uptime per session. Note the uptime in days — these survive reboots.

How it stays alive

Six situations a long-running agent session actually meets. Pick one to see what happens and who handles it.

The normal case

handled by supervisor

A tmux session whose foreground process is a small supervisor loop. It launched claude and is watching it. The conversation is pinned to a fixed uuid, and its history is written to a jsonl transcript.

Built for a fleet, not one laptop

  • Two-level permissions

    A machine default plus an optional per-session override. Under a root daemon, escalated modes are downgraded at launch — a config edit cannot hand a server session host-wide power.

  • Inter-agent chat

    Opt-in messaging between managed sessions, so one agent hands off to another without you relaying. Messages can be deferred until the recipient finishes its turn, or armed on a timer.

  • Adopt external sessions

    A claude you started by hand shows up as external. Fork it into a safe copy, or take over the original.

  • Self-updating fleet

    Releases are born only from tags, in CI. Machines pick up the verified bundle on their own — and sessions survive the update.

Requirements

Operating system
macOS or LinuxThe daemon runs under launchd or systemd.
Required
tmuxEvery session is a tmux session; attach to it like any other pane.
Runtime
BunInstalled automatically by the install script if missing.
Agent backend
claude · codexSessions are real interactive processes using your own subscription.
Install
One commandDownloads the verified release bundle and starts a self-updating daemon.
License
MIT

When to reach for it — and when not to

Good fit

  • Agent sessions that must survive crashes, reboots and days of uptime
  • Several machines running long-lived Claude Code sessions at once
  • Driving a session by name from scripts and hooks instead of by hand in tmux
  • Handing a task from one agent session to another without relaying it yourself

Look elsewhere

You run one session, occasionally
Plain tmux plus claude does that fine. ccmux earns its place when sessions are long-lived and there are several of them.
You are on Windows without WSL
The daemon is launchd or systemd, and everything sits on tmux. macOS and Linux only.
You want a hosted web UI
ccmux supervises local processes on your own machines. There is no server component and no dashboard to log into.
You expect it to replace Claude Code
Sessions are ordinary interactive claude processes with your subscription, slash commands and statusline. ccmux keeps them alive — it does not reimplement them.

Frequently asked

What happens to my session when Claude Code crashes?

It comes back. The foreground process of each tmux session is a small supervisor loop that relaunches the agent with exponential backoff, so a crash is just a pause. Killing the tmux session is the only way to actually stop it.

Does it survive a reboot?

Yes. One daemon per machine is registered with launchd or systemd, starts on boot and re-creates every managed session within about thirty seconds.

Do I lose the conversation when a session restarts?

No. Every session pins a fixed uuid — created once, resumed after — so a restart continues the same conversation instead of opening a new one. There is no session picker to get stuck on, and blocking resume prompts are answered automatically so an unattended heal never stalls at a menu.

What is 'follow the fork'?

When Claude runs out of context it forks the conversation into a new session id, leaving the old transcript behind. Each heal pass detects that the conversation moved and re-pins the registry, so transcripts and the next restart follow the live conversation rather than a dead file.

Is it safe to run on a shared server?

There is a root guard: under a root daemon, escalated permission modes are downgraded to auto at launch — whether they came from the machine default or a per-session override. A config edit cannot hand a server session host-wide power.

Can two agent sessions talk to each other?

Yes, and it is off by default. Enable chat per session, then one session can message another; messages can be deferred until the recipient voluntarily finishes its turn, or armed on a timer. Nothing is sent or received until both ends opt in.

Can I still use plain tmux commands?

Yes. Sessions live on the default tmux socket, so tmux attach, tmux ls and detaching with Ctrl-b d all work as usual. ccmux supervises them; it does not hide them behind a custom protocol.