using-git-worktrees

Create isolated git worktrees with safety checks and automatic project setup.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines creating isolated git worktrees so developers can work on new features without touching the main workspace, preventing accidental changes to the active branch.

Core Features & Use Cases

  • Directory priority: prefer .worktrees, then worktrees, then CLAUDE.md, and finally ask the user where to create the worktree.
  • Safety verification: ensures the chosen local worktree directory is ignored by gitignore to avoid accidentally committing worktree contents.
  • Automatic project setup: detects the project type (Node, Rust, Python, Go) and runs the appropriate dependency installation and build steps before work begins.
  • Use Case: start feature work in isolation for large experiments or parallel development without disrupting the main branch.

Quick Start

  1. Decide where to create the worktree: prefer .worktrees if available, otherwise worktrees or the global path.
  2. Create the worktree: git worktree add "<path>" -b "<branch-name>"
  3. Allow the system to auto-detect and install dependencies (Node, Rust, Python, Go) and run initial setup.

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 affecting my current workspace?

You create an isolated git worktree by running `git worktree add` with a target path and new branch name, which generates a separate working directory without disturbing your active workspace. The skill automates this by prioritizing `.worktrees` or `worktrees` directories for safe placement.

What is a git worktree and when do I need it for feature development?

A git worktree is a linked working directory that lets you check out multiple branches simultaneously from a single repository. You need it for feature development when running large experiments or parallel tasks without disrupting your main branch.

Does this git worktree setup support Node, Rust, Python, and Go projects?

Yes, this git worktree setup supports Node, Rust, Python, and Go projects by auto-detecting the project type during creation. It runs the appropriate dependency installation and build steps automatically before implementation begins.

How do I prevent git worktree directories from being accidentally committed?

You prevent git worktree directories from being accidentally committed by verifying the chosen local path is listed in your `.gitignore` file. The skill enforces this safety check automatically for project-local worktrees placed in `.worktrees` or `worktrees`.

What is the best way to organize local git worktree paths?

The best way to organize local git worktree paths is using a priority system: prefer `.worktrees` first, then `worktrees`, then checking `CLAUDE.md` preferences, and finally prompting the user. This ensures safe, consistent directory placement across project directories.

Can I create a git worktree in a global location outside my project directory?

Yes, you can create a git worktree in a global location outside your project directory. If local directories like `.worktrees` are unavailable, the system uses `CLAUDE.md` preferences or prompts you to specify a global path for the worktree.