/git-tools:git-worktreefrom git-tools
Creates isolated git worktrees for parallel tasks, allowing multiple branches to be checked out simultaneously without conflicts. Useful when running Claude on two branches at once or working on a task without disturbing the main branch.
Ships in git-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Git worktrees let you check out multiple branches of the same repository into
separate directories simultaneously. Each directory is a fully independent
working tree — its own HEAD, index, and files — but all share the same .git
history and objects, so they stay lightweight.
Use this skill to give each agent or parallel task its own isolated workspace.
# New branch from current HEAD
git worktree add ../my-task -b my-task-branch
# From a specific commit or existing branch
git worktree add ../hotfix -b hotfix origin/main
# Detached HEAD (no branch)
git worktree add --detach ../scratch HEAD
# Empty worktree on an unborn branch (blank slate)
git worktree add --orphan ../experiment -b experiment
The new directory is ready to use immediately. cd into it and work normally.
git worktree list
# /path/to/main abc1234 [main]
# /path/to/my-task def5678 [my-task-branch]
# Clean remove (fails if the worktree has uncommitted changes)
git worktree remove ../my-task
# Force remove (discard dirty worktree)
git worktree remove --force ../my-task
# If you deleted the directory manually, clean up the metadata
git worktree prune
git worktree move ../my-task ../new-location
git worktree lock ../my-task --reason "on external drive"
git worktree unlock ../my-task
# Run inside the moved worktree
git worktree repair
# Or from main, pointing at each moved worktree
git worktree repair ../new-location-1 ../new-location-2
Place worktrees as siblings of the main repo directory so paths stay
predictable and .gitignore patterns do not need updating:
projects/
my-app/ ← main repo (agents work here by default)
my-app-task-a/ ← worktree for task A
my-app-task-b/ ← worktree for task B
Create them from the main repo root:
git worktree add ../my-app-task-a -b task-a
git worktree add ../my-app-task-b -b task-b
# Step 1 — set up
git worktree add ../my-app-fix-login -b fix-login
# Step 2 — work
cd ../my-app-fix-login
# ... make changes ...
# Step 3 — commit
git add -A && git commit -m "fix: resolve login redirect loop"
# Step 4 — back in main repo, merge
cd ../my-app
git merge fix-login
# Step 5 — clean up
git worktree remove ../my-app-fix-login
git branch -d fix-login
git worktree move cannot move a
worktree that contains submodules; handle those manually.git worktree remove --force discards it entirely with no impact on other branches.git worktree prune in the main repo to remove orphaned administrative
files.| Symptom | Fix |
|---|---|
fatal: '<branch>' is already checked out | Use a different branch name, or check git worktree list |
Worktree directory deleted but git worktree list still shows it | Run git worktree prune |
| Moved worktree can no longer find the repo | Run git worktree repair inside the moved directory |
| Locked worktree blocks removal | git worktree unlock <path> then remove |
| Changes in worktree not visible in main | Changes are per-worktree until committed and merged |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub siva01c/claude-plugins --plugin git-toolsOther plugins' skills for the same job