Manage parallel development with cmux-style git worktrees in one repository. Use this skill whenever the user asks to run multiple agents in parallel, create or resume isolated worktrees, list/switch/merge/remove worktrees, set up `.cmux/setup`, or recover from worktree conflicts. In this environment, always use the `cmx` alias in commands.
Resources
1Install
npx skillscat add psycho-baller/ai-agents-config/cmux-and-worktrees Install via the SkillsCat registry.
SKILL.md
CMX and Worktrees
Run concurrent coding sessions safely by isolating each task in a git worktree.
Non-Negotiable Command Rule
- Use
cmxfor every command in this skill. - Do not substitute
cmuxin normal operation. - If
cmxfails, check alias availability withtype cmxbefore taking any fallback action.
Preflight
- Verify current directory is inside a git repo:
git rev-parse --is-inside-work-tree- Verify
cmxis available:
type cmx- Ensure worktrees are ignored in git:
rg -n '^\.worktrees/$' .gitignore || echo '.worktrees/' >> .gitignore- Inspect active worktrees:
cmx lsCore Commands
- Create new isolated task:
cmx new <branch> - Resume existing task:
cmx start <branch> - Jump to worktree:
cmx cd [branch] - List worktrees:
cmx ls - Merge into primary checkout:
cmx merge [branch] [--squash] - Remove worktree + branch:
cmx rm [branch | --all] [--force] - Generate setup hook:
cmx init [--replace] - Show/set layout config:
cmx config,cmx config set layout <nested|outer-nested|sibling> [--global] - Update tool:
cmx update - Show version:
cmx version
Standard Workflow
- Start feature work:
cmx new feature-auth- Start urgent fix in parallel:
cmx new fix-payments- Merge and clean up bugfix:
cmx merge fix-payments --squash
git commit -m "fix(payments): resolve checkout bug"
cmx rm fix-payments- Resume feature:
cmx start feature-authSetup Hook Workflow
- Generate a project-specific setup hook:
cmx init- If needed, regenerate:
cmx init --replace- Commit
.cmux/setupso future worktrees inherit setup automatically.
Branch and Path Behavior
- Treat
newas "new branch + new worktree". - Treat
startas "reuse existing worktree/session". - Expect worktree paths under
.worktrees/<branch>/in nested layout. - Expect branch sanitization (e.g.,
feature/foobecomesfeature-foopath name).
Safety Rules
- Ask for confirmation before
cmx rm --all. - Ask for confirmation before
cmx rm --force. - Prefer
cmx merge <branch> --squashfor compact history unless user requests full merge commits. - Ensure worktree changes are committed before merging.
- Remove finished worktrees after successful merge to reduce branch/worktree drift.
Troubleshooting
Not in a git repo: move to repo root, then rerun.Worktree not found: runcmx ls, then choose correct branch or create withcmx new <branch>.- Merge blocked by uncommitted changes: commit or stash inside the worktree, then retry.
- Remove blocked by dirty tree: clean state first, or use
cmx rm --forceonly with explicit confirmation.