When to Use
Use this skill when:- Starting feature work that needs isolation from your current workspace
- Before executing implementation plans
- Working on multiple features that need to coexist
- Wanting to preserve your current workspace state while experimenting
Always announce at start: “I’m using the using-git-worktrees skill to set up an isolated workspace.”
Core Principle
Systematic directory selection + safety verification = reliable isolation Git worktrees share the same repository while providing separate working directories. This allows concurrent work on different branches without the overhead of cloning.Directory Selection Process
The skill follows a strict priority order to determine where to create worktrees:1
Check for existing directories
First checks if a worktree directory already exists:If found, uses that directory. If both exist,
.worktrees wins.2
Check CLAUDE.md for preferences
If no directory exists, checks for a preference in CLAUDE.md:If a preference is specified, uses it without asking.
3
Ask the user
If no directory exists and no CLAUDE.md preference, presents two options:
.worktrees/- Project-local, hidden directory~/.config/superpowers/worktrees/<project-name>/- Global location
Safety Verification
Project-Local Directories
Before creating a worktree:- Add appropriate line to
.gitignore - Commit the change
- Proceed with worktree creation
Global Directory
For~/.config/superpowers/worktrees, no .gitignore verification is needed - it’s outside the project entirely.
Creation Workflow
1
Detect project name
2
Create worktree
3
Run project setup
Auto-detects and runs appropriate setup commands:
4
Verify clean baseline
Runs tests to ensure the worktree starts clean:If tests fail: Reports failures and asks whether to proceed or investigate.If tests pass: Reports ready.
5
Report location
Quick Reference
Common Pitfalls
Skipping ignore verification
Skipping ignore verification
Problem: Worktree contents get tracked, pollute git statusFix: Always use
git check-ignore before creating project-local worktreeAssuming directory location
Assuming directory location
Problem: Creates inconsistency, violates project conventionsFix: Follow priority: existing > CLAUDE.md > ask
Proceeding with failing tests
Proceeding with failing tests
Problem: Can’t distinguish new bugs from pre-existing issuesFix: Report failures, get explicit permission to proceed
Hardcoding setup commands
Hardcoding setup commands
Problem: Breaks on projects using different toolsFix: Auto-detect from project files (package.json, Cargo.toml, etc.)
Example Workflow
Red Flags
Integration with Other Skills
Called by
- brainstorming (Phase 4) - Required when design is approved
- subagent-driven-development - Required before executing tasks
- executing-plans - Required before executing tasks
Pairs with
- finishing-a-development-branch - Required for cleanup after work complete