worktree

Manage git worktrees for parallel development with add, list, remove, prune, move, lock, and unlock commands.

24|6|Updated Dec 19, 2025
One-click install
npx skills add https://github.com/johnlindquist/claude --skill worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/johnlindquist/claude/tree/main/skills/worktree
Command: npx skills add https://github.com/johnlindquist/claude --skill worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, and includes scripts (resource) components.

What problem does it solve?

This Skill eliminates the frustration of context switching between git branches, allowing you to develop features, fix bugs, and review PRs in parallel workspaces.

Core Features & Use Cases

  • Parallel Development: Maintain separate working directories for different branches without stashing or switching contexts.

Quick Start

Create a new worktree for the feature-branch so you can work on it alongside your current branch.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I work on multiple git branches at the same time without switching contexts?

Git worktrees let you create separate working directories for different branches, so you can develop features, fix bugs, and review PRs simultaneously without stashing or checking out. Each worktree maintains its own state independently.

How do I create a new worktree for parallel development?

Use the worktree add command to create a new working directory linked to a specific branch. Specify the branch name and desired path, and the worktree is ready for development alongside your main working directory.

Can I use git worktrees to manage multiple feature branches in parallel?

Yes. Worktrees are designed for parallel feature development, allowing you to maintain separate directories for each branch. You can work on multiple features concurrently, then merge or compare them without context switching.

What happens to a worktree when I'm done with it?

Remove completed worktrees with the worktree remove command. You can also prune stale worktrees that are no longer accessible, keeping your repository clean and freeing up disk space.

How do I protect a worktree from accidental removal during in-flight work?

Lock a worktree to prevent deletion or pruning while you're actively working on it. Use unlock when the task is complete, allowing the worktree to be removed or pruned safely.

Why would I use worktrees instead of just switching branches?

Worktrees eliminate context-switching overhead by maintaining multiple branch states simultaneously. This is faster for parallel work, PR reviews, and comparisons than repeatedly stashing, switching, and popping changes.