From git-worktrees
Parallel isolated workspaces via git worktrees. Triggers on "multi-terminal", "parallel work", "worktree", "I need a clean branch without losing my current state", or coordinating multiple Claude Code sessions on the same repo. Merges Brain active-worktrees pattern + Pillarworks .claude/worktrees workflow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-worktrees:git-worktreesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`git worktree` lets one repo have multiple checked-out branches simultaneously, each in its own directory. For parallel Claude Code sessions or coordinating swarming agents per `orchestration/agent-swarming`'s Branch Isolation Rule, worktrees are the right primitive.
git worktree lets one repo have multiple checked-out branches simultaneously, each in its own directory. For parallel Claude Code sessions or coordinating swarming agents per orchestration/agent-swarming's Branch Isolation Rule, worktrees are the right primitive.
orchestration/agent-swarming)orchestration/cpd-protocol) without blocking your primary checkout# From the main checkout (e.g., D:\pillarworks-build-mvp)
cd D:\pillarworks-build-mvp
# Create a worktree on a new branch
git worktree add ../pillarworks-build-mvp-feat-boq-export -b feat/boq-export
# OR on an existing branch
git worktree add ../pillarworks-build-mvp-hotfix-auth hotfix/auth
# List worktrees
git worktree list
# Remove when done (after merge / cleanup)
git worktree remove ../pillarworks-build-mvp-feat-boq-export
<repo-name>-<purpose> or use .claude/worktrees/<random-name>/ (Pillarworks / Brain pattern):
| Repo | Worktree pattern | Reason |
|---|---|---|
D:\pillarworks-build-mvp | D:\pillarworks-build-mvp\.claude\worktrees\<random> | Pillarworks's pattern; keeps worktrees under .claude/ so they're git-ignored by default |
D:\orryx-brain | D:\orryx-brain\.claude\worktrees\<random> | Brain's pattern (2 active at audit time) |
| Triora | Not currently used | Triora hasn't adopted the pattern yet |
The .claude/worktrees/ pattern keeps them adjacent to the main checkout, easy to find, and out of git tracking.
Per orchestration/agent-swarming Branch Isolation Rule: each parallel agent gets its own branch + worktree. Never two agents in the same worktree.
Worktrees accumulate. After merging a branch:
git worktree remove .claude/worktrees/hungry-noyce-dd3451
git branch -d feat/the-branch-that-was-merged
Worktrees holding stale branches eat disk + confuse the next session.
cd .claude/worktrees/feat-boq-export
claude # opens a session with this worktree as cwd
The session is fully isolated — its own .claude/settings.local.json if you want, its own MCP configs.
cd .claude/worktrees/feat-boq-export
git pull origin main # merge main into the feature branch
# OR
git rebase main # rebase the feature branch onto main
git worktree list
# /D/pillarworks-build-mvp abc123 [main]
# /D/pillarworks-build-mvp/.claude/worktrees/hungry-noyce-dd3451 def456 [feat/boq-export]
.gitignore for worktree paths. If you don't use the .claude/worktrees/ convention, ensure your worktree directories are git-ignored to prevent accidental commits across worktrees.git worktree --help — official docsorchestration/agent-swarming — Branch Isolation Rule (the reason worktrees matter)orchestration/cpd-protocol — parallel streams that benefit from worktree isolationD:\pillarworks-build-mvp\.claude\worktrees\hungry-noyce-dd3451D:\orryx-brain\.claude\worktrees\gracious-elbakyan-f84cff and zen-gauss-fae575Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub alexmclaren/orryx-knowledge --plugin git-worktrees