using-git-worktrees

Create and manage Git worktrees to isolate feature work from the main workspace.

6|2|Updated Aug 14, 2025
One-click install
npx skills add https://github.com/Im5tu/claude --skill using-git-worktrees-im5tu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Im5tu/claude/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/Im5tu/claude --skill using-git-worktrees-im5tu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill isolates feature work by creating and managing Git worktrees to keep changes separate from the main workspace.

Core Features & Use Cases

  • Deterministic directory selection: prioritizes existing worktrees, CLAUDE.md preferences, or user input.
  • Safety verification: ensures the worktree directory is ignored by gitignore before creation.
  • Flexible placement: supports project-local (.worktrees or worktrees) or global location and automatic setup of new worktrees for feature work.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for a feature branch. Then verify the new worktree and switch into it.

Frequently Asked Questions about using-git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate feature work with Git worktrees?

Git worktrees isolate feature work by creating separate workspaces within the same repository. This skill automates path calculation, repository checkout, and directory selection to keep changes separate from the main workspace.

What is the best way to manage multiple Git branches in one repository?

Managing multiple Git branches is streamlined by creating isolated worktrees. This approach allows multi-branch work within the same repository, keeping changes separate from the main workspace using project-local or global directories.

How do I configure Git worktree directory placement?

Git worktree directory placement supports project-local folders like .worktrees or worktrees, or a global location. Directory selection is deterministic, prioritizing existing worktrees, CLAUDE.md preferences, or user input.

Does Git worktree creation verify directory safety before checkout?

Yes, Git worktree creation includes safety verification by ensuring the worktree directory is ignored by gitignore. This prevents the new workspace from interfering with the main repository tracking.

Can I use CLAUDE.md to set user configuration for Git worktrees?

Yes, you can use CLAUDE.md for optional user configuration to set preferences for Git worktrees. The skill applies this configuration during deterministic directory selection and automated setup.

Why do I need Git worktrees for local development workflows?

Git worktrees are needed for local development workflows that require multi-branch work within the same repository. They keep changes separate from the main workspace, enabling isolated feature development without stashing.