matymatyk-business/cmux-skill/cmux
- community
Checking that the SKILL.md file is still in the repository.
MUST be read ANY time you interact with cmux in ANY way — listing/inspecting/creating/closing cmux workspaces, panes, or surfaces; reading or capturing pane/screen output; sending input or keys to a pane/surface; delegating to, polling, or checking on other agents running in cmux panes/surfaces; building or rearranging terminal layout; cmux browser automation; sending notifications/flashes/status/progress to the sidebar; editing cmux settings; or integrating an agent with cmux hooks. If your command starts with `cmux ` or touches a cmux workspace/pane/surface/agent, read this FIRST. Triggers on "cmux", "in this workspace", "this pane", "the other agent", "delegate to", "check on the agent", "send to the pane". macOS only (14.0+).
Install
npx vskill@latest install matymatyk-business/cmux-skill/cmuxSKILL.md
cmux Control
cmux is a native macOS terminal app for running multiple AI coding agents in parallel. It exposes a CLI (cmux) and a Unix-socket JSON-RPC API (/tmp/cmux.sock) for full topology and browser control.
Core Concepts
- Window — top-level macOS cmux window
- Workspace — sidebar tab within a window (one git branch / project context)
- Pane — split region inside a workspace
- Surface — tab inside a pane (terminal or browser)
Handles default to short refs (workspace:2, pane:1, surface:7); UUIDs accepted as input. Add --id-format uuids|both for UUID output.
Ref syntax — get this right or fail silently
- Always use PREFIXED refs (
pane:38,surface:46). A bare number is treated as an INDEX, not an ID —--surface 46means "the surface at index 46" (usually nonexistent → silent failure), NOTsurface:46. - `read-screen` and `capture-pane` have NO `--pane` flag — they target
--workspaceor--surfaceonly. Passing--paneerrors, and a bare/missing target falls back to your OWN surface (you'll read your own footer and draw wrong conclusions). To read a pane: resolve it to a surface FIRST withcmux list-pane-surfaces --pane pane:N, thencmux read-screen --surface surface:N. - Never append `2>/dev/null` to cmux commands. Errors go to stderr with exit code 1; suppressing them blinds you to your own ref/flag mistakes (the #1 cause of "(no output)").
Detect cmux in a Shell
Injected env vars in every cmux-spawned terminal: CMUX_WORKSPACE_ID, CMUX_SURFACE_ID, CMUX_SOCKET_PATH, CMUX_PORT. Always anchor automation to `CMUX_WORKSPACE_ID` — the visually focused workspace may not be the agent's caller workspace.
Fast Start — Topology
Polling Pi Agents in Panes — Keep Sleeps Short
When launching a Pi Agent inside a cmux pane and polling for output, use short `sleep` intervals (2–5s). Pi is fast and minimal, and the configured model streams tokens quickly. Do NOT use sleep 15 unless genuinely needed (a big build/refactor) — most of the time sleep 2–sleep 5 is more than enough.
Send Input
Notifications & Sidebar Metadata
Browser Automation (WKWebView)
Workflow: open → wait → snapshot → act → re-snapshot.
Not supported by WKWebView (return not_supported): viewport emulation, geolocation/offline emulation, trace recording, network route interception, raw input injection.
Markdown Viewer
cmux markdown open flags: --workspace, --surface, --window, --direction <right|down|left|up>, --focus <true|false>. There is NO `--pane` flag — passing it errors. To target a pane, pass --surface <existing-md-surface-in-that-pane>.
Reuse the existing right markdown pane (don't spawn strays)
Default behavior of markdown open is to create a new pane every time, even with --direction right. To keep all docs as tabs in ONE right pane, follow this exactly:
Swapping the file in the single right pane (close-FIRST, then open)
To replace the doc shown in your one right markdown pane, the ONLY reliable order is close the previous surface FIRST, then `markdown open` the new file fresh — never move an existing viewer, never open-then-close.
ORDER MATTERS: close-previous BEFORE open-new. Opening first then closing the old one, or move-surface-ing an existing viewer, leaves the right pane BLANK.
Hard-won lessons (avoid the trial-and-error)
- Surface refs are global, not per-workspace. A ref like
surface:126from an earliermarkdown openmay live in a different window/workspace. Always re-list (list-panes/list-pane-surfaces) before reusing a ref — never assume a ref from a previous turn is still in the right pane. - `move-surface`-ing a markdown viewer often leaves it BLANK. The moved surface keeps
type=markdownandsurface-healthlooks fine, but renders nothing. Fix:close-surfaceit andcmux markdown open <path>fresh, then move the fresh surface if needed. Don't waste time onrefresh-surfaces— it usually won't fix a moved-then-blank viewer. - You cannot screenshot or `read-screen` a markdown surface (
Surface is not a terminal/ browser screenshot is WKWebView-only). To verify a markdown viewer rendered, ask the user or open the file in a browser surface instead. Don't burn turns trying to capture it. - `cmux list-surfaces` does not exist. Use
cmux list-pane-surfaces [--pane ...].
Settings & Config
Locations:
- cmux settings:
~/.config/cmux/cmux.json(canonical). Project-local override:.cmux/cmux.jsonor./cmux.json. - Terminal rendering (font, cursor, theme, scrollback, opacity, blur):
~/.config/ghostty/config— NOT cmux.json.
Before editing cmux.json, copy it to a timestamped .bak next to it so the user can revert. Schema: https://raw.githubusercontent.com/manaflow-ai/cmux/main/web/data/cmux.schema.json.
Agent Hooks & Install
Native session-resume supported for: Claude Code, Codex, Grok, OpenCode, Pi, Amp, Cursor CLI, Gemini, Antigravity, Rovo Dev, Hermes, Copilot, CodeBuddy, Factory, Qoder.
Socket API (advanced)
/tmp/cmux.sock — Unix socket, JSON-RPC v2. Use for tight loops where subprocess spawn cost matters; otherwise prefer the CLI.
Method prefixes: system.*, window.*, workspace.*, pane.*, surface.*, notification.*, browser.*. Full list and Python client example in references/socket-api.md.
Access modes: cmuxOnly (default — only cmux-spawned processes), automation (any local process), password, allowAll (unsafe). If you hit Failed to connect to socket, you're likely an external process under cmuxOnly — switch mode in Settings > Automation or run from inside a cmux terminal.
Critical Rules — Non-Disruptive Automation
These rules come from the cmux-workspace skill and prevent agents from yanking the user's focus:
- Anchor to `CMUX_WORKSPACE_ID`. Never assume the visually focused workspace is the target.
- Never call focus-changing verbs speculatively.
select-workspace,focus-pane,focus-panel,focus-surfaceonly on explicit user request. Pass--focus falsewhenever available. - Build layout additively in one call.
cmux new-pane --type … --focus falsebeats create-then-move-then-focus chains. - Right-side helper pane pattern. Reuse an existing non-caller helper pane if present; otherwise create exactly one right-side pane.
- Never send input to surfaces you don't own. Only target surfaces in the caller's workspace unless the user explicitly asks for cross-workspace routing.
- Check surface health before routing input when UI state may be stale:
cmux surface-health.
Common Pitfalls
- Pi/Pi-like socket connection failures from external processes → default
cmuxOnlymode; either run inside a cmux terminal or change socket mode. - macOS only. No Linux/Windows port.
- WKWebView ≠ CDP. Don't expect Playwright-equivalent network mocking or viewport emulation.
- Resume strips sensitive env vars. Re-inject tokens at resume time if the agent needs them.
- Skills snapshot at app start. Edits to skill files require a restart of the consuming agent.
- Legacy v1 socket payloads (`{"command":...}`) rejected. Use v2 JSON-RPC only.
- Don't `cat ~/.cmuxterm/*-hook-sessions.json` expecting secrets — they're scrubbed. Look there for session/surface mappings only.
Reference: Full CLI Help
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcmux/SKILL.md
Popularity
- Repository stars
- 9
- Repository forks
- 2
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/matymatyk-business/cmux-skill/cmux)