cmux

A command tool for the cmux macOS terminal app, using its command-line interface to manage workspaces.

In plain words
What is it for?
Saving and restoring workspace sessions, listing workspaces, renaming or closing them, reviewing cleanup choices, and applying colors from a local rule file.
Why use it?
It avoids repeating workspace setup and makes it easier to keep terminal sessions organized. It can also save a workspace layout so it can be restored later.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/bvdr/claude-plugins/cmux
Clone the repo
git clone --depth 1 https://github.com/bvdr/claude-plugins
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,781 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.02781
Opus 5 $0.00035 $0.01391
Sonnet 5 $0.00014 $0.00556
Haiku 4.5 $0.00007 $0.00278

Measured 2d ago against content hash 4c7e8c96befb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cmux scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

out = subprocess.run([cmux] + args, capture_output=True, text=True)
plugins/bvdr/commands/cmux.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cmux

Drives the cmux macOS terminal (cmux.app) over its Unix-socket CLI to save / restore / clean / recolor workspaces.

Usage

Subcommands (parse from user's message):

Subcommand What it does
save [path] Dump every workspace in the current cmux window to a portable JSON. Default path: ~/cmux-sessions/<UTC timestamp>.json.
restore <path> Recreate workspaces from a JSON saved by save. Skips ones already present (matched by name).
apply-colors Color every workspace based on the user's local rule file (~/.config/cmux-skill/colors.json). Idempotent. No-op (with hint) if the file is missing.
rename <ws> <new-name> Rename a single workspace (workspace ref like workspace:5 or current name).
cleanup Walk every workspace and ask the user (one prompt per workspace) whether to keep / rename / close.
list Pretty-print current workspaces with their colors and CWD.

If the user just says "cmux" with no subcommand, ask which one. Don't guess.

Pre-flight (run once per session, not per subcommand)

  1. Locate the binary. Try command -v cmux; if missing, fall back to /Applications/cmux.app/Contents/Resources/bin/cmux. Cache this in a shell var CMUX=. If neither exists, tell the user cmux isn't installed and stop.
  2. Verify daemon. Run "$CMUX" ping. If it returns "Broken pipe (errno 32)", the cmux app's socketControlMode is cmuxOnly — external CLI control is blocked. Tell the user:

    Add "automation": { "socketControlMode": "automation" } to ~/.config/cmux/cmux.json (back the file up first), then restart cmux. (Reload via cmux reload-config doesn't help here because reload itself goes through the same socket.) Then stop. Don't auto-edit the config without explicit consent — it relaxes a security boundary.

Color mapping

Color rules live outside this repo in ~/.config/cmux-skill/colors.json. The file is intentionally not shipped — project names are personal context. Format:

Read the full file on GitHub · 219 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 219 lines · 70 tokens per session scan A 4c7e8c96befb

Subscribe to this mod's changes

cmux is a command published in the GitHub repository bvdr/claude-plugins (3 stars, last pushed 2mo ago), licensed MIT. It adds 70 tokens to every session and 2,781 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.