using-git-worktrees
Create Isolated Git Workspaces for Parallel Development
Also available from: Cycleaddict,obra,davila7,Doyajin174,Cygnusfear,DYAI2025,CodingCossack
Git worktrees enable simultaneous branch work without context switching. This skill provides systematic directory selection and safety verification for reliable workspace isolation.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "using-git-worktrees". Create worktree for feature/auth branch
Expected outcome:
Worktree ready at /Users/jesse/myproject/.worktrees/auth
Tests passing (47 tests, 0 failures)
Ready to implement auth feature
Using "using-git-worktrees". Set up isolated workspace for code review
Expected outcome:
Found existing .worktrees/ directory (git-ignored)
Created worktree: git worktree add .worktrees/review-pr123 -b review/pr-123
Dependencies installed (npm install)
Baseline verified: 52 tests passing
Security Audit
SafeStatic analyzer flagged 42 patterns but all are false positives. The skill is documentation-only (markdown file) containing bash command examples for teaching git worktrees. No executable code exists - all flagged patterns are code blocks in instructional content. External commands are git/bash examples, filesystem references are documentation paths, and crypto warnings are spurious.
Risk Factors
⚙️ External commands (26)
Quality Score
What You Can Build
Feature Development Isolation
Create isolated workspace for new feature work without disrupting main development branch
Code Review Preparation
Set up clean worktree for reviewing pull requests without affecting current work state
Bug Fix Parallelization
Quickly spin up isolated environment for urgent hotfixes while feature work continues
Try These Prompts
Create a new git worktree for feature branch 'feature/user-auth' using the standard directory selection process
Set up a worktree for 'hotfix/login-bug' in ~/.config/superpowers/worktrees/myproject/ for global access
Create worktree for 'feature/api-v2', verify it is properly ignored, run project setup, and confirm tests pass before I begin implementation
Check if worktree 'feature/payment-integration' already exists in .worktrees/, and if so switch to it instead of creating a new one
Best Practices
- Always verify worktree directory is git-ignored before creation to prevent accidental commits
- Run baseline tests immediately after worktree creation to distinguish new bugs from pre-existing issues
- Follow directory priority: existing directories first, then CLAUDE.md config, then ask user
Avoid
- Creating worktrees without verifying git-ignore status causes repository pollution
- Skipping baseline test verification makes bug attribution impossible
- Hardcoding directory paths violates project conventions and team workflows
Frequently Asked Questions
What is a git worktree and why use it?
How does this skill choose where to create worktrees?
Do worktrees duplicate my repository on disk?
What happens if baseline tests fail in a new worktree?
Can I use worktrees with any git repository?
How do I clean up a worktree when finished?
Developer Details
Author
ZhanlinCuiLicense
MIT
Repository
https://github.com/ZhanlinCui/Ultimate-Agent-Skills-Collection/tree/main/using-git-worktreesRef
main
File structure
📄 SKILL.md