Manage git worktrees for parallel development. Use when the user wants to work on multiple branches simultaneously, create isolated environments for features/fixes, or clean up completed worktrees.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/worktree-manager.shThis skill provides a unified interface for managing git worktrees, enabling isolated parallel development. Worktrees allow you to have multiple branches checked out simultaneously in separate directories.
Key features:
.env file copying from main repo to new worktrees.worktrees/ directoryAlways use the worktree-manager.sh script rather than raw git worktree commands. The script handles:
.env file copying to new worktrees.worktrees/ directory.gitignore managementAll operations use the unified worktree-manager.sh script:
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh <command> [options]
worktree-manager.sh create <branch-name> [source-branch]
Creates a new worktree in .worktrees/<branch-name>. If the branch exists, it checks it out. If not, creates a new branch from the source (defaults to main/master).
worktree-manager.sh list
Shows all worktrees with their branch, commit, and status (clean/dirty/missing).
worktree-manager.sh switch <branch-name|path>
Provides information for switching to a worktree by branch name or path.
worktree-manager.sh cleanup [--force]
Identifies and removes:
Use --force to skip confirmation prompt.
worktree-manager.sh copy-env [worktree-path|branch-name]
Copies .env* files (excluding .env.example) from the main repo to a worktree. Useful for:
If run inside a worktree without arguments, copies to current location.
Worktrees are stored in .worktrees/ within the repository root. This directory is automatically added to .gitignore.
# Start new feature
worktree-manager.sh create feature-auth
# Work in the new worktree
cd .worktrees/feature-auth
# List all worktrees
worktree-manager.sh list
# When done, clean up
worktree-manager.sh cleanup
If you have existing worktrees created before the automatic env copying feature:
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env feature-branch
Or from within the worktree directory:
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env