One-click install
npx skills add https://github.com/barkleesanders/claude-code-starter --skill git-worktree-barkleesanders
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/barkleesanders/claude-code-starter/tree/main/skills/git-worktree
Command: npx skills add https://github.com/barkleesanders/claude-code-starter --skill git-worktree-barkleesanders

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing multiple Git branches for parallel feature development or code reviews often leads to messy working directories, conflicting changes, and lost context when switching between tasks, wasting developer time and increasing error risk.

Core Features & Use Cases

  • Isolated Worktree Management: Create, list, switch, and clean up Git worktrees to keep separate branch work completely isolated from your main development environment.
  • Automatic Environment Setup: Copies local .env files to new worktrees automatically, so you don't have to reconfigure environment variables for each isolated workspace.
  • Safety Guardrails: Includes confirmation prompts for destructive actions like worktree creation and cleanup, and prevents accidental deletion of your currently active worktree.
  • Use Case: If you need to review a teammate's pull request without interrupting your ongoing feature work, you can spin up an isolated worktree for the PR branch in seconds with all your local environment settings already applied.

Quick Start

Use the /carmack command to create an isolated Git worktree for your parallel branch or pull request review task.

Frequently Asked Questions about git-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Git worktrees for parallel development without losing my current changes?

Git worktrees create isolated working directories for separate branches, allowing parallel development without disruptive context switching or losing uncommitted changes in your main environment. You can spin up an isolated workspace in seconds while preserving your main context.

What is the best way to review a teammate's pull request without interrupting my feature work?

Creating an isolated Git worktree for the PR branch allows non-disruptive code review workflows. You can review the pull request in a separate directory while your ongoing feature work remains completely untouched in your main environment.

Do I need to reconfigure environment variables when creating a new Git worktree?

No, new Git worktrees automatically copy local .env files during creation, ensuring consistent development contexts. You do not need to manually reconfigure environment variables for each isolated parallel branch workspace.

How do I safely clean up Git worktrees without deleting active branches?

Safety guardrails enforce confirmation prompts before destructive cleanup actions and actively prevent accidental deletion of your currently active Git worktree, protecting against losing conflicting branch changes during parallel development cleanup.

Can Git worktree management enforce a standard storage path for parallel branches?

Yes, Git worktree management enforces opinionated default storage paths for all created worktrees. This standardizes branch management by keeping isolated working directories organized in predictable locations across your development project.

What are the limitations of using Git worktrees for branch management?

Git worktrees require safety confirmations for creation and cleanup, and the enforced default storage paths may not suit custom directory structures. You also cannot delete your currently active worktree, which limits rapid workspace teardown.