← ClaudeAtlas

git-worktreelisted

Use this skill whenever a task involves running parallel work on a git repository without conflicts — e.g. "fix this bug while I keep working on my feature", "run Claude on two branches at once", "work on this task in isolation", "create a throwaway branch for this experiment", or anything where two agents or sessions might edit the same files. Also trigger when the user asks to use worktrees directly, or when an agent needs its own isolated checkout so it can work without disturbing the main branch. Even if the user just says "do this in parallel" or "don't mess up my current work", consider worktrees.
siva01c/claude-plugins · ★ 16 · Code & Development · score 78
Install: claude install-skill siva01c/claude-plugins
# Git Worktree 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. --- ## When to reach for worktrees - Two or more agents might edit the same files simultaneously - A task should not disturb the current branch's working state - You need a throwaway sandbox that can be discarded cleanly if things go wrong - The user asks to work on multiple features or fixes in parallel - You want to run tests on one branch while editing another --- ## Core commands ### Create a worktree ```bash # 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. ### List all worktrees ```bash git worktree list # /path/to/main abc1234 [main] # /path/to/my-task def5678 [my-task-branch] ``` ### Remove a worktree when done ```bash # Clean remove (fails if the worktree has uncommitted changes) git worktree remov