itallstartedwithaidea/claude-googleadsagent/git-worktrees
Claude Code and agent skill by itallstartedwithaidea/claude-googleadsagent
- community
Checking that the SKILL.md file is still in the repository.
Git Worktrees enables parallel development by maintaining multiple checked-out branches simultaneously in separate directories.
Install
npx vskill@latest install itallstartedwithaidea/claude-googleadsagent/git-worktreesSKILL.md
The same SKILL.md was published earlier as itallstartedwithaidea/claude-googleadsagent/git-worktrees.
Git Worktrees
Part of Agent Skills™ by googleadsagent.ai™
Description
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.
Use When
- Multiple tasks must be developed in parallel without interference
- Subagents need isolated filesystems for concurrent work
- You need a clean checkout to run tests without local artifacts
- Hotfix work must happen while a feature branch is in progress
- Best-of-N implementations need separate workspaces
- You want to compare behavior across branches side by side
How It Works
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.
Implementation
Best Practices
- Always create worktrees from the main repository, not from another worktree
- Run
npm cior equivalent in each new worktree—node_modulesare not shared - Remove worktrees promptly after merging to avoid disk bloat
- Use
git worktree pruneperiodically to clean up stale references - Name worktree directories descriptively to match their branch purpose
- Never checkout the same branch in two worktrees simultaneously
Platform Compatibility
| 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 |
Related Skills
- Subagent-Driven Development - Parallel task dispatch that relies on worktrees for filesystem isolation between agents
- Executing Plans - Plan execution with rollback that uses worktrees for clean verification baselines
- Code Review - Pre-merge quality gate applied to each worktree branch before merging
Keywords
git-worktrees parallel-development isolated-workspace clean-baseline concurrent-branches subagent-isolation best-of-n branch-management
© 2026 googleadsagent.ai™ | Agent Skills™ | MIT License
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/git-worktrees/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/itallstartedwithaidea/claude-googleadsagent/git-worktrees)