Manages parallel development with git worktrees, creating isolated directories per branch for concurrent subagent tasks, clean test baselines, and hotfixes without context-switching.
Ships in all-skills. 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.
Part of Agent Skills™ by googleadsagent.ai™
Git Worktrees enables parallel development by maintaining multiple checked-out branches simultaneously in separate directories. Instead of stashing changes and switching branches, the agent creates isolated worktrees for each task, providing clean test baselines and eliminating context-switching overhead. Each worktree is a fully independent workspace tied to its own branch.
This skill is essential for subagent-driven development, where multiple agents work on different tasks concurrently. Without worktrees, agents would clobber each other's uncommitted changes. With worktrees, each agent operates in its own directory with its own branch, and the orchestrator merges completed work back into the main line.
Worktrees also provide clean baselines for testing. When you need to verify that tests pass on a clean checkout—without build artifacts, local config, or uncommitted changes—a fresh worktree gives you exactly that. The worktree lifecycle is managed explicitly: create when a task starts, verify when it completes, and prune when it merges.
graph TD
A[Main Repo] --> B["git worktree add ../task-1 -b feature/task-1"]
A --> C["git worktree add ../task-2 -b feature/task-2"]
A --> D["git worktree add ../hotfix -b hotfix/urgent"]
B --> E[Agent 1 works in ../task-1]
C --> F[Agent 2 works in ../task-2]
D --> G[Agent 3 works in ../hotfix]
E --> H[PR + Merge]
F --> H
G --> H
H --> I["git worktree remove ../task-1"]
H --> J["git worktree remove ../task-2"]
H --> K["git worktree remove ../hotfix"]
Each worktree is a real directory on disk with its own checked-out branch. Changes in one worktree do not affect others. The .git metadata is shared, so branch operations (push, fetch, log) work normally from any worktree.
# Create a worktree for a new feature
git worktree add ../feature-auth -b feature/user-auth
cd ../feature-auth
npm install # Dependencies may differ per branch
# List active worktrees
git worktree list
# /home/user/project abc1234 [main]
# /home/user/feature-auth def5678 [feature/user-auth]
# Run tests in a clean worktree
git worktree add ../clean-test --detach HEAD
cd ../clean-test
npm ci && npm test
cd ../project
git worktree remove ../clean-test
# Prune stale worktrees (after branch deletion)
git worktree prune
class WorktreeManager:
def __init__(self, repo_root):
self.repo_root = repo_root
self.worktree_base = Path(repo_root).parent
def create(self, task_name, base_branch="main"):
branch = f"feature/{task_name}"
path = self.worktree_base / task_name
subprocess.run(
["git", "worktree", "add", str(path), "-b", branch, base_branch],
cwd=self.repo_root, check=True
)
return WorktreeContext(path, branch)
def remove(self, task_name):
path = self.worktree_base / task_name
subprocess.run(
["git", "worktree", "remove", str(path)],
cwd=self.repo_root, check=True
)
def list_active(self):
result = subprocess.run(
["git", "worktree", "list", "--porcelain"],
cwd=self.repo_root, capture_output=True, text=True
)
return self.parse_worktree_list(result.stdout)
npm ci or equivalent in each new worktree—node_modules are not sharedgit worktree prune periodically to clean up stale references| Platform | Support | Notes |
|---|---|---|
| Cursor | Full | best-of-n-runner uses worktrees natively |
| VS Code | Full | Multi-root workspace support |
| Windsurf | Full | Shell-based worktree management |
| Claude Code | Full | Direct git access |
| Cline | Full | Terminal git commands |
| aider | Full | Works from any worktree directory |
git-worktrees parallel-development isolated-workspace clean-baseline concurrent-branches subagent-isolation best-of-n branch-management
© 2026 googleadsagent.ai™ | Agent Skills™ | MIT License
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/all-skills:git-worktreesfrom all-skills
npx claudepluginhub itallstartedwithaidea/agent-skills --plugin all-skillsOther plugins' skills for the same job
73 skills in this plugin
/ad-copy-generationThe Ad Copy Generation skill produces high-performance responsive search ad (RSA) copy using AI-driven generation pipelines calibrated against millions of ad performance data points./adversarial-resilienceAdversarial Resilience is the practice of hardening AI agents against deliberate attacks — prompt injection, data exfiltration, sandbox escape, and unauthorized capability escalation./agent-instinct-systemThe Agent Instinct System implements pre-cognitive reflexes — automatic safety checks and validations that fire before every code change, tool call, or output generation.2 plugins ship this exact skill · first indexed Jul 18, 2026