| name | cmux |
| description | Use this skill to control the cmux terminal app from Claude Code. Trigger on "cmux", "open browser pane", "split pane", "browser split", "open in browser", "cmux browser", "cmux notify", "cmux split", "์ pane ์ด์ด", "๋ธ๋ผ์ฐ์ ์ด์ด", "์๋ฆผ ๋ณด๋ด", "์ฌ์ด๋๋ฐ", "workspace ๋ง๋ค์ด", "pane ๋ถํ ", "browser automation", "cmux์์", "cmux๋ก", "cmux ์ฌ์ฉํด์". Also trigger when the user wants to open a URL alongside their terminal, send notifications when a task completes, manage terminal panes programmatically, automate browser interactions from the CLI, or set sidebar status/progress for build scripts. Do NOT trigger for general tmux commands โ cmux is a different app. If cmux is not detected (no socket, no CLI), inform the user and skip.
|
| version | 0.2.0 |
cmux โ Terminal Control from Claude Code
cmux is a native macOS terminal app built on Ghostty's rendering engine. It provides vertical tabs, split panes, an embedded browser, notifications, and a socket API โ all controllable from the CLI.
Detection
Before using any cmux command, check that cmux is available. If cmux is not detected, tell the user and stop โ do not fall back to tmux or other tools.
[ -S "${CMUX_SOCKET_PATH:-$HOME/Library/Application Support/cmux/cmux.sock}" ] && echo "cmux available"
command -v cmux &>/dev/null && cmux ping
Environment variables set inside cmux terminals:
| Variable | Description |
|---|
CMUX_WORKSPACE_ID | Current workspace ID |
CMUX_SURFACE_ID | Current surface ID |
CMUX_SOCKET_PATH | Socket path (default: ~/Library/Application Support/cmux/cmux.sock) |
Core Concepts
cmux has a four-level hierarchy:
Window โ Workspace (sidebar tab) โ Pane (split region) โ Surface (tab within pane)
- Workspace: A sidebar entry containing split panes. Created with
โN or cmux new-workspace.
- Pane: A split region. Created with
โD (right) or โโงD (down), or cmux new-split right|down.
- Surface: A tab within a pane. Each surface has a
CMUX_SURFACE_ID. Surfaces hold either a terminal or a browser panel.
Window Management
Windows are OS-level windows containing workspaces. Most agents work within a single window, but multi-window setups are useful for multi-monitor workflows.
cmux list-windows
cmux current-window
cmux new-window
cmux focus-window --window window:2
cmux close-window --window window:2
cmux move-workspace-to-window --workspace workspace:3 --window window:2
Common Workflows
Open a browser alongside the terminal
The most common use case โ open a URL in a split pane next to the current terminal:
cmux browser open-split https://example.com
Save the returned surface ID to interact with the browser later.
Create pane layouts
cmux new-split right
cmux new-split down
cmux new-pane --type browser --direction right --url https://example.com
cmux new-pane --type terminal --direction down
cmux new-surface --type terminal --pane pane:2
cmux new-surface --type browser --pane pane:2 --url https://example.com
cmux close-surface --surface surface:5
cmux list-panes
cmux list-pane-surfaces
cmux list-panels
cmux tree
cmux focus-pane --pane pane:3
cmux focus-panel --panel surface:3
cmux resize-pane --pane pane:2 -R --amount 10
cmux swap-pane --pane pane:2 --target-pane pane:3
cmux break-pane --surface surface:4
cmux join-pane --target-pane pane:2 --surface surface:4
Send input to panes
cmux send "npm run build\n"
cmux send --surface surface:3 "pytest -v\n"
cmux send-panel --panel surface:3 "npm test\n"
cmux send-key enter
cmux send-key --surface surface:3 escape
cmux send-key-panel --panel surface:3 ctrl+c
Read terminal output
Read the visible screen or scrollback buffer of a surface:
cmux read-screen
cmux read-screen --surface surface:3
cmux read-screen --scrollback
cmux read-screen --lines 50 --surface surface:3
cmux pipe-pane --surface surface:3 --command "tee /tmp/build.log"
Notifications
Notify the user when something completes or needs attention:
cmux notify --title "Build Complete" --body "All tests passed"
cmux notify --title "Claude Code" --subtitle "Waiting" --body "Agent needs input"
cmux list-notifications
cmux clear-notifications
Sidebar metadata
Surface build status, progress, and logs in the workspace sidebar:
cmux set-status build "compiling" --icon hammer --color "#ff9500"
cmux clear-status build
cmux set-progress 0.5 --label "Building..."
cmux clear-progress
cmux log -- "Build started"
cmux log --level success -- "All 42 tests passed"
cmux log --level error --source build -- "Compilation failed"
Workspace management
cmux new-workspace
cmux new-workspace --name "Tests" --cwd /tmp --command "npm test"
cmux list-workspaces
cmux select-workspace --workspace <id>
cmux close-workspace --workspace <id>
cmux current-workspace
cmux rename-workspace "New Name"
cmux rename-workspace --workspace workspace:2 "Build"
cmux find-window --content --select "pytest"
SSH connections
Open SSH sessions as dedicated workspaces:
cmux ssh user@host.example.com
cmux ssh user@host --name "Production" --port 2222
cmux ssh user@host --identity ~/.ssh/id_ed25519 --no-focus
cmux ssh user@host -- htop
Markdown viewer
Open a markdown file in a formatted viewer panel with live reload:
cmux markdown README.md
cmux markdown open docs/ARCHITECTURE.md
Synchronization
Use wait-for to coordinate between panes or scripts:
cmux wait-for build-done --timeout 60
cmux wait-for --signal build-done
Browser Automation
cmux embeds a full browser that can be controlled from the CLI. This is useful for checking web UIs, filling forms, running E2E verification, or viewing documentation alongside code.
For the full browser command reference, see references/browser-api.md.
Quick reference
cmux browser surface:2 navigate https://docs.example.com
cmux browser surface:2 back
cmux browser surface:2 reload
cmux browser surface:2 snapshot --interactive --compact
cmux browser surface:2 screenshot --out /tmp/page.png
cmux browser surface:2 get title
cmux browser surface:2 get text "h1"
cmux browser surface:2 click "button[type='submit']"
cmux browser surface:2 fill "#email" --text "user@example.com"
cmux browser surface:2 type "#search" "query"
cmux browser surface:2 press Enter
cmux browser surface:2 wait --load-state complete --timeout-ms 10000
cmux browser surface:2 wait --text "Success"
cmux browser surface:2 wait --selector "#dashboard"
cmux browser surface:2 eval "document.title"
Typical browser workflow
BROWSER_OUT=$(cmux browser open-split https://example.com/login)
SURFACE=$(echo "$BROWSER_OUT" | grep -o 'surface:[0-9]*')
cmux browser $SURFACE wait --load-state complete --timeout-ms 10000
cmux browser $SURFACE fill "#email" --text "user@example.com"
cmux browser $SURFACE fill "#password" --text "secret"
cmux browser $SURFACE click "button[type='submit']" --snapshot-after
cmux browser $SURFACE wait --text "Welcome"
cmux browser $SURFACE get title
Socket API
Every CLI command has a socket equivalent via ~/Library/Application Support/cmux/cmux.sock. Useful for scripts that need direct RPC:
echo '{"id":"1","method":"workspace.list","params":{}}' | nc -U "${CMUX_SOCKET_PATH:-$HOME/Library/Application Support/cmux/cmux.sock}"
For the full socket API reference, see references/socket-api.md.
Claude Code Hook Integration
cmux integrates with Claude Code hooks to send notifications when tasks complete. A hook script can call cmux notify on Stop or PostToolUse events to alert the user.
For hook setup details, see references/hooks-integration.md.
Error Handling
| Problem | Solution |
|---|
cmux: command not found | Create symlink: sudo ln -sf "/Applications/cmux.app/Contents/Resources/bin/cmux" /usr/local/bin/cmux |
| Socket not found | cmux app might not be running, or socket is disabled in Settings |
surface not found | Run cmux list-pane-surfaces to get valid surface IDs |
| Browser command fails | Ensure the target surface is a browser panel, not a terminal |
| Permission denied | Socket mode may be "Off" โ check Settings or set CMUX_SOCKET_MODE=allowAll |