git-worktree

Create, list, switch, and remove isolated Git worktrees for parallel development.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/beratcelik1/compound-claude --skill git-worktree-beratcelik1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/beratcelik1/compound-claude/tree/main/skills/git-worktree
Command: npx skills add https://github.com/beratcelik1/compound-claude --skill git-worktree-beratcelik1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create and manage lightweight, isolated repository copies so developers and agents can work or review code in parallel without switching or contaminating the primary working branch.

Core Features & Use Cases

  • Create new worktrees from a branch or specific ref to review PRs or develop features concurrently.
  • List, switch into, and remove worktrees for easy navigation and cleanup during multi-branch workflows.
  • Integrate with agent workflows to provide isolated environments for autonomous tools, and copy sensitive environment files into new worktrees as needed.
  • Use cases include reviewing a contributor's branch without changing your current branch, running multiple feature implementations simultaneously, and giving agents sandboxed copies of the repo to avoid interference.

Quick Start

Create a new worktree named pr-review from origin/feature-branch and copy your .env into .worktrees/pr-review for an isolated PR review.

Frequently Asked Questions about git-worktree

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

FAQPage Schema
How do I review a pull request without switching my current git branch?

You can review pull requests without switching branches by creating an isolated git worktree from the specific ref. This generates a lightweight repository copy, allowing you to inspect contributor code safely without contaminating your primary working branch.

What is a git worktree and when do I need isolated repository copies?

A git worktree is a lightweight linked working tree that provides isolated repository copies. You need worktrees for parallel development, running agents requiring repository isolation, or experimenting with risky changes without affecting the working branch.

How do I create a git worktree and copy environment files for isolated development?

To create a worktree, generate a new linked working tree from a branch or ref into a designated directory. You must manually copy sensitive environment files into the new worktree path to ensure the isolated environment functions correctly.

Can I run multiple ai agents in the same repository without them interfering?

Yes, you can run multiple agents without interference by providing each agent a sandboxed git worktree. This gives autonomous tools isolated repository copies to work safely and independently without affecting the primary branch.

What are the limitations of using git worktrees for parallel development?

Limitations of git worktrees include requiring manual handling of environment files for new copies and needing the .worktrees directory to be ignored. You must also operate inside a Git-enabled repository with worktree support.