← Back to the collection

cmux-cli

Claude Code plugin that teaches agents to control cmux — the macOS terminal multiplexer and workspace manager — through its cmux CLI.

What it does

Exposes cmux’s surface area to Claude:

The skill is deliberately thin: rather than mirroring cmux’s flags into prose (which would bitrot the moment cmux ships a new release), it runs cmux <cmd> --help inline at invocation time. The CLI itself is the source of truth, and cmux guide is cmux’s own agent-facing index.

What the skill adds on top of --help is the part help text can’t carry: which command to reach for, and the failure modes. A handle that fails to resolve doesn’t error — it falls back to the caller, so a chained --json → jq → --surface pipeline with an empty handle delivers its payload into the agent’s own surface. A trailing \n submits to a shell but not to an Ink REPL. Positional refs renumber mid-loop while UUIDs don’t. Each of those is a documented trap with the evidence attached.

Codified workflows

Two common multi-step patterns are baked in as decision trees rather than left for the agent to rediscover:

  1. Open a side-by-side surface in the current window — routes intelligently between cmux new-surface --pane <adjacent> (when an adjacent pane already exists, so the new surface lands as a tab there) and cmux new-split right (when it doesn’t). Uses cmux identify’s caller.pane_ref to know where the agent is, and focused.pane_ref when the user means “next to what I’m looking at” rather than “next to mine”. Every surface it opens gets a human-visible title (--title), and it hands back surface_title + workspace_name — because “opened surface:258” is a correct handle and a useless report: cmux never shows refs in its UI and they renumber as tabs come and go.
  2. Target another surface (find → read → interact) — uses the bundled find-surface.sh helper to locate a surface by workspace name, title, or on-screen content, then cmux read-screen / cmux send against the returned handle.

Skills

Auto-resolved context

At skill load, the plugin inlines cmux identify --json --id-format both so the agent sees caller.* (where it’s running), focused.* (where the user is looking), and the authoritative socket_path before its first turn. No warm-up round-trips needed. The --id-format flag is not optional: without it identify returns positional refs and no UUID keys at all, so a .caller.surface_id lookup comes back null and reads like cmux has lost track of the agent.

Installation

claude plugin install jtsternberg/cmux-cli

Requirements

Triggering

The skill activates when you mention cmux, workspaces, panes, surfaces, tabs, or ask to drive a cmux session (e.g., “split this pane right”, “open a new tab next to mine”, “read the terminal output from workspace 2”, “send git status to the other pane”, “find the surface in my ‘debug lindy’ workspace that’s hitting the 500 error”, “show build progress in the sidebar”, “use cmux’s browser to open localhost:3000”).