cmux

cmux is a skill for Claude Code from kellykampen/agent-skills. It costs 52 tokens per session (4,391 once invoked), scanned A, original, MIT.

A macOS terminal control tool for managing workspaces and split panes through commands or a local socket. A terminal multiplexer lets several terminal sessions run in one organised window.

In plain words
What is it for?
Use it to create workspaces, split panes, send text or keys, show notifications, and update sidebar status.
Why use it?
It removes manual work when arranging terminals or sending the same input to running sessions. It also lets local scripts control the terminal layout and display notifications.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument; mentions Claude Code; mentions Codex.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/greg/.local/state/cmux/cmux-501.sock.

Part of the agent-skills plugin — 25 skills, 7 commands shipped together

Good fit Use it to create workspaces, split panes, send text or keys, show notifications, and update sidebar status.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add kellykampen/agent-skills
Claude Code
/plugin install agent-skills

Made for: Claude Code.

Or install agent-skills, the plugin that ships this one along with the rest of its 25 skills, 7 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cmux

README.md
[![agentmods](https://agentmods.dev/badge/skills/kellykampen/agent-skills/cmux/github.svg)](https://agentmods.dev/skills/kellykampen/agent-skills/cmux)
Your own site
<a href="https://agentmods.dev/skills/kellykampen/agent-skills/cmux"><img src="https://agentmods.dev/badge/skills/kellykampen/agent-skills/cmux/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cmux

Your own site · 80×15
<a href="https://agentmods.dev/skills/kellykampen/agent-skills/cmux"><img src="https://agentmods.dev/badge/skills/kellykampen/agent-skills/cmux.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,391 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00052 $0.04391
Opus 5 $0.00026 $0.02195
Sonnet 5 $0.00010 $0.00878
Haiku 4.5 $0.00005 $0.00439

Measured 12d ago against content hash 31da0695d0f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 12d 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.

subprocess.run(['python3', '/private/tmp/.../my_script.py'])
skills/agents/cmux/SKILL.md · 511 lines

How it starts

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

cmux

Overview

cmux is a native macOS terminal built on Ghostty with a programmable Unix socket API. This skill covers all local control: workspace and surface management, sending input, notifications, and sidebar status.

Purpose: Automate cmux workspaces, panes, and UI from within a running cmux session or any local process.

Quick Detection

# Am I inside cmux?
[ -n "$CMUX_WORKSPACE_ID" ] && echo "inside cmux" || echo "not in cmux"

# Is cmux running?
[ -S /tmp/cmux.sock ] && echo "cmux socket live"

Socket API

Connection

# Default socket (release build)
/tmp/cmux.sock

# Debug build
/tmp/cmux-debug.sock

# Override via env var
export CMUX_SOCKET_PATH=/tmp/cmux.sock

Request format — newline-terminated JSON:

echo '{"id":"req-1","method":"workspace.list","params":{}}' | nc -U /tmp/cmux.sock

Response format:

{"id":"req-1","ok":true,"result":{...}}

Helper function (paste into shell or script)

cmux_call() {
  local method=$1 params=${2:-{}}
  echo "{\"id\":\"$$\",\"method\":\"$method\",\"params\":$params}" | nc -U "${CMUX_SOCKET_PATH:-/tmp/cmux.sock}"
}

Socket Methods

System

# Ping
cmux_call system.ping

# What capabilities does this cmux version have?
cmux_call system.capabilities

# Identify current window/workspace/surface context
cmux_call system.identify

Workspace

# List all workspaces
cmux_call workspace.list

# Create new workspace
cmux_call workspace.create

# Switch to workspace
cmux_call workspace.select '{"workspace_id":"<id>"}'

# Get active workspace
cmux_call workspace.current

# Close a workspace
cmux_call workspace.close '{"workspace_id":"<id>"}'

Spawning an Agent in a New Pane (MANDATORY PATTERN)

When delegating a task to another Claude agent via cmux:

  1. Split a new pane in the CURRENT workspace (never create a new workspace)
  2. Check if a shell is ready — read_text to confirm prompt is showing
  3. Start Claude using ccc — never use claude --print or claude directly
  4. Send the task — two-step: send_text (no \n) then send_key enter
  5. Tell the agent to report back to THIS terminal — instruct it to send a desktop notification AND send a message back to the calling surface via the cmux socket, so the parent Claude session gets notified

Read the full file on GitHub · 511 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 511 lines · 52 tokens per session scan A 31da0695d0f0

Subscribe to this mod's changes

cmux is a skill published in the GitHub repository kellykampen/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 4,391 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.

Related

Other skills, from other repositories