From superpowers
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees under ./.worktrees with safety verification
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers:using-git-worktreesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
Core principle: All worktrees go in ./.worktrees + safety verification = reliable isolation.
Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."
All worktrees are created under ./.worktrees (project root, hidden directory).
MUST verify directory is ignored before creating worktree:
git check-ignore -q .worktrees 2>/dev/null
If NOT ignored:
.worktrees/ to .gitignoreWhy critical: Prevents accidentally committing worktree contents to repository.
git worktree add ".worktrees/$BRANCH_NAME" -b "$BRANCH_NAME"
cd ".worktrees/$BRANCH_NAME"
Auto-detect and run appropriate setup:
# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi
Run tests to ensure worktree starts clean:
# Examples - use project-appropriate command
npm test
cargo test
pytest
go test ./...
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report ready.
Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>
| Situation | Action |
|---|---|
.worktrees/ not ignored | Add to .gitignore + commit |
| Tests fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
git check-ignore before creating worktreeYou: I'm using the using-git-worktrees skill to set up an isolated workspace.
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
[Run npm install]
[Run npm test - 47 passing]
Worktree ready at /Users/jesse/myproject/.worktrees/auth
Tests passing (47 tests, 0 failures)
Ready to implement auth feature
Never:
.worktrees/ is ignoredAlways:
./.worktrees.worktrees/ is in .gitignoreCalled by:
Pairs with:
npx claudepluginhub syi0808/superpowers --plugin superpowersCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.