using-git-worktrees

Create and validate isolated Git worktrees for feature work.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/chadananda/xswarm-tdd-claude --skill using-git-worktrees-chadananda
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/chadananda/xswarm-tdd-claude/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/chadananda/xswarm-tdd-claude --skill using-git-worktrees-chadananda

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps engineers start feature work in isolation by creating and managing Git worktrees, preventing changes from bleeding into the main workspace.

Core Features & Use Cases

  • Directory selection: Prefers project-local hidden directories like .worktrees, then worktrees, then respects CLAUDE.md preferences; prompts when ambiguous.
  • Safety verification: Checks gitignore to ensure the worktree is ignored in project-local setups; updates .gitignore if needed; supports global worktree locations.
  • Automatic setup: Automatically creates the worktree branch and prepares the environment for Node.js, Python, Go, or Rust projects based on repository contents.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace.

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 isolated feature branch work?

To create a Git worktree for isolated feature branch work, this skill automates branch creation and directory selection, preferring project-local hidden directories like .worktrees while respecting CLAUDE.md preferences. It prepares the environment so changes do not bleed into the main workspace.

What is the best way to manage Git worktrees without affecting my main workspace?

Managing Git worktrees safely requires isolating feature work in a separate directory. This skill selects a project-local or global location, verifies gitignore rules to prevent tracking, and automatically configures the environment for Node.js, Python, Go, or Rust projects.

Does Git worktree setup work with Node.js, Python, Go, and Rust projects?

Yes, Git worktree setup works with Node.js, Python, Go, and Rust projects. The skill auto-detects repository contents and prepares the environment by running the appropriate setup steps for the detected language, ensuring the isolated worktree is ready for development.

How do I ensure my Git worktree is ignored in .gitignore?

To ensure your Git worktree is ignored, this skill enforces safety verification by checking gitignore rules for project-local setups. If the worktree directory is not ignored, it automatically updates .gitignore to prevent the isolated worktree from being tracked in version control.

Can I specify a global location instead of a project-local Git worktree directory?

Yes, you can use a global location instead of a project-local Git worktree directory. When directory choice is ambiguous, the skill prompts the user, respecting CLAUDE.md preferences and supporting global worktree locations outside the repository to maintain isolation.

When should I not use a project-local Git worktree setup?

You should not use a project-local Git worktree setup if your .gitignore cannot be modified or if the directory structure prevents ignoring the worktree. In these cases, choosing a global worktree location outside the repository provides the necessary isolation without tracking conflicts.