using-git-worktrees

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

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/gtbauke/bj-utils --skill using-git-worktrees-gtbauke
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/gtbauke/bj-utils/tree/main/.agent/skills/using-git-worktrees
Command: npx skills add https://github.com/gtbauke/bj-utils --skill using-git-worktrees-gtbauke

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches simultaneously often requires stashing changes or cloning the repository again, which disrupts your current workspace. This Skill sets up isolated git worktrees so you can develop features in parallel without touching your main 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 Tests: Auto-detects Node.js, Rust, Python, or Go projects, installs dependencies, and runs the test suite to confirm a clean starting point. - Use Case: You are about to implement an approved feature design and need an isolated branch workspace. The Skill creates .worktrees/feature-auth, installs dependencies, runs the tests, and reports a clean baseline before coding begins. ## Quick Start Ask the AI to set up an isolated git worktree for your new feature branch and verify the project tests pass before starting work.

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. The Skill automates this along with directory selection and dependency setup.

Where should git worktrees be stored in a project?▼

Prefer an existing .worktrees or worktrees directory, with .worktrees winning if both exist. Otherwise check CLAUDE.md for a stated preference, then ask the user between a project-local directory and a global location like ~/.config/superpowers/worktrees.

Why must worktree directories be added to .gitignore?▼

Project-local worktree contents would otherwise appear in git status and risk being committed to the repository. The Skill verifies the directory with git check-ignore and commits a .gitignore fix before creating the worktree.

What happens if tests fail in a new worktree?▼

The Skill runs the project's test suite after setup to establish a clean baseline. If tests fail, it reports the failures and asks whether to proceed or investigate rather than continuing silently.

Does git worktree setup work with Python or Rust projects?▼

Yes, the Skill auto-detects project type from marker files. It runs npm install for package.json, cargo build for Cargo.toml, pip or poetry install for Python files, and go mod download for go.mod.