using-git-worktrees

Creates isolated git worktrees with directory selection, ignore verification, and baseline test validation.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills --skill using-git-worktrees-lgj-jonathan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills/tree/main/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills --skill using-git-worktrees-lgj-jonathan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches simultaneously forces constant stashing, context switching, and risks polluting the main workspace. This Skill sets up isolated git worktrees so feature work happens in a separate directory without disturbing the current checkout. ## Core Features & Use Cases - Smart Directory Selection: Follows a priority order of existing .worktrees or worktrees directories, CLAUDE.md preferences, then user prompt to pick a consistent location. - Safety Verification: Checks with git check-ignore that project-local worktree directories are ignored, and fixes the .gitignore before creating anything. - Automated Setup and Baseline: Auto-detects project type (Node.js, Rust, Python, Go), installs dependencies, and runs tests to confirm a clean baseline before work begins. - Use Case: Before implementing an approved feature plan, create a worktree at .worktrees/auth on a new feature/auth branch, run npm install and npm test, and start coding with 47 passing tests as a verified clean baseline. ## Quick Start Set up an isolated git worktree for the new authentication feature and verify the test baseline is clean.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I create a git worktree for a new feature branch?

Run git worktree add with a target path and the -b flag to create a new branch, for example git worktree add .worktrees/auth -b feature/auth. Then change into that directory and install project dependencies before starting work.

Where should git worktrees be stored in a project?

Prefer an existing .worktrees directory, then worktrees, then any preference documented in CLAUDE.md. If none exist, choose between a project-local .worktrees directory or a global location like ~/.config/superpowers/worktrees/<project-name>.

Why must worktree directories be added to .gitignore?

Project-local worktree contents would otherwise appear as untracked files and could be accidentally committed to the repository. Verify with git check-ignore before creating the worktree, and commit the .gitignore fix first if it is missing.

Should I run tests after creating a git worktree?

Yes, run the project's test suite to confirm a clean baseline before implementing changes. If tests fail, report the failures and get explicit confirmation before proceeding, so new bugs are not confused with pre-existing issues.

When should I use git worktrees instead of switching branches?

Use worktrees when you need multiple branches checked out simultaneously, such as implementing a feature while keeping your main workspace intact. Branch switching is simpler when only one line of work is active at a time.