using-git-worktrees

Create isolated git worktrees with directory selection and safety checks.

1|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/mortenbroesby/playground --skill using-git-worktrees-mortenbroesby
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/mortenbroesby/playground/tree/main/.skills/using-git-worktrees
Command: npx skills add https://github.com/mortenbroesby/playground --skill using-git-worktrees-mortenbroesby

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineers start feature work in isolation to avoid contaminating the main workspace, ensuring safe branching and quick setup.

Core Features & Use Cases

  • Directory priority: prefer hidden .worktrees, then worktrees, to keep work areas separate from the main repository.
  • Preference via CLAUDE.md or explicit user prompts to determine destination and storage location.
  • Safety verification to ensure created worktrees are ignored by gitignore rules and do not get committed.
  • Automatic environment setup: auto-detects project type (Node, Rust, Python, Go) and prepares the workspace accordingly.

Quick Start

Ask me to set up an isolated git worktree for your feature work and follow the prompts to select the destination and verify ignore rules before starting 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 isolate feature work with git worktrees to keep my main workspace clean?

Git worktrees isolate feature work by creating separate working directories linked to your main repository, preventing branch contamination and keeping your primary workspace clean during multi-branch experiments.

How do I ensure created git worktrees are ignored by gitignore rules?

Ensure git worktrees are ignored by gitignore rules by applying safety verification checks, preventing worktree directories from being accidentally committed and maintaining strict branch isolation.

Can I auto-detect project type and prepare the workspace when setting up git worktrees?

Yes, you can auto-detect project type and prepare the workspace when setting up git worktrees. Environment setup automatically identifies Node, Rust, Python, or Go projects and configures the isolated directory accordingly.

What is the best directory location to store isolated git worktrees?

The best directory location to store isolated git worktrees is a hidden .worktrees directory, prioritized to keep work areas separate from the main repository, followed by a standard worktrees directory.

Does setting up git worktrees require a clean baseline repository?

Yes, setting up git worktrees requires a clean baseline repository. Safety checks verify the main workspace is clean before creating an isolated worktree, ensuring safe branching and preventing contamination.