using-git-worktrees

Create isolated git worktrees for feature work with dependency setup and baseline tests.

Updated May 7, 2026
One-click install
npx skills add https://github.com/TumeloRamaphosa/StudEx-Valley-OS --skill using-git-worktrees-tumeloramaphosa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/TumeloRamaphosa/StudEx-Valley-OS/tree/main/.claude/skills/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/TumeloRamaphosa/StudEx-Valley-OS --skill using-git-worktrees-tumeloramaphosa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents accidental changes to your current branch by creating an isolated workspace for feature work before running implementation steps.

Core Features & Use Cases

  • Isolation detection first: Detects whether you are already in a linked worktree (and guards against submodule false positives) before creating anything.
  • Native-first workspace creation: Uses preferred platform/native worktree tooling when available to avoid harness-invisible phantom state.
  • Safe git worktree fallback: Creates a worktree using git worktree add with a clear directory selection priority and mandatory ignore verification for project-local directories.
  • Automated setup and baseline verification: Runs project-appropriate dependency setup (npm/cargo/pip/poetry/go) and verifies a clean test baseline before you proceed.

Quick Start

Use the skill to set up an isolated worktree for your feature branch, then install dependencies and run the appropriate baseline tests for this repo.

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 branch work from my current git checkout?

To isolate feature branch work, you can use a git worktree to create a separate workspace. This prevents accidental changes to your active checkout while allowing you to run implementation steps safely without contamination.

What is the best way to use git worktrees for feature development?

The best way to use git worktrees for feature development is to use native worktree tooling first, falling back to safe git worktree add commands. This ensures proper isolation, ignore verification, and avoids harness-invisible phantom state.

How do I set up dependencies and baseline tests in a new git worktree?

After creating a git worktree, you set up dependencies by running project-appropriate install commands like npm, cargo, pip, poetry, or go. Then, you verify a clean test baseline before proceeding with implementation.

Does git worktree creation work correctly inside submodules?

Git worktree creation includes submodule guarding to prevent false positives. It detects whether you are already in a linked worktree and guards against submodule issues before attempting to create a new isolated workspace.

What happens if native git worktree tools are not available on my platform?

If native git worktree tools are unavailable, a safe sandbox fallback uses the standard git worktree add command. This fallback follows a clear directory selection priority and mandates ignore verification for project-local directories.

When should I use an isolated git workspace for my implementation plan?

You should use an isolated git workspace when starting feature work or before executing an implementation plan that should not risk current changes. This prevents accidental modifications to your current branch during development.