using-git-worktrees

Set up isolated git worktrees for feature development across coding agents.

63|2|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/xhyqaq/superpowers-plus --skill using-git-worktrees-xhyqaq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/xhyqaq/superpowers-plus/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/xhyqaq/superpowers-plus --skill using-git-worktrees-xhyqaq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of breaking your stable main working branch during feature development by ensuring all work happens in an isolated workspace, and removes the friction of manually setting up consistent worktrees across different coding platforms and git configurations.

Core Features & Use Cases

  • Auto-detection of existing isolation: Checks if you are already in a linked worktree or submodule to avoid redundant setup.
  • Cross-platform worktree support: Prioritizes native platform worktree tools over manual git worktree fallback to prevent harness conflicts.
  • Safety guardrails: Verifies worktree directories are gitignored to avoid accidental commits, and handles edge cases like sandbox permission errors and submodule environments.
  • Use Case: When starting a new payment processing feature for your e-commerce app, this Skill automatically sets up a dedicated isolated workspace so you can make experimental changes without risking your stable main branch, and runs baseline tests to confirm the workspace is ready for work.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for my new payment processing feature.

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 workspace for feature development?

Git worktrees prevent branch contamination by creating isolated workspaces for experimental changes. This Skill automatically configures them across coding agent environments like Claude Code and Gemini CLI to protect your stable branch.

Can I use git worktrees with coding agents like Claude Code or Codex?

Yes, git worktrees work with coding agents including Claude Code, Codex, OpenCode, and Gemini CLI. The Skill applies cross-platform worktree setup to provide isolated git-based environments for any coding agent task.

What's the best way to avoid contaminating my main git branch during experiments?

The best way to avoid main branch contamination is using an isolated git worktree. This Skill auto-detects existing submodules or linked worktrees and sets up a dedicated workspace for conflict-free experimental changes.

How do I ensure git worktree directories are properly gitignored?

To ensure git worktree directories are properly gitignored, this Skill includes safety guardrails that verify directory ignore status before setup, preventing accidental commits of isolated workspace files into your main repository.

Does git worktree setup work correctly inside git submodules?

Yes, git worktree setup works inside submodules. The Skill includes safety guards for submodule detection and handles edge cases like sandbox permission errors to ensure reliable isolated workspace creation in complex git configurations.