using-git-worktrees

Create isolated git worktrees with directory priority and safety checks.

3|1|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/I-Onlabs/claude-code-skills --skill using-git-worktrees-i-onlabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/I-Onlabs/claude-code-skills/tree/main/using-git-worktrees
Command: npx skills add https://github.com/I-Onlabs/claude-code-skills --skill using-git-worktrees-i-onlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It enables teams and individuals to start feature work without disrupting the main workspace by creating isolated git worktrees tied to the current repository.

Core Features & Use Cases

  • Safe directory selection: follows a defined priority order for choosing target worktree directories (.worktrees, worktrees, or user-directed preferences).
  • Automatic setup and validation: detects project name, creates the worktree, switches context, and can run basic project setup commands.
  • Baseline verification: validates a clean starting point with tests or builds before proceeding with work.

Quick Start

Set up an isolated git worktree for the current project following the priority rules and safety checks.

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 system automates directory selection by checking for a .worktrees or worktrees folder, reads CLAUDE.md preferences, and applies safety checks to prevent accidental commits.

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

A git worktree is an isolated directory linked to your repository that you need when starting new feature work, bug fixes, or experiments to enable development without disrupting your main workspace.

How does git worktree directory selection work when setting up isolation?

Git worktree directory selection follows a defined priority order, checking for a .worktrees folder first, then a worktrees folder, and finally using CLAUDE.md preferences or user prompts to determine the target path.

Can I run project setup commands automatically after creating a worktree?

Yes, you can run basic project setup commands automatically after the worktree is created, as the system detects the project name, switches context, and initiates setup to prepare your isolated environment.

What safety verifications are applied to protect my main workspace during worktree setup?

Safety verifications validate a clean starting point by running tests or builds before proceeding, ensuring the baseline is stable and protecting your main workspace from accidental commits.