using-git-worktrees

Create isolated git worktrees for feature branches within a repository.

27|9|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/datasciencemonkey/claude-code-cli-bricks --skill using-git-worktrees-datasciencemonkey
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/datasciencemonkey/claude-code-cli-bricks/tree/main/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/datasciencemonkey/claude-code-cli-bricks --skill using-git-worktrees-datasciencemonkey

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams isolate feature work by creating git worktrees so ongoing experiments do not disrupt the main workspace or current branch.

Core Features & Use Cases

  • Create isolated worktrees for feature branches to enable parallel development without switching branches.
  • Apply project-local or global worktree locations as needed, with a priority-based discovery process.
  • Use CLAUDE.md preferences to auto-select a storage location or prompt the user for a decision when ambiguity exists.
  • Safely verify ignored status to prevent accidental commits into the main repository.

Quick Start

You can begin by telling the assistant to set up an isolated workspace using git worktrees. Then follow these steps:

  1. Check for existing directories in priority: .worktrees, then worktrees. If both exist, prefer .worktrees.
  2. If a CLAUDE.md preference exists, use it to decide the location; otherwise ask the user to choose between:
    • .worktrees/ (project-local, hidden)
    • ~/.config/superpowers/worktrees/<project-name>/ (global location)
  3. Verify the selected directory is ignored by git to prevent accidental commits (git check-ignore -q <dir>).
  4. Create the new worktree: git worktree add "<path>" -b "<BRANCH_NAME>"; cd "<path>"
  5. Run project setup if applicable (e.g., npm install, pip install) and ensure a clean baseline.
  6. Report the result, e.g., "Worktree ready at <path>"

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I isolate feature branch work without disrupting my main git workspace?

To isolate feature branch work, you can create a git worktree. This allows parallel exploration of branches within a single repository without switching branches or disrupting the primary workspace.

What's the best way to set up an isolated workspace for parallel development using git worktrees?

The best way to set up an isolated workspace is to automate git worktree creation by checking for existing project-local or global directories, verifying gitignore status, and executing the git worktree add command with your desired branch name.

How do I prevent accidental commits of worktree directories into the main repository?

To prevent accidental commits, you must verify the selected worktree directory is ignored by git. The skill automatically runs a git check-ignore command to ensure the directory is safely ignored before proceeding.

Does git worktree creation work with global storage locations instead of project-local directories?

Yes, git worktree creation supports global storage locations. The skill detects your project name and can place worktrees in a global ~/.config directory, or locally in a hidden .worktrees directory based on priority or user preference.

How does the system decide where to place a new worktree if multiple directories exist?

The system decides worktree placement by checking for existing directories in priority order, preferring .worktrees over worktrees. If a CLAUDE.md preference exists, it uses that configuration, otherwise it prompts the user to choose a location.