
Cmux Workspace
- 4.2k installs
- 25.6k repo stars
- Updated August 5, 2026
- manaflow-ai/cmux
cmux-workspace is an agent skill that automates cmux workspaces, panes, and surfaces using caller environment anchors while avoiding unsolicited focus changes.
About
cmux-workspace scopes agent automation to the cmux workspace and surface that invoked the agent, treating sidebar workspaces as containers of split panes and terminal or browser surfaces. It reads CMUX_WORKSPACE_ID, CMUX_SURFACE_ID, and CMUX_SOCKET_PATH from the caller environment or cmux identify --json before acting, because the visually focused workspace may differ from the caller. Non-disruptive automation forbids focus-changing verbs like select-workspace, focus-pane, and focus-panel unless explicitly requested, and prefers additive layout with new-pane or new-surface commands using --focus false. A right-side helper pane policy reuses an existing auxiliary pane for previews, logs, and browser checks instead of spawning duplicate splits. Documented commands cover workspace-scoped pane and surface creation, send and send-key to caller surfaces, move-surface reordering, sidebar status and progress logging, and tagged contributor reloads via ./scripts/reload.sh. Known papercuts such as drag-surface-to-split focus routing are reported rather than worked around with focus hacks.
- Anchors automation to caller CMUX_WORKSPACE_ID and CMUX_SURFACE_ID env vars.
- Forbids focus-changing cmux verbs unless the user explicitly requests them.
- Reuses a right-side helper pane for auxiliary terminal and browser output.
- Prefers additive new-pane and new-surface layout over create-then-focus chains.
- Documents sidebar status, progress, and log attachment for the active workspace.
Cmux Workspace by the numbers
- 4,193 all-time installs (skills.sh)
- +338 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #47 of 550 CLI & Terminal skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
cmux-workspace capabilities & compatibility
- Capabilities
- caller workspace and surface identification · non disruptive pane and surface creation · right side helper pane reuse policy · sidebar status progress and log updates
- Use cases
- orchestration
- Platforms
- macOS
- Runs
- Runs locally
What cmux-workspace says it does
Never call focus-changing verbs speculatively.
npx skills add https://github.com/manaflow-ai/cmux --skill cmux-workspaceAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 4.2k |
|---|---|
| repo stars | ★ 25.6k |
| Security audit | 3 / 3 scanners passed |
| Last updated | August 5, 2026 |
| Repository | manaflow-ai/cmux ↗ |
How do I run cmux layout and terminal commands in the workspace that invoked the agent without yanking the user's visible focus?
Automate cmux terminal workspaces, panes, and surfaces using caller CMUX_WORKSPACE_ID context without stealing user focus.
Who is it for?
Developers using cmux who want agents to open helper panes, send commands, and log progress in the caller workspace.
Skip if: Skip when the task targets a different cmux window or workspace the user did not name explicitly.
When should I use this skill?
User asks about cmux workspace, panes, surfaces, socket targeting, or non-interfering terminal automation.
What you get
Workspace-scoped panes, surfaces, commands, and sidebar status updates applied with explicit non-focus defaults.
- Workspace-scoped command execution
- Pane-targeted automation
Files
cmux Workspace
Use this skill when a task should be scoped to the cmux workspace that invoked the agent. A workspace is the sidebar tab-like unit in cmux. It contains split panes, and each pane contains one or more surfaces. A surface is the terminal or browser session the user interacts with.
Default Rule
Scope actions to the current caller workspace unless the user explicitly asks for another workspace, another window, or global state.
Do not assume the visually focused cmux workspace is the right target. An agent can be running in one workspace while the user is looking at another. Prefer the caller environment first:
printf 'workspace=%s\nsurface=%s\nsocket=%s\n' \
"${CMUX_WORKSPACE_ID:-}" \
"${CMUX_SURFACE_ID:-}" \
"${CMUX_SOCKET_PATH:-}"
cmux identify --jsonUse CMUX_WORKSPACE_ID as the default workspace anchor and CMUX_SURFACE_ID as the default caller terminal/surface anchor. If those are missing, use cmux identify --json and be explicit that you are using the currently focused cmux context.
Non-Disruptive Automation
The user may be visually focused on a different workspace, window, or app while an agent works in the caller workspace. Treat layout and focus as separate concerns. Never call focus-changing verbs speculatively.
Never call these without an explicit user ask:
select-workspaceswitches the visible sidebar tab.focus-pane/focus-panelyanks pane or surface focus.tab-actionwith focus-changing actions.
These are user-affecting actions, like clicks. The rule applies even inside the caller's own workspace, since the user may be looking elsewhere.
Build layout additively, in one shot. Prefer commands that create a new pane already populated with the right surface:
# pane and content in one call, no follow-up needed
cmux new-pane --workspace "${CMUX_WORKSPACE_ID}" --type browser --direction right --url "http://127.0.0.1:8765"
cmux new-pane --workspace "${CMUX_WORKSPACE_ID}" --type terminal --direction downAvoid create-then-move-then-focus chains. If a layout command rejects a valid surface: or pane: ref, do not work around it by focusing. Report the bug to the user and stop.
Pass --focus false whenever the verb supports it. move-surface --focus false preserves the user's current attention. Other commands may grow the same flag over time (https://github.com/manaflow-ai/cmux/issues/1418, https://github.com/manaflow-ai/cmux/issues/2820).
Right-Side Helper Pane
When opening auxiliary output for the current task (preview apps, TUIs, logs, one-off shells, browser checks), keep the workspace organized by reusing a helper pane to the right of the caller terminal.
First inspect the caller context and panes:
cmux identify --json
cmux list-panes --workspace "${CMUX_WORKSPACE_ID:-}" --json
cmux list-pane-surfaces --workspace "${CMUX_WORKSPACE_ID:-}" --jsonUse this policy:
- If the caller workspace already has a non-caller helper pane, add a new surface to that pane instead of creating another pane:
cmux new-surface --workspace "${CMUX_WORKSPACE_ID:-}" --pane pane:<helper> --type terminal --focus false- If there is no helper pane, create exactly one right-side pane:
cmux new-pane --workspace "${CMUX_WORKSPACE_ID:-}" --type terminal --direction right --focus false- If there are multiple obvious stale helper panes from this same automation and the user asked to tidy or reuse, keep one right helper pane and clean up the duplicates. Do not close panes you cannot confidently identify as stale helper output.
- Send commands to the new or reused helper surface by explicit surface ref. Do not focus it unless the user asks.
This means repeated "open it" requests should normally create tabs inside the existing right helper pane, not more splits.
Hierarchy
- Window: a macOS cmux window.
- Workspace: a sidebar entry. The UI may call it a tab, but CLI/socket APIs call it a workspace.
- Pane: a split region inside a workspace.
- Surface: a tab inside a pane. Surfaces can be terminals or browser panels.
- Panel: internal content type inside a surface. Prefer CLI surface commands instead of panel internals.
Inspect Current Context
cmux identify --json
cmux current-workspace --json
cmux list-workspaces --json
cmux list-panes --workspace "${CMUX_WORKSPACE_ID:-}" --json
cmux list-pane-surfaces --workspace "${CMUX_WORKSPACE_ID:-}" --json
cmux list-panels --workspace "${CMUX_WORKSPACE_ID:-}" --jsonUse --id-format both when logs or handoffs need stable UUIDs plus human refs:
cmux --json --id-format both identifyWorkspace-Scoped Actions
Prefer explicit workspace flags even when env vars are set. It makes automation auditable and avoids affecting a focused workspace in another window.
# create a new workspace when the user asks for a new task area
cmux new-workspace --name "debug auth" --cwd "$PWD"
# rename / close (only when explicitly requested)
cmux rename-workspace --workspace "${CMUX_WORKSPACE_ID:-}" -- "build fix"
cmux close-workspace --workspace workspace:4
cmux close-surface --workspace "${CMUX_WORKSPACE_ID:-}" --surface surface:3
# additive layout (safe, no focus side effects beyond the command's own defaults)
cmux new-pane --workspace "${CMUX_WORKSPACE_ID:-}" --type terminal --direction right
cmux new-surface --workspace "${CMUX_WORKSPACE_ID:-}" --type terminal
# focus-changing (USER-AFFECTING, only on explicit ask, see Non-Disruptive Automation above)
cmux select-workspace --workspace workspace:2
cmux focus-pane --workspace "${CMUX_WORKSPACE_ID:-}" --pane pane:2
cmux focus-panel --workspace "${CMUX_WORKSPACE_ID:-}" --panel surface:3Caller Terminal
The current terminal is the surface that invoked the agent. Treat it as the safest anchor for relative operations.
# send to the focused terminal in the caller workspace
cmux send "npm test\n"
# send to the exact caller surface
cmux send --surface "${CMUX_SURFACE_ID:-}" "git status\n"
cmux send-key --surface "${CMUX_SURFACE_ID:-}" enterDo not send keystrokes, close surfaces, or change focus in other workspaces unless the user asked for that target.
Moving Surfaces
Reorder a surface within its pane:
cmux move-surface --surface "${CMUX_SURFACE_ID}" --before surface:3
cmux move-surface --surface "${CMUX_SURFACE_ID}" --after surface:3
cmux move-surface --surface "${CMUX_SURFACE_ID}" --index 0Move a surface to another existing pane. Pass --focus false to keep the user's current attention put:
cmux move-surface --surface surface:240 --pane pane:172 --focus falseSplit a surface off into a new pane:
cmux drag-surface-to-split --surface surface:240 downKnown papercut: drag-surface-to-split currently routes through V1 and resolves the workspace via UI focus, so it can fail with ERROR: Surface not found when the caller's workspace is not the visually focused one. Tracked at https://github.com/manaflow-ai/cmux/issues/1901, related to https://github.com/manaflow-ai/cmux/issues/3189. Until that lands, prefer building the layout additively (see Non-Disruptive Automation above) over create-then-split.
Do not call focus-pane or focus-panel to recover from a failed move. Report the failure and stop.
Sidebar State
Status, progress, and logs should usually be attached to the current workspace so the sidebar reflects this task.
cmux set-status build "running" --workspace "${CMUX_WORKSPACE_ID:-}" --color "#ff9500"
cmux set-progress 0.4 --label "Building" --workspace "${CMUX_WORKSPACE_ID:-}"
cmux log --workspace "${CMUX_WORKSPACE_ID:-}" --level info -- "Started build"
cmux sidebar-state --workspace "${CMUX_WORKSPACE_ID:-}" --json
cmux clear-status build --workspace "${CMUX_WORKSPACE_ID:-}"
cmux clear-progress --workspace "${CMUX_WORKSPACE_ID:-}"Contributor Reloads
For cmux app/runtime changes in a cmux source checkout, use tagged reloads from the active worktree. A tagged reload creates an isolated app name, bundle ID, debug socket, and DerivedData path.
./scripts/reload.sh --tag <short-tag>Never build or launch untagged cmux DEV. If tests or tools need a socket, use the tag-specific socket:
CMUX_SOCKET_PATH=/tmp/cmux-debug-<short-tag>.sock cmux identify --jsonSocket and Access
Use the socket path provided by cmux before falling back to defaults:
SOCK="${CMUX_SOCKET_PATH:-/tmp/cmux.sock}"Socket access can be off, restricted to cmux-spawned processes, or allow all local processes. If a command cannot connect, inspect capabilities before changing settings:
cmux capabilities --json
cmux pingReferences
- references/commands.md enumerates workspace, pane, surface, notification, and utility commands.
- ../cmux-browser/SKILL.md covers browser surfaces with the same current-workspace rule.
Rules
- Work in the current caller workspace by default.
- Use
CMUX_WORKSPACE_ID,CMUX_SURFACE_ID, andCMUX_SOCKET_PATHbefore focused-window fallbacks. - Prefer explicit
--workspaceand--surfaceflags for mutating actions. - Never call
focus-pane,focus-panel,select-workspace, or focus-changingtab-actionverbs unless the user explicitly asked. The user may be visually on a different workspace, window, or app. - Pass
--focus falseonmove-surfaceand any creation verb that supports it. - For auxiliary output, reuse the right-side helper pane; create one only if it does not exist.
- Build layout additively with
new-pane --type ... --url ...rather than create-then-move-then-focus chains. - If a CLI command rejects a valid surface or pane ref, report it to the user. Do not work around by focusing.
- Do not close, focus, move, or send input to another workspace unless the user names that target.
- Use short refs for chat and command examples. Use UUIDs only for logs, persistence, or debugging.
- For app/runtime changes in a cmux source checkout, reload with
./scripts/reload.sh --tag <tag>from the worktree before dogfood handoff.
interface:
display_name: "cmux Workspace"
short_description: "Scope cmux automation to the current workspace, caller terminal, panes, and surfaces."
default_prompt: "Use this skill to identify the current cmux caller workspace and surface, then keep workspace, pane, surface, browser, sidebar, and socket actions scoped to that context unless the user explicitly names another target."
cmux Workspace Command Reference
Use these commands from a cmux terminal. Most commands infer the caller workspace from CMUX_WORKSPACE_ID, but explicit flags are safer for automation.
Context
cmux identify --json
cmux current-workspace --json
cmux capabilities --json
cmux pingWindows and Workspaces
cmux list-windows
cmux current-window
cmux new-window
cmux focus-window --window window:2
cmux close-window --window window:2
cmux list-workspaces
cmux list-workspaces --json
cmux new-workspace --name "task" --cwd "$PWD"
cmux new-workspace --command "npm run dev"
cmux new-workspace --layout '{"root":{"type":"terminal"}}'
cmux current-workspace
cmux select-workspace --workspace workspace:2
cmux rename-workspace --workspace workspace:2 -- "new name"
cmux close-workspace --workspace workspace:2
cmux reorder-workspace --workspace workspace:4 --before workspace:2
cmux move-workspace-to-window --workspace workspace:4 --window window:1Panes and Surfaces
cmux list-panes --workspace "$CMUX_WORKSPACE_ID"
cmux list-pane-surfaces --workspace "$CMUX_WORKSPACE_ID" --pane pane:1
cmux list-panels --workspace "$CMUX_WORKSPACE_ID"
cmux tree --workspace "$CMUX_WORKSPACE_ID"
cmux new-split right --workspace "$CMUX_WORKSPACE_ID"
cmux new-split down --workspace "$CMUX_WORKSPACE_ID" --surface "$CMUX_SURFACE_ID"
cmux new-pane --workspace "$CMUX_WORKSPACE_ID" --type terminal --direction right
cmux new-pane --workspace "$CMUX_WORKSPACE_ID" --type browser --url http://localhost:3000
cmux new-surface --workspace "$CMUX_WORKSPACE_ID" --type terminal --pane pane:1
cmux new-surface --workspace "$CMUX_WORKSPACE_ID" --type browser --pane pane:1 --url http://localhost:3000
cmux focus-pane --workspace "$CMUX_WORKSPACE_ID" --pane pane:2
cmux focus-panel --workspace "$CMUX_WORKSPACE_ID" --panel surface:3
cmux close-surface --workspace "$CMUX_WORKSPACE_ID" --surface surface:3
cmux move-surface --surface surface:7 --pane pane:2 --focus true
cmux reorder-surface --surface surface:7 --before surface:3
cmux move-tab-to-new-workspace --surface surface:7 --title "browser"Input
cmux send "echo hello\n"
cmux send-key enter
cmux send --surface "$CMUX_SURFACE_ID" "git status\n"
cmux send-key --surface "$CMUX_SURFACE_ID" enter
cmux read-screen --surface "$CMUX_SURFACE_ID"Sidebar Metadata
cmux set-status build "running" --workspace "$CMUX_WORKSPACE_ID" --icon hammer --color "#ff9500"
cmux clear-status build --workspace "$CMUX_WORKSPACE_ID"
cmux list-status --workspace "$CMUX_WORKSPACE_ID"
cmux set-progress 0.5 --workspace "$CMUX_WORKSPACE_ID" --label "Building"
cmux clear-progress --workspace "$CMUX_WORKSPACE_ID"
cmux log --workspace "$CMUX_WORKSPACE_ID" --level info -- "Build started"
cmux list-log --workspace "$CMUX_WORKSPACE_ID" --limit 20
cmux clear-log --workspace "$CMUX_WORKSPACE_ID"
cmux sidebar-state --workspace "$CMUX_WORKSPACE_ID" --jsonNotifications and Attention
cmux notify --title "Done" --body "Task complete"
cmux list-notifications --json
cmux clear-notifications
cmux trigger-flash --workspace "$CMUX_WORKSPACE_ID" --surface "$CMUX_SURFACE_ID"
cmux surface-health --workspace "$CMUX_WORKSPACE_ID" --jsonConfig and Docs
cmux docs api
cmux docs browser
cmux docs settings
cmux settings path
cmux settings cmux-json
cmux settings shortcuts
cmux reload-configTagged Reloads
./scripts/reload.sh --tag <short-tag>
CMUX_SOCKET_PATH=/tmp/cmux-debug-<short-tag>.sock cmux identify --jsonRelated skills
How it compares
cmux-specific workspace automation guide, not generic shell scripting or SSH multiplexing.
FAQ
Why not use the visually focused cmux workspace?
An agent can run in one workspace while the user views another; caller env vars are the default anchor.
When can focus-pane or select-workspace be used?
Only when the user explicitly asks; otherwise pass --focus false and avoid focus-changing verbs.
Is Cmux Workspace safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.