KS
Killer-Skills

using-git-worktrees — how to use using-git-worktrees how to use using-git-worktrees, using-git-worktrees alternative, using-git-worktrees setup guide, what is using-git-worktrees, using-git-worktrees vs git checkout, using-git-worktrees install, git worktrees tutorial, isolated workspace setup, git branch management

Verified
v1.0.0
GitHub

About this Skill

Perfect for Version Control Agents needing isolated workspace management and simultaneous branch development. using-git-worktrees is a skill that creates isolated Git workspaces, allowing for simultaneous work on multiple branches without switching, using systematic directory selection and safety verification.

Features

Creates isolated Git workspaces for simultaneous branch work
Utilizes systematic directory selection for efficient workspace setup
Performs safety verification to ensure reliable isolation
Follows a priority order for directory selection, including checking existing directories
Enables work on multiple branches without switching between them

# Core Topics

obra obra
[71.9k]
[5546]
Updated: 3/6/2026

Quality Score

Top 5%
89
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add obra/superpowers/using-git-worktrees

Agent Capability Analysis

The using-git-worktrees MCP Server by obra is an open-source Categories.official integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use using-git-worktrees, using-git-worktrees alternative, using-git-worktrees setup guide.

Ideal Agent Persona

Perfect for Version Control Agents needing isolated workspace management and simultaneous branch development.

Core Value

Empowers agents to create isolated git worktrees with systematic directory selection and safety verification, enabling reliable isolation and simultaneous work on multiple branches without switching, utilizing git commands and repository sharing.

Capabilities Granted for using-git-worktrees MCP Server

Initializing isolated workspaces for feature development
Managing multiple branches simultaneously without switching
Verifying safety and directory selection for worktree creation

! Prerequisites & Limits

  • Requires git installation and repository access
  • Limited to git version control system
Project
SKILL.md
5.3 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Using Git Worktrees

Overview

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Core principle: Systematic directory selection + safety verification = reliable isolation.

Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Directory Selection Process

Follow this priority order:

1. Check Existing Directories

bash
1# Check in priority order 2ls -d .worktrees 2>/dev/null # Preferred (hidden) 3ls -d worktrees 2>/dev/null # Alternative

If found: Use that directory. If both exist, .worktrees wins.

2. Check CLAUDE.md

bash
1grep -i "worktree.*director" CLAUDE.md 2>/dev/null

If preference specified: Use it without asking.

3. Ask User

If no directory exists and no CLAUDE.md preference:

No worktree directory found. Where should I create worktrees?

1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global location)

Which would you prefer?

Safety Verification

For Project-Local Directories (.worktrees or worktrees)

MUST verify directory is ignored before creating worktree:

bash
1# Check if directory is ignored (respects local, global, and system gitignore) 2git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored:

Per Jesse's rule "Fix broken things immediately":

  1. Add appropriate line to .gitignore
  2. Commit the change
  3. Proceed with worktree creation

Why critical: Prevents accidentally committing worktree contents to repository.

For Global Directory (~/.config/superpowers/worktrees)

No .gitignore verification needed - outside project entirely.

Creation Steps

1. Detect Project Name

bash
1project=$(basename "$(git rev-parse --show-toplevel)")

2. Create Worktree

bash
1# Determine full path 2case $LOCATION in 3 .worktrees|worktrees) 4 path="$LOCATION/$BRANCH_NAME" 5 ;; 6 ~/.config/superpowers/worktrees/*) 7 path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME" 8 ;; 9esac 10 11# Create worktree with new branch 12git worktree add "$path" -b "$BRANCH_NAME" 13cd "$path"

3. Run Project Setup

Auto-detect and run appropriate setup:

bash
1# Node.js 2if [ -f package.json ]; then npm install; fi 3 4# Rust 5if [ -f Cargo.toml ]; then cargo build; fi 6 7# Python 8if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 9if [ -f pyproject.toml ]; then poetry install; fi 10 11# Go 12if [ -f go.mod ]; then go mod download; fi

4. Verify Clean Baseline

Run tests to ensure worktree starts clean:

bash
1# Examples - use project-appropriate command 2npm test 3cargo test 4pytest 5go test ./...

If tests fail: Report failures, ask whether to proceed or investigate.

If tests pass: Report ready.

5. Report Location

Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>

Quick Reference

SituationAction
.worktrees/ existsUse it (verify ignored)
worktrees/ existsUse it (verify ignored)
Both existUse .worktrees/
Neither existsCheck CLAUDE.md → Ask user
Directory not ignoredAdd to .gitignore + commit
Tests fail during baselineReport failures + ask
No package.json/Cargo.tomlSkip dependency install

Common Mistakes

Skipping ignore verification

  • Problem: Worktree contents get tracked, pollute git status
  • Fix: Always use git check-ignore before creating project-local worktree

Assuming directory location

  • Problem: Creates inconsistency, violates project conventions
  • Fix: Follow priority: existing > CLAUDE.md > ask

Proceeding with failing tests

  • Problem: Can't distinguish new bugs from pre-existing issues
  • Fix: Report failures, get explicit permission to proceed

Hardcoding setup commands

  • Problem: Breaks on projects using different tools
  • Fix: Auto-detect from project files (package.json, etc.)

Example Workflow

You: I'm using the using-git-worktrees skill to set up an isolated workspace.

[Check .worktrees/ - exists]
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
[Run npm install]
[Run npm test - 47 passing]

Worktree ready at /Users/jesse/myproject/.worktrees/auth
Tests passing (47 tests, 0 failures)
Ready to implement auth feature

Red Flags

Never:

  • Create worktree without verifying it's ignored (project-local)
  • Skip baseline test verification
  • Proceed with failing tests without asking
  • Assume directory location when ambiguous
  • Skip CLAUDE.md check

Always:

  • Follow directory priority: existing > CLAUDE.md > ask
  • Verify directory is ignored for project-local
  • Auto-detect and run project setup
  • Verify clean test baseline

Integration

Called by:

  • brainstorming (Phase 4) - REQUIRED when design is approved and implementation follows
  • subagent-driven-development - REQUIRED before executing any tasks
  • executing-plans - REQUIRED before executing any tasks
  • Any skill needing isolated workspace

Pairs with:

  • finishing-a-development-branch - REQUIRED for cleanup after work complete

Related Skills

Looking for an alternative to using-git-worktrees or building a Categories.official AI Agent? Explore these related open-source MCP Servers.

View All

flags

Logo of facebook
facebook

flags is a feature flag management system that enables developers to check flag states, compare channels, and debug feature behavior differences across release channels.

243.6k
0
Design

extract-errors

Logo of facebook
facebook

extract-errors is a skill that assists in extracting and managing error codes in React applications using yarn extract-errors command.

243.6k
0
Design

fix

Logo of facebook
facebook

fix is a technical skill that resolves lint errors, formatting issues, and ensures code quality in declarative, frontend, and UI projects

243.6k
0
Design

flow

Logo of facebook
facebook

Flow is a type checking system for JavaScript, used to validate React code and ensure consistency across applications

243.6k
0
Design