worktree

Create and manage Git worktrees with deterministic paths and base-branch detection.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/JGcode3675/gcs-os --skill worktree-jgcode3675
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/JGcode3675/gcs-os/tree/main/home/james/claude-config/skills/worktree
Command: npx skills add https://github.com/JGcode3675/gcs-os --skill worktree-jgcode3675

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Parallel development often requires creating multiple working trees or stashing changes, which can be error-prone and time-consuming. Git worktrees let you run multiple branches simultaneously in separate directories, simplifying context switching and cleanup.

Core Features & Use Cases

  • Deterministic worktree paths under ../worktrees using a repo-name-branch-name convention to avoid conflicts.
  • Automatic base-branch detection when the base is not provided, using remote HEAD and common defaults.
  • Simple verification and navigation with git worktree list and cd into the new worktree.

Quick Start

Create a new worktree for a specified branch using the default base-branch detection when not provided.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I use git worktree to work on multiple branches at the same time?

Git worktree enables parallel development by creating separate working directories for different branches simultaneously. This allows you to run multiple branches concurrently, simplifying context switching without needing to stash changes or clone the repository again.

What is the best way to organize git worktree directories to avoid path conflicts?

The best way to avoid path conflicts is using a deterministic directory convention. This skill automatically calculates worktree paths under a ../worktrees directory using a repo-name-branch-name convention, ensuring safe branch management and preventing directory overlaps.

How do I automatically detect the base branch when creating a new git worktree?

You can automatically detect the base branch when it is not explicitly provided. The skill performs remote HEAD detection and checks common default branches, applying automatic base-branch detection to establish the correct foundation for your new worktree.

Can I create a temporary git worktree without affecting my main repository state?

Yes, you can create temporary git worktrees safely. The skill includes repository state checks and safe handling for temporary worktrees, ensuring your main repository state is protected while you perform parallel development tasks in isolated directories.

Why does parallel development with multiple branches require stashing changes?

Parallel development often requires stashing changes because switching branches in a single directory forces you to save or discard current work. Git worktree solves this by allowing you to run separate branches in isolated directories, eliminating the need to stash.