
Using Git Worktrees
- 48 installs
- 8 repo stars
- Updated August 4, 2026
- bbeierle12/skill-mcp-claude
using-git-worktrees is a Claude skill that creates isolated git worktrees for feature work with directory selection and safety checks.
About
This skill creates isolated git worktrees so feature work stays separate from a clean main branch. A developer uses it when starting new feature or bugfix work, and it handles directory selection, .gitignore verification, dependency install, initial test runs, and worktree cleanup after merge.
- Creates isolated git worktrees for feature work
- Smart directory selection with .gitignore safety checks
- Installs dependencies and runs initial tests per worktree
Using Git Worktrees by the numbers
- 48 all-time installs (skills.sh)
- Ranked #307 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
using-git-worktrees capabilities & compatibility
- Works with
- github
- Use cases
- devops
- Pricing
- Free
What using-git-worktrees says it does
Use when starting new feature work to create isolated git worktrees with smart directory selection and safety verification.
Isolate feature work. Keep main clean.
git worktree add ".worktrees/$BRANCH_NAME" -b "$BRANCH_NAME"
npx skills add https://github.com/bbeierle12/skill-mcp-claude --skill using-git-worktreesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 48 |
|---|---|
| repo stars | ★ 8 |
| Last updated | August 4, 2026 |
| Repository | bbeierle12/skill-mcp-claude ↗ |
What it does
Create and manage isolated git worktrees for feature work while keeping the main branch clean.
Who is it for?
Isolating feature or bugfix work in a separate worktree without stashing.
Skip if: Non-git projects or single-branch quick edits.
When should I use this skill?
Starting new feature work that needs isolation from the current workspace.
What you get
An isolated worktree with dependencies installed and tests run, main branch left clean.
- isolated git worktree ready for feature work
By the numbers
- 5-item completion checklist
- priority directory order: .worktrees then worktrees
Files
Using Git Worktrees
Core Principle
Isolate feature work. Keep main clean.
Git worktrees let you work on multiple branches simultaneously in separate directories.
When to Use
- Starting a new feature
- Working on a bugfix while main development continues
- Need to context-switch without stashing
- Want clean separation between work streams
Setup Process
Step 1: Check for Existing Worktree Directory
# Check in priority order
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # AlternativeIf found: Use that directory. If both exist: .worktrees wins.
Step 2: Check CLAUDE.md for Preferences
grep -i "worktree.*director" CLAUDE.md 2>/dev/nullIf preference specified: Use it without asking.
Step 3: If No Directory Exists
Ask the user:
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. worktrees/ (project-local, visible)
3. ~/.config/superpowers/worktrees/<project-name>/ (global location)
Which would you prefer?Step 4: Verify .gitignore
# Check if directory pattern in .gitignore
grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignoreIf not present, add it:
echo ".worktrees/" >> .gitignore
# or
echo "worktrees/" >> .gitignoreCreating a Worktree
Standard Creation
# Determine branch name from feature
BRANCH_NAME="feature/descriptive-name"
# Create worktree with new branch
git worktree add ".worktrees/$BRANCH_NAME" -b "$BRANCH_NAME"
# Navigate to worktree
cd ".worktrees/$BRANCH_NAME"From Existing Branch
git worktree add ".worktrees/$BRANCH_NAME" "$BRANCH_NAME"Post-Creation Setup
Install Dependencies
# 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; fiRun Initial Tests
# Run test suite
npm test # or appropriate command
# Report statusIf tests fail: Report failures, ask whether to proceed or investigate. If tests pass: Report ready.
Worktree Management
List Worktrees
git worktree listRemove Worktree
# After merging feature branch
git worktree remove ".worktrees/feature/branch-name"
# Force remove (if needed)
git worktree remove --force ".worktrees/feature/branch-name"Prune Stale Worktrees
git worktree pruneBest Practices
Naming Convention
feature/descriptive-namefor featuresbugfix/issue-number-descriptionfor bugshotfix/critical-issuefor urgent fixes
Keep Worktrees Focused
- One feature per worktree
- Merge and remove when done
- Don't let worktrees accumulate
Sync Regularly
# In worktree, get latest from main
git fetch origin
git rebase origin/mainCompletion Checklist
When feature is complete: 1. [ ] All tests pass 2. [ ] Code reviewed 3. [ ] Merged to main 4. [ ] Worktree removed 5. [ ] Branch deleted (if desired)
# Full cleanup
git checkout main
git pull
git worktree remove ".worktrees/feature/name"
git branch -d feature/nameAnnouncement Template
At start of worktree creation:
"I'm using the using-git-worktrees skill to set up an isolated workspace for [feature name]."On completion:
"Worktree ready at [full-path]
Tests passing ([N] tests, 0 failures)
Ready to implement [feature-name]"{
"name": "using-git-worktrees",
"description": "Use when starting new feature work to create isolated git worktrees with smart directory selection and safety verification. Keeps main branch clean while developing.",
"tags": [
"process",
"workflow"
],
"sub_skills": [],
"source": "claude-user",
"type": "discipline",
"depends_on": [],
"enhances": [
"subagent-driven-development",
"writing-plans"
],
"last_reviewed_at": null,
"review_score": null,
"relevance_tier": null
}
Related skills
FAQ
What directory does it prefer?
It prefers .worktrees (hidden), then worktrees; if both exist .worktrees wins.
Does it verify .gitignore?
Yes, it checks the worktree directory is in .gitignore and adds it if missing.