一键导入
cmux-home
// Use when developing cmux-home, explaining its cmux event-driven Rust TUI, or adapting it into a custom cmux launcher for parallel agent workflows across worktrees, multiple checkouts, SSH hosts, VMs, browsers, or review dashboards.
// Use when developing cmux-home, explaining its cmux event-driven Rust TUI, or adapting it into a custom cmux launcher for parallel agent workflows across worktrees, multiple checkouts, SSH hosts, VMs, browsers, or review dashboards.
| name | cmux-home |
| description | Use when developing cmux-home, explaining its cmux event-driven Rust TUI, or adapting it into a custom cmux launcher for parallel agent workflows across worktrees, multiple checkouts, SSH hosts, VMs, browsers, or review dashboards. |
Use this skill when working on cmux-home itself or when helping someone adapt it into their own cmux launcher.
cmux-home is a small composition of cmux primitives:
This follows the Zen of cmux. cmux gives composable primitives. The developer owns the workflow shape.
Keep cmux-home minimal and scriptable.
The Rust TUI lives in src/.
src/main.rs: UI state, rendering, input handling, refresh workers, submit workerssrc/events.rs: event payload helpers and optimistic event patching helperssrc/cmux_client.rs: newline JSON socket clientsrc/config.rs: persisted state and JSON configsrc/commands.rs: command templating and submit payload filessrc/skills.rs: skill discovery for autocompletesrc/model.rs: workspace status and grouping modelDetailed docs:
docs/events.md before changing live update behavior.docs/customization.md before changing agent launch, submit hooks, or rename hooks.cmux-home starts with a full snapshot, then follows events.stream with categories:
["workspace", "sidebar", "notification", "surface", "pane"]
Patch common workspace, notification, and sidebar events directly. Use targeted workspace refreshes for pane and surface events. Use a full refresh for unknown events or events without a workspace id.
Needs input, working, and completed are derived from unread notifications, sidebar metadata, and Codex/Claude JSONL trajectories. Latest assistant messages imply needs input. Latest user messages imply working.
The main extension point is the JSON config:
{
"agents": {
"codex": {
"command": "scripts/start-codex.sh --prompt {prompt} -- {image_args}",
"plan_command": "scripts/start-codex-plan.sh --prompt {prompt} -- {image_args}",
"submit_command": "scripts/submit-codex.sh --payload {payload}"
},
"claude": {
"command": "scripts/start-claude.sh",
"plan_command": "scripts/start-claude-plan.sh",
"submit_command": "scripts/submit-claude.sh --payload {payload}"
}
},
"rename": {
"command": "scripts/name-workspace.sh --workspace-id {workspace_id} --prompt {prompt} --title {title}"
}
}
Use command when a prompt can be passed on process startup. Use submit_command when the app must start first and receive input later. Use rename.command for best-effort workspace naming after creation.
To customize parallelization, make the command script prepare the environment, then exec the agent:
cd into it, exec Codex or Claude.ssh -t, then exec the remote agent.cmux new-pane or cmux new-surface with --workspace "$CMUX_WORKSPACE_ID" before execing the primary agent.From the cmux-home repo root, build and test with the release profile:
cargo test --release
cargo build --release
From a parent checkout that has cmux-home as a submodule:
cargo test --release --manifest-path cmux-home/Cargo.toml
cargo build --release --manifest-path cmux-home/Cargo.toml
When working from cmuxterm-hq, every change must reload $cmux-workspace
before handoff, including docs and skill changes:
CMUX_HOME_FOCUS=false ./scripts/dogfood-cmux-home.sh
Use the current caller workspace from CMUX_WORKSPACE_ID / cmux identify,
reuse the right-side helper pane, preserve focus, and verify the surface with
cmux read-screen, cmux surface-health, and cmux top before reporting that
the TUI is ready.
If the non-focus launch creates an unattached terminal surface, clean it up.
Do not recover by running select-workspace, focus-panel, focus-pane, or
other focus-changing cmux commands. Report the cmux CLI/runtime attachment bug
instead, or use an already-attached cmux-home surface.