cmux-workspace
Work inside the current cmux workspace and terminal. Use for cmux workspace, current workspace, caller surface, panes, surfaces, socket targeting, and non-interfering cmux automation.
Security Assessment
About cmux-workspace
cmux Workspace scopes an agent's actions to the cmux workspace that invoked it and to the caller terminal within that workspace. In cmux, a workspace is a sidebar tab-like unit containing split panes, each pane contains one or more surfaces, and a surface is the terminal or browser session the user interacts with. The default rule is to scope actions to the current caller workspace unless the user explicitly asks for another workspace, window, or global state -- and crucially, not to assume the visually focused workspace is the right target, since an agent may run in one workspace while the user looks at another. The caller environment is read from CMUX_WORKSPACE_ID and CMUX_SURFACE_ID, falling back to `cmux identify --json` when those are missing.
A central theme is non-disruptive automation: layout and focus are separate concerns, and focus-changing verbs must never be called speculatively. Commands like select-workspace, focus-pane, focus-panel, and focus-changing tab-action variants are treated as user-affecting actions (like clicks) and are only used on an explicit request, even within the caller's own workspace. The preferred approach is to build layout additively in one shot -- for example `cmux new-pane` that creates a pane already populated with the right surface -- and to pass `--focus false` wherever a verb supports it (such as move-surface) to preserve the user's attention. Auxiliary output for a task (preview apps, TUIs, logs, one-off shells, browser checks) is kept tidy by reusing a single right-side helper pane: inspect existing panes, add a new surface to an existing helper pane when one exists, or create exactly one right-side pane otherwise.
The skill documents the cmux hierarchy (window, workspace, pane, surface, panel) and provides inspection commands such as `cmux identify`, `cmux current-workspace`, `cmux list-workspaces`, `cmux list-panes`, and `cmux list-pane-surfaces`, with `--json` and `--id-format both` for stable UUIDs plus human refs. Workspace-scoped actions prefer explicit workspace flags for auditability and include creating, renaming, and closing workspaces and surfaces, sending input to the caller terminal with `cmux send`, moving and splitting surfaces, and attaching status, progress, and log state to the sidebar. It also notes known papercuts (for example drag-surface-to-split resolving via UI focus) and advises reporting layout-command failures and stopping rather than recovering by forcing focus.
FAQ
Which workspace does the skill act on by default?
It scopes actions to the current caller workspace, read from CMUX_WORKSPACE_ID (and CMUX_SURFACE_ID for the caller terminal), not the visually focused workspace. An agent may run in one workspace while the user looks at another, so the focused workspace is not assumed to be the target.
Why should I avoid focus-changing commands?
Commands like select-workspace, focus-pane, and focus-panel are user-affecting actions, like clicks, and the user may be looking at a different workspace or window. They must only be called on an explicit user request, even inside the caller's own workspace.
How should I open auxiliary output without cluttering the layout?
Reuse a single right-side helper pane: if one already exists, add a new surface to it with `cmux new-surface`; otherwise create exactly one right-side pane. Repeated "open it" requests should create tabs in the existing helper pane rather than more splits.
How do I keep a command from stealing the user's focus?
Build layout additively in one shot, for example with a `cmux new-pane` that is already populated, and pass `--focus false` wherever the verb supports it, such as `move-surface --focus false`. This preserves the user's current attention.
What should I do if a layout command fails?
Report the failure to the user and stop. Do not work around a rejected pane or surface reference by calling focus-pane or focus-panel; for example the drag-surface-to-split papercut resolves via UI focus, so prefer building the layout additively.
Install cmux-workspace
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
manaflow-ai/cmux