using-git-worktrees

Create an isolated Git worktree for feature work with automatic setup.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/namhoangg/agent-starter-kit --skill using-git-worktrees-namhoangg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/namhoangg/agent-starter-kit/tree/main/cursor/skills/using-git-worktrees
Command: npx skills add https://github.com/namhoangg/agent-starter-kit --skill using-git-worktrees-namhoangg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees enable isolated workspaces that share the same repository, allowing concurrent feature work without switching branches and risking accidental changes. Core principle: Systematic directory selection + safety verification = reliable isolation.

Core Features & Use Cases

  • Directory selection: prefer .worktrees, fallback to worktrees, or CLAUDE.md directive when present.
  • Safety verification: ensure the selected worktree directory is ignored by git before creation and verify baseline.
  • Auto-creation: detect project name and create a new worktree on the desired branch, with optional global location support.

Quick Start

Instruct me to set up an isolated git worktree for feature work, selecting the appropriate directory and validating ignore rules before creating the worktree.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I set up an isolated git worktree for feature work?

This setup automatically isolates feature work by selecting a project-local directory like .worktrees, verifying it is ignored by git for safety, detecting the project name, and creating the new worktree on your desired branch.

What is a git worktree and when should I use it for feature work?

A git worktree is an isolated workspace sharing the same repository that allows concurrent feature work without switching branches. Use it when starting feature work that requires reliable isolation and safety from accidental changes.

Can I use a global location instead of a local .worktrees directory for git worktrees?

Yes, git worktrees support optional global location setup. The system prefers a local .worktrees directory, falls back to a worktrees directory, or uses a global location, with CLAUDE.md directives taking precedence when present.

Does git worktree creation verify ignore rules before setting up the workspace?

Yes, safety verification ensures the selected worktree directory is ignored by git before creation and verifies the baseline. This prevents accidental commits of worktree directories and ensures reliable isolation.

What are the limitations of using git worktrees for isolated feature work?

Git worktrees require directory preference resolution and ignore verification before creation. You must ensure the selected directory is properly ignored by git, or the safety verification baseline will fail and halt the automated setup process.