git-worktree

Create, list, switch, and clean up Git worktrees under .worktrees.

11|2|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/James-Traina/compound-science --skill git-worktree-james-traina
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/James-Traina/compound-science/tree/main/skills/git-worktree
Command: npx skills add https://github.com/James-Traina/compound-science --skill git-worktree-james-traina

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill helps software engineers manage Git worktrees to enable isolated parallel development, simplifying creation, listing, switching, and cleanup across multiple feature branches.

Core Features & Use Cases

  • Create worktrees from main with clear branch names, ensuring a consistent directory structure under .worktrees
  • List all worktrees with current status and their associated branch
  • Switch between worktrees for parallel feature development or isolated reviews
  • Clean up completed or inactive worktrees with interactive confirmation
  • Auto-manage .gitignore and copy environment files from the main repo to new worktrees for seamless testing
  • Integrate with Claude Code workflows to offer worktrees during review or parallel development

Quick Start

Create a new worktree from main named feature-login and start using it.

Frequently Asked Questions about git-worktree

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

FAQPage Schema
How do I manage Git worktrees for parallel feature development?

To manage Git worktrees for parallel feature development, you can create isolated worktrees from a base branch, list their current status, switch between them, and clean up completed worktrees with interactive confirmation. This keeps multiple features isolated under a consistent directory structure.

What is the best way to set up isolated workspaces for parallel Git branches?

Setting up isolated workspaces for parallel Git branches involves creating worktrees from a base branch, storing them under a .worktrees directory, updating the base branch, ensuring .gitignore is configured, and copying environment files from the main repository to the new worktree.

How do I create a new Git worktree and copy environment files automatically?

Creating a new Git worktree automatically copies environment files from the main repository to the new worktree directory. This ensures seamless testing by maintaining a consistent directory structure under .worktrees and auto-managing .gitignore entries.

Can I use Git worktrees for isolated code reviews alongside active feature branches?

Yes, you can use Git worktrees for isolated code reviews alongside active feature branches. The workflow supports switching between worktrees specifically for parallel feature development or isolated reviews, allowing you to review code without disrupting your active development environment.

How do I safely clean up completed or inactive Git worktrees?

To safely clean up completed or inactive Git worktrees, you can use the cleanup task which provides interactive confirmation before removal. This ensures that active worktrees are not accidentally deleted during parallel development sessions.