Sign in
Explore
Skills · SkillEveryday codingTesting & SecurityGit & pull requestsReviewedWrites files

using-git-worktrees

Create an isolated git worktree for feature work, with directory selection and safety checks before implementation starts.

Kind
Skill
Works with
Claude Code
Source
Claude Code Templates @ 72e5f237f64d
Path
cli-tool/components/skills/development/using-git-worktrees/SKILL.md
Jobs
Git workflow
Topics
Git & pull requests

Credit

Made by
davila7
Original
github.com/davila7/claude-code-templates/blob/72e5f237f64d70a…
License
MIT

Listed by Skill Manifest; not made by us.

InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
Adds
  • .claude/skills/using-git-worktrees/ (the skill folder)
Runs scripts
Yes
  • shell block in the text
Uses the network
Yes
  • downloads npm packages
  • downloads Python packages
Needs secrets
None found
Reads environment variables
  • LOCATION
  • BRANCH_NAME
Reads outside the project
  • ~/.config/superpowers/worktrees/ (SKILL.md)
  • ~/.config/superpowers/worktrees (SKILL.md)
  • ~/.config/superpowers/worktrees/* (SKILL.md)
  • ~/.config/superpowers/worktrees/$project/$BRANCH_NAME (SKILL.md)
  • and 1 more
Source revision
72e5f237f64d
Licence
MIT
Last activity
26 Nov 2026
Source changed after the scan
Yes
  • Last push 26 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

# 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
# Check in priority order
ls -d .worktrees 2>/dev/null     # Preferred (hidden)
ls -d worktrees 2>/dev/null      # Alternative
```

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

### 2. Check CLAUDE.md

```bash
grep -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)
…