Skip to content

Isolated git worktree setup that picks a directory, verifies ignore safety, and confirms a clean test baseline.

CCM score
67 of 100
skills.sh installs
278
GitHub stars
34.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers worktree creation from directory selection through project setup and baseline test verification before implementation begins
  • Selects the location in priority order: existing .worktrees/ or worktrees/, then a CLAUDE.md preference, then a user prompt
  • Enforces a git check-ignore safety check for project-local directories, adding and committing a .gitignore entry if one is missing
  • Auto-detects setup from package.json, Cargo.toml, requirements.txt, pyproject.toml, and go.mod and runs the matching install or build step
  • Designed for use before executing implementation plans and paired with finishing-a-development-branch for cleanup

Install

$ npx -y skills add davila7/claude-code-templates --skill using-git-worktrees -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

# 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

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)

Details

Repository
github.com/davila7/claude-code-templates
Categories
Git & Releases, Agent Workflow & Planning
First seen
Jun 3, 2026

Questions

What does the using-git-worktrees skill do?

The using-git-worktrees skill creates isolated git worktrees so you can work on feature branches without switching away from your current workspace. It picks a worktree directory by checking existing folders, then CLAUDE.md, then asking you, and verifies the directory is git-ignored before creating anything.

How do I install the using-git-worktrees skill?

Run npx -y skills add davila7/claude-code-templates --skill using-git-worktrees -y in your project. After that, the agent can set up an isolated workspace when you start feature work or begin an implementation plan.

Which skills lead the Git & Releases category where using-git-worktrees sits?

The using-git-worktrees skill is in the Git & Releases category alongside triage, git-guardrails-claude-code, setup-pre-commit, caveman-commit and pr. It stands out by focusing on worktree creation with a baseline test run, auto-detecting setup commands for Node.js, Rust, Python and Go projects.

Does the using-git-worktrees skill need any extra tools or setup?

The skill relies on git itself and on your project's own setup tools, such as npm, cargo, pip or go, depending on which project files are present. It skips dependency installation when no package.json or Cargo.toml is found.

More from davila7/claude-code-templates

All 398

Similar to Using Git Worktrees

More Git & Releases