using-git-worktrees

Create isolated Git worktrees with safety checks and auto-setup.

2|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/ShunmeiCho/dotclaude --skill using-git-worktrees-shunmeicho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/ShunmeiCho/dotclaude/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/ShunmeiCho/dotclaude --skill using-git-worktrees-shunmeicho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables automated creation of isolated Git worktrees to let you work on new features without disturbing the main repository.

Core Features & Use Cases

  • Directory selection: Prefer .worktrees, fallback to worktrees, or global locations based on project state and CLAUDE.md hints.
  • Safety verification: Ensures the target worktree is ignored by git, preventing accidental commits of local worktree data.
  • Auto-setup: Detects project language/tools (Node, Rust, Python, Go) and runs appropriate setup to bring the new worktree to a ready state.

Quick Start

Create a new worktree for a feature branch and switch into it: git worktree add .worktrees/feature-auth -b feature/auth; cd .worktrees/feature-auth

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 without accidentally committing its directory?

To create an isolated Git worktree safely, automation applies directory selection logic and runs safety verification using git check-ignore to ensure the target worktree path is ignored by Git, preventing accidental commits of local worktree data into the main repository.

What is the best way to automate Git worktree setup across different programming languages?

Automating Git worktree setup across languages is handled by auto-detecting project tools like Node, Rust, Python, and Go. The process reads existing configurations and runs the appropriate setup commands automatically, bringing the newly created worktree to a ready state for development.

Can I use a global directory instead of a project-local worktree folder?

Yes, you can use global worktree locations. The directory selection process prefers project-local paths like .worktrees or worktrees but falls back to global locations based on existing worktree states and specific CLAUDE.md preference hints configured within your repository.

Does Git worktree isolation work with existing branch configurations and .gitignore?

Git worktree isolation works with existing configurations by applying ignore verification with git check-ignore. This ensures the selected worktree directory is properly ignored by Git, maintaining safety and preventing accidental commits of isolated worktree data to the main branch.

Why should I use Git worktrees for feature branching instead of cloning the repository?

Git worktrees provide isolated feature branching without cloning the entire repository, saving disk space and setup time. The automated creation process selects appropriate directories, verifies Git ignore rules, and runs project-specific setup to bring the worktree online safely.