/mjmendo-plugins:cmux-agents-isolationfrom mjmendo-plugins
Choose the right isolation strategy when spinning parallel cmux agents — shared filesystem, file ownership, or git worktrees.
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.
| Situation | Strategy |
|---|---|
| Agents write to completely different files | Shared filesystem — no action needed |
| Research / docs only, no code overlap | Shared filesystem — no action needed |
| Agent B imports or extends Agent A's output | Sequence them (A finishes first), or use worktrees |
| Agents write to the same file | Git worktrees — always |
State explicit ownership in each agent's prompt. Agent B describes the API of Agent A's file by spec, not by reading a moving target.
# Agent 1 prompt:
You OWN these files (create freely):
- bots/shared/working_memory.py
- bots/tech-support/memory_server.py
Do NOT touch: bots/shared/vector_memory.py (owned by Agent 2)
# Agent 2 prompt:
You OWN these files:
- bots/shared/vector_memory.py
- bots/tech-support/semantic_memory_server.py
Do NOT write: bots/shared/working_memory.py (written by Agent 1 in parallel)
Its API: [describe classes/methods inline in the prompt]
# Before spinning agents
git worktree add /tmp/agent-1 -b agent-1-branch
git worktree add /tmp/agent-2 -b agent-2-branch
# In each agent's prompt, set working directory:
# "Working directory: /tmp/agent-1"
# After agents finish — merge on main
git checkout main
git merge agent-1-branch
git merge agent-2-branch # resolve conflicts if any
# Clean up
git worktree remove /tmp/agent-1
git worktree remove /tmp/agent-2
git branch -d agent-1-branch agent-2-branch
Use worktrees when agents are likely to touch shared config files (.gitignore, pyproject.toml, etc.) even if their primary outputs don't overlap.
Back to orchestration → /cmux-agents
For writing effective prompts → /cmux-agents-prompts
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/cmux-agents1. Locate current positionSpin up parallel Claude subagents in cmux panes, delegate tasks, monitor, and close when done./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