roberto-mello/lavra/git-worktree
Claude Code and agent skill by roberto-mello/lavra
- community
Checking that the SKILL.md file is still in the repository.
Manage Git worktrees for isolated parallel development. Use when creating, switching, or cleaning up worktrees for parallel bead work.
Install
npx vskill@latest install roberto-mello/lavra/git-worktreeSKILL.md
Git Worktree Manager
This skill provides a unified interface for managing Git worktrees across your development workflow. Whether you're reviewing PRs in isolation or working on features in parallel, this skill handles all the complexity.
What This Skill Does
- Create worktrees from main branch with clear branch names
- List worktrees with current status
- Switch between worktrees for parallel work
- Clean up completed worktrees automatically
- Interactive confirmations at each step
- Automatic .gitignore management for worktree directory
- Automatic .env file copying from main repo to new worktrees
CRITICAL: Always Use the Manager Script
NEVER call `git worktree add` directly. Always use the worktree-manager.sh script.
The script handles critical setup that raw git commands don't:
- Copies
.env,.env.local,.env.test, etc. from main repo - Ensures
.worktreesis in.gitignore - Creates consistent directory structure
When to Use This Skill
Use this skill in these scenarios:
- Code Review (`/workflows:review`): If NOT already on the target branch (PR branch or requested branch), offer worktree for isolated review
- Feature Work (`/workflows:work`): Always ask if user wants parallel worktree or live branch work
- Parallel Development: When working on multiple features simultaneously
- Cleanup: After completing work in a worktree
How to Use
In Claude Code Workflows
The skill is automatically called from /workflows:review and /workflows:work commands:
Manual Usage
You can also invoke the skill directly from bash:
Commands
create <branch-name> [from-branch]
Creates a new worktree with the given branch name.
Options:
branch-name(required): The name for the new branch and worktreefrom-branch(optional): Base branch to create from (defaults tomain)
Example:
What happens:
- Checks if worktree already exists
- Updates the base branch from remote
- Creates new worktree and branch
- Copies all .env files from main repo (.env, .env.local, .env.test, etc.)
- Shows path for cd-ing to the worktree
list or ls
Lists all available worktrees with their branches and current status.
Example:
Output shows:
- Worktree name
- Branch name
- Which is current (marked with checkmark)
- Main repo status
switch <name> or go <name>
Switches to an existing worktree and cd's into it.
Example:
Optional:
- If name not provided, lists available worktrees and prompts for selection
cleanup or clean
Interactively cleans up inactive worktrees with confirmation.
Example:
What happens:
- Lists all inactive worktrees
- Asks for confirmation
- Removes selected worktrees
- Cleans up empty directories
Workflow Examples
Code Review with Worktree
Parallel Feature Development
Key Design Principles
KISS (Keep It Simple, Stupid)
- One manager script handles all worktree operations
- Simple commands with sensible defaults
- Interactive prompts prevent accidental operations
- Clear naming using branch names directly
Opinionated Defaults
- Worktrees always created from main (unless specified)
- Worktrees stored in .worktrees/ directory
- Branch name becomes worktree name
- .gitignore automatically managed
Safety First
- Confirms before creating worktrees
- Confirms before cleanup to prevent accidental removal
- Won't remove current worktree
- Clear error messages for issues
Integration with Workflows
/workflows:review
Instead of always creating a worktree:
/workflows:work
Always offer choice:
Troubleshooting
"Worktree already exists"
If you see this, the script will ask if you want to switch to it instead.
"Cannot remove worktree: it is the current worktree"
Switch out of the worktree first (to main repo), then cleanup:
Lost in a worktree?
See where you are:
.env files missing in worktree?
If a worktree was created without .env files (e.g., via raw git worktree add), copy them:
Navigate back to main:
Technical Details
Directory Structure
How It Works
- Uses
git worktree addfor isolated environments - Each worktree has its own branch
- Changes in one worktree don't affect others
- Share git history with main repo
- Can push from any worktree
Performance
- Worktrees are lightweight (just file system links)
- No repository duplication
- Shared git objects for efficiency
- Much faster than cloning or stashing/switching
Security
- Security scanPassed, 100 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 repositoryCheckingplugins/lavra/skills/git-worktree/SKILL.md
Popularity
- Repository stars
- 38
- Repository forks
- 1
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Apr 2026, 6 months ago.
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/roberto-mello/lavra/git-worktree)