using-git-worktrees

Create isolated git worktrees with gitignore safety checks.

2|1|Updated Dec 9, 2025
One-click install
npx skills add https://github.com/ninjasitm/ai-assisted-dev-toolkit --skill using-git-worktrees-ninjasitm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/ninjasitm/ai-assisted-dev-toolkit/tree/main/src/monorepo/.agents/skills/using-git-worktrees
Command: npx skills add https://github.com/ninjasitm/ai-assisted-dev-toolkit --skill using-git-worktrees-ninjasitm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating and managing feature work in isolation without disrupting the main workspace, enabling parallel work streams and safer experimentation.

Core Features & Use Cases

  • Directory priority: automatically selects existing local worktree directories, or prompts for a location if none exist.
  • Safety verification: checks that the chosen worktree location is ignored by git before creation to prevent accidental commits to the main repo.
  • Flexible placement: supports local project-local directories and a global location for worktrees.
  • Guided workflow: uses CLAUDE.md preferences when present to minimize prompts.
  • Use case: spin up a dedicated worktree for a feature branch, complete work offline, and merge when ready.

Quick Start

Ask me to initialize an isolated git worktree for your feature branch and I will automatically select the best directory, verify ignore rules, and create a clean worktree ready for development.

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 work?

To create an isolated git worktree, the tool automatically selects an existing local directory or prompts for a location, verifies gitignore safety rules, and sets up a clean worktree ready for development.

What is a git worktree and when do I need one?

A git worktree is an isolated directory linked to your repository that lets you work on independent branches simultaneously, solving the problem of disrupting your main workspace during feature development or experimentation.

How do I prevent accidental commits when using git worktrees?

To prevent accidental commits with git worktrees, the tool performs a safety verification by checking that the chosen worktree location is properly ignored by git before creation.

Does git worktree creation work with CLAUDE.md preferences?

Yes, git worktree creation uses CLAUDE.md preferences when present to guide directory selection and minimize prompts, supporting both project-local directories and a global location for flexible placement.

What is the best way to manage parallel feature branches without affecting the main workspace?

The best way to manage parallel feature branches is using isolated git worktrees, which enable independent work streams and safer experimentation by keeping feature work in separate directories.