From claude-commands
Backs up all cmux workspaces, surfaces, and their working directories via the socket API, producing a timestamped JSON snapshot for later restoration.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:cmux-backupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Snapshot all cmux workspaces + surfaces + per-workspace CWD/git state to
Snapshot all cmux workspaces + surfaces + per-workspace CWD/git state to
~/.cmux-backups/<timestamp>.json via the cmux Unix socket API.
/cmux-backup
Or manually:
~/.claude/scripts/cmux-backup.sh
| Field | Source |
|---|---|
| workspace id, title, index, selected | workspace.list JSON API |
| workspace current_directory | workspace.list .current_directory |
| workspace cwd (shell-reported) | sidebar_state --tab=<ws_uuid> → cwd= |
| workspace focused_cwd | sidebar_state → focused_cwd= |
| workspace git_branch | sidebar_state → git_branch= |
| workspace PR info | sidebar_state → pr=, pr_label= |
| surface id, title, type, pane_id | surface.list JSON API |
{
"timestamp": "2026-05-18T12:34:56",
"socket": "/Users/.../cmux.sock",
"workspace_count": 26,
"workspaces": [
{
"id": "8DAE7F5B-...",
"title": "worktree_level_choices",
"index": 0,
"selected": false,
"current_directory": "$HOME",
"cwd": "$HOME/projects/worktree_level_choices",
"focused_cwd": "$HOME/projects/worktree_level_choices",
"git_branch": "feat/level-choices",
"pr": "123",
"surfaces": [
{
"id": "07A1ECD6-...",
"title": "worktree_level_choices",
"type": "terminal",
"pane_id": "6FECF31A-..."
}
]
}
]
}
SOCK="$CMUX_SOCKET" # or ~/Library/Application Support/cmux/cmux.sock
# All workspaces
printf '{"method":"workspace.list","params":{}}\n' | nc -U "$SOCK"
# Surfaces per workspace
printf '{"method":"surface.list","params":{"workspace_id":"<uuid>"}}\n' | nc -U "$SOCK"
# CWD + git state per workspace
printf "sidebar_state --tab=<workspace_uuid>\n" | nc -U "$SOCK"
# Find socket for a specific dev build:
cat ~/Library/Application\ Support/cmux/dev-may-18-last-socket-path
lsof -p $(pgrep -f "cmux DEV may-18") | grep -E "\.sock"
# Use CLI with dev build socket:
CMUX_SOCKET_PATH=/tmp/cmux-debug-may-18.sock cmux list-workspaces
CMUX_SOCKET_PATH=/tmp/cmux-debug-may-18.sock cmux tree
~/.claude/scripts/cmux-restore.sh [--backup <file>] [--dry-run] [--list]
workspace.create + surface.send_text cdselect_workspaceselect_workspace — read-only snapshot only.$CMUX_SOCKET env var first; fall back to
~/Library/Application Support/cmux/cmux.sock.~/.cmux-backups/cmux-backup-<timestamp>.json.npx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsSaves current cmux layout tree and Claude session IDs to JSON snapshot for restoration after cmux restart. Useful for persisting sessions and panes across restarts.
Controls cmux tabs, workspaces, and terminal panes via Unix socket. Use for reading terminal output, sending commands to another agent's pane, switching tabs by name, and monitoring coder progress.
Controls cmux macOS terminal multiplexer: manages workspaces/panes/surfaces/panels, sends commands to terminals/browsers, automates browsers, notifications, sidebar metadata. Use on /cmux or cmux requests.