using-git-worktrees

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

1|Updated Dec 11, 2025
One-click install
npx skills add https://github.com/HarmAalbers/claude-requirements-framework --skill using-git-worktrees-harmaalbers
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/HarmAalbers/claude-requirements-framework/tree/main/plugins/requirements-framework/skills/using-git-worktrees
Command: npx skills add https://github.com/HarmAalbers/claude-requirements-framework --skill using-git-worktrees-harmaalbers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on a feature branch often requires stashing or committing in-progress changes, which disrupts your current workspace. This Skill sets up an isolated git worktree so you can develop on a separate branch without touching your main checkout. ## Core Features & Use Cases - Systematic Directory Selection: Follows a priority order of existing .worktrees/ or worktrees/ directories, then CLAUDE.md preferences, then asks the user. - Safety Verification: Confirms project-local worktree directories are gitignored before creation, preventing accidental commits of worktree contents. - Automated Project Setup: Auto-detects Python, Node.js, Rust, or Go projects and runs the appropriate install and build commands, then verifies a clean test baseline. - Use Case: You need to implement a feature on a new branch while keeping your current workspace intact. The Skill creates a worktree at the right location, installs dependencies, runs the test suite, and reports a ready-to-use isolated environment. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the tests pass before I start implementing.

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 followed by your branch name. This creates a new branch and checks it out in a separate directory that shares the same repository, leaving your current workspace untouched.

Where should git worktrees be stored in a project?▼

Prefer an existing .worktrees or worktrees directory in the project, with .worktrees winning if both exist. If neither exists, check CLAUDE.md for a stated preference, otherwise choose between a project-local .worktrees directory or a global ~/worktrees location.

Do git worktree directories need to be in .gitignore?▼

Yes, project-local worktree directories like .worktrees must be gitignored before creation, verified with git check-ignore. If not ignored, add the entry to .gitignore and commit it first to avoid accidentally committing worktree contents.

Why run tests after creating a git worktree?▼

Running the test suite verifies the new worktree starts from a clean baseline before implementation begins. If tests fail, report the failures and ask whether to proceed or investigate rather than building on a broken foundation.

When should I use git worktrees instead of git stash or branch switching?▼

Use worktrees when you need two branches checked out simultaneously, such as implementing a feature while keeping your main workspace intact. Stashing or switching is better for quick, short-lived context changes within a single working directory.