Skip to content
andrew.dunn.dev

muxr

Source Decision records crates.io

muxr was a session manager for coding agents, written in Rust over tmux. A session is a campaign addressed <repo>/<campaign>, and that address names three things: the tmux session, a directory holding campaign.md and log.md, and the runtime’s conversation (Claude Code’s session id by default). muxr creates all three together and carries a rename into each.

in orderONE COMMANDmuxr rename<repo>/<campaign>1 · TMUXsession namerename-session2 · DISKcampaigns dircampaign.md, log.md3 · RUNTIMEsession id/rename in the paneRESULTin syncone address
One rename across three surfaces
  • In order: tmux rename-session, the campaign directory within its repo (best effort, never across repos), then the runtime’s own rename command.
  • The runtime has no API for this; the slash command is typed into the live pane as literal text, with Enter sent separately so the agent’s TUI does not read it as a paste.

The core is a resume engine. The system prompt is a pointer: the repo’s harness rules, the campaign’s purpose, and the paths of campaign.md and log.md with an instruction to re-read them, so durable state stays on disk and survives compaction. save snapshots each session’s name, directory, runtime and conversation id; restore relaunches fresh from the pointer; upgrade relaunches each agent on a newly installed binary with --resume.

MUXRflush prompttyped into the panenames the sentinelAGENTflush, then signalwrites log.mdwrites sentinel fileMUXRwait on the fileno idle guessingtimeout abortsEXIT/exitwait for the paneto return to shellREOPENfreshcomposed from pointersentinel clearedno sentinel within the timeout: abort, session untouched
Recycle as a sentinel handshake
  1. muxr types a flush prompt into the tool pane, naming a sentinel path.
  2. The agent writes its state to log.md, then the sentinel. muxr waits on that file and nothing inferred; no sentinel means abort, session untouched.
  3. muxr sends /exit, waits for the pane to return to its shell, and recreates the session fresh from the pointer.
  4. A clean exit with no sentinel never reopens.

Session files are typed records. A missing campaign.md or log.md degrades, since an archived campaign can still be running; a present file that will not parse is an error named at that file, and recycle, upgrade and restore each refuse that session.

What varies by runtime sits outside the core. A runtime adapter is a TOML block: launch, resume and fork arguments, the slash commands for rename, model and exit, and where the conversation id lives; Claude Code and pi ship embedded. The resolver and make-durable extensions are subprocesses, JSON in and JSON out, fail closed.

Config discovery reads a muxr.toml only from the harness repositories the operator lists, because a fragment decides what runs at launch.


Created Mar 2026 · Archived Jul 2026
Retrospective →