using-git-worktrees

Create isolated git worktrees with branch setup and test validation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/selrai-company/claude-workshop-kit --skill using-git-worktrees-selrai-company
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/selrai-company/claude-workshop-kit/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/selrai-company/claude-workshop-kit --skill using-git-worktrees-selrai-company

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents accidental repository pollution and costly context switching by creating isolated git worktrees with safety verification and automated setup so developers can work on feature branches concurrently without risking commits or workspace corruption.

Core Features & Use Cases

  • Directory selection priority: prefers .worktrees, falls back to worktrees, respects CLAUDE.md preferences, or prompts the user.
  • Safety verification: ensures project-local worktree directories are git-ignored and will add and commit .gitignore entries if needed to avoid tracking worktree contents.
  • Automated creation and setup: creates a new branch and worktree, auto-runs project setup (npm install, pip/poetry, cargo build, go mod download) and executes project tests to validate a clean baseline.
  • Use cases: start isolated feature development, reproduce bugs in a clean environment, prepare parallel branches for CI or demo, and safely hand off implementation work.

Quick Start

Ask the assistant to create an isolated worktree for branch feature/auth in the project's .worktrees directory, verify the directory is ignored or update .gitignore and commit, run setup commands, and report when tests pass.

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 an isolated git worktree for feature development?

To create an isolated git worktree, the tool sets up a separate workspace, selects a directory like .worktrees, verifies it is git-ignored, creates the branch, runs dependency setup, and validates tests before reporting readiness.

Why does my git worktree directory get tracked in version control?

Git worktree directories get tracked when they are not listed in .gitignore. This tool enforces safety verification, automatically adding and committing .gitignore entries for project-local locations to prevent tracking worktree contents.

What is the best way to run parallel git branches without workspace corruption?

The best way to run parallel branches safely is using isolated git worktrees. This approach provides separate development workspaces, preventing accidental repository pollution and costly context switching between concurrent feature branches.

Can I auto-run dependency setup when creating a new git worktree?

Yes, you can auto-run dependency setup when creating a git worktree. The tool automatically executes project setup commands like npm install, pip/poetry, cargo build, or go mod download after creating the worktree.

How do I verify a clean test baseline before starting work in a new worktree?

To verify a clean test baseline in a new git worktree, the tool automatically executes project tests immediately after creating the worktree and running dependency setup, reporting readiness only when tests pass.

Does directory selection priority matter when setting up git worktrees?

Directory selection priority matters for organizing git worktrees. The tool prefers the .worktrees directory, falls back to worktrees, respects CLAUDE.md preferences, or prompts the user to ensure proper project-local or global placement.