Worktree lifecycle manager for parallel GitHub Copilot CLI sessions. Fork of the wonderful cmux for Claude Code
Run multiple Copilot agents in parallel on the same repo — each in its own git worktree with isolated working directory, dependencies, build artifacts, etc.
Because you wanna go fast without losing your goddamn mind.
GitHub Copilot CLI works best when it has full ownership of the working directory. When you want multiple agents working on different tasks simultaneously, you need separate checkouts. Git worktrees are the perfect primitive for this — they share the same .git database but give each agent its own directory tree.
cmux wraps the worktree lifecycle into a single simple command and makes it effortless to manage the complete worktree lifecycle so Copilot can focus on what it does best.
curl -fsSL https://raw.githubusercontent.com/alexneyler/cmux/main/install.sh | sh
cmux new <branch> — Create worktree, run setup hook, launch copilot
cmux start <branch> — Launch copilot in existing worktree
cmux cd [branch] — cd into worktree (no args = repo root)
cmux ls — List worktrees
cmux merge [branch] — Merge worktree branch into main checkout
cmux rm [branch] — Remove worktree (no args = current)
cmux init — Generate .cmux/setup hook using Copilot
cmux update — Update cmux to the latest version
cmux version — Show current version
# Start a new agent on a feature branch
cmux new feature-foo
# In another terminal, start another agent
cmux new feature-bar
# List project worktrees
cmux ls
# Jump directly back into previous Copilot session
cmux start feature-foo
# cd into a worktree folder
cmux cd feature-foo
cmux cd feature-bar
# Merge worktree branch into main checkout
cmux merge feature-foo
# Or squash merge for a single clean commit
cmux merge feature-foo --squash
# Clean up worktree when done
cmux rm feature-fooWhen cmux new creates a worktree, it looks for an executable .cmux/setup script in the new worktree. This runs any project-specific setup — installing dependencies, symlinking secrets, generating code, etc.
Create .cmux/setup for your repo by running cmux init or creating one manually:
#!/bin/bash
REPO_ROOT="$(git rev-parse --git-common-dir | xargs dirname)"
# Symlink secrets that aren't in git
ln -sf "$REPO_ROOT/.env" .env
# Install dependencies
npm ciMake it executable:
chmod +x .cmux/setupSee examples/ for more.
Don't want to write the setup hook yourself? Run cmux init in your repo and Copilot will analyze the project and generate .cmux/setup for you:
cmux init
# → Analyzing repo to generate .cmux/setup...
# → Created .cmux/setup
# → Review it, then commit to your repo.Add .worktrees/ to your project's .gitignore:
.worktrees/
cmux includes built-in tab completion for both bash and zsh. It's automatically registered when you source cmux.sh — no extra setup needed.
cmux <TAB>— complete subcommandscmux start <TAB>— complete existing worktree branch namescmux cd <TAB>— complete existing worktree branch namescmux rm <TAB>— complete worktree branch names +--all
- Worktrees are created under
.worktrees/<branch>/in the repo root - Branch names are sanitized:
feature/foobecomesfeature-foo cmux newis idempotent — if the worktree exists, it justcds therecmux mergewith no args detects the current worktree and merges itcmux rmwith no args detects the current worktree and removes it- Works from anywhere inside the repo or its worktrees
MIT