Use when starting feature work that needs isolation from current workspace. Creates isolated git worktrees with directory selection, safety verification, and baseline testing.
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously.
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative
If found: Use that directory. If both exist, .worktrees wins.
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
If preference specified: Use it.
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. ~/worktrees/<project-name>/ (global location)
Which would you prefer?
For project-local directories:
git check-ignore -q .worktrees 2>/dev/null
If NOT ignored:
Why: Prevents accidentally committing worktree contents.
project=$(basename "$(git rev-parse --show-toplevel)")
# Create worktree with new branch
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"
# Auto-detect and run
[ -f package.json ] && npm install
[ -f Cargo.toml ] && cargo build
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f go.mod ] && go mod download
npm test # or cargo test / pytest / go test ./...
If tests fail: Report failures, ask whether to proceed. If tests pass: Report ready.
Worktree ready at /path/to/worktree
Tests passing (47 tests, 0 failures)
Ready to implement <feature-name>
.worktrees/ over worktrees/| Situation | Action |
|---|---|
.worktrees/ exists |
Use it (verify ignored) |
worktrees/ exists |
Use it (verify ignored) |
| Both exist | Use .worktrees/ |
| Neither exists | Check CLAUDE.md → Ask user |
| Directory not ignored | Add to .gitignore + commit |
| Baseline tests fail | Report failures + ask |
When work is complete, remove worktree:
# From main repository
git worktree remove <worktree-path>
git branch -d <feature-branch> # if merged
| Skill | Relationship |
|---|---|
design-exploration |
May trigger worktree creation |
implementation-planning |
Plans execute in worktree |
branch-completion |
Handles worktree cleanup |