/mjmendo-plugins:cmux-agentsfrom mjmendo-plugins
Spin up parallel Claude subagents in cmux panes, delegate tasks, monitor, and close when done.
Ships in mjmendo-plugins. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
All cmux commands need --socket /tmp/cmux.sock and dangerouslyDisableSandbox: true.
cmux --socket /tmp/cmux.sock identify # note workspace:N
cmux --socket /tmp/cmux.sock new-pane right --workspace workspace:N
# → OK surface:X pane:Y workspace:N
Save surface:X — that's the ref for all send/read/close commands. Open all panes before starting Claude in any of them.
cmux --socket /tmp/cmux.sock send --surface surface:X "claude"
cmux --socket /tmp/cmux.sock send-key --surface surface:X "Return"
sleep 6
cmux --socket /tmp/cmux.sock read-screen --surface surface:X --lines 4
Confirm ❯ prompt before sending tasks. Never put \n in send strings — always use a separate send-key Return.
cat > /tmp/agent1.txt << 'END'
Task description here. No escaping needed.
END
Always use temp files — inline strings break on backticks, $, and special chars.
cmux --socket /tmp/cmux.sock send --surface surface:X "$(cat /tmp/agent1.txt)"
cmux --socket /tmp/cmux.sock send-key --surface surface:X "Return"
Send all agents before polling — they run in parallel.
cmux --socket /tmp/cmux.sock read-screen --surface surface:X --lines 12
Poll early, then regularly: Agents often hit permission prompts within the first 15–30 seconds of running (e.g., reading from /tmp/, shell command warnings). Poll at ~15s after sending the prompt, then again at 30s if needed, before settling into 60–120s intervals. Missing early prompts stalls all agents simultaneously.
Poll every 60–120s after the initial burst. Agents pause on file-write permission prompts:
Do you want to create file.py?
❯ 1. Yes
2. Yes, allow all edits during this session
Unblock with send "2" — not send-key "2" (send-key fails on menu selections):
cmux --socket /tmp/cmux.sock send --surface surface:X "2"
Done when screen shows Worked for Xm Xs or idle ❯ with no spinner.
ls path/to/expected/output/
cmux --socket /tmp/cmux.sock close-surface --surface surface:X
For agent isolation decisions → /cmux-agents-isolation
For writing effective subagent prompts → /cmux-agents-prompts
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/cmux-agents-isolationDecision tableChoose the right isolation strategy when spinning parallel cmux agents — shared filesystem, file ownership, or git worktrees./cmux-agents-promptsFive required elementsWrite effective standalone prompts for cmux subagents. Subagents have no memory of the current conversation — every prompt must be a self-contained spec./cmux-claude-resumeRe-attach Claude Code sessions to restored cmux panes after a reboot. Records cwd → session_id on Claude start and replays `claude --resume <id>` into each restored pane.npx claudepluginhub mjmendo/claude-plugins --plugin mjmendo-pluginsOther plugins' skills for the same job