git-worktree

Manage Git worktrees for isolated parallel development with environment file synchronization.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/compojoom/safe-engineering-plugin --skill git-worktree-compojoom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/compojoom/safe-engineering-plugin/tree/main/plugins/safe-engineering/skills/git-worktree
Command: npx skills add https://github.com/compojoom/safe-engineering-plugin --skill git-worktree-compojoom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Managing Git worktrees for isolated parallel development is error-prone and manual. This skill provides a unified interface to create, list, switch, and clean up worktrees, reducing friction and misconfigurations.

Core Features & Use Cases

  • Create worktrees from a base branch and manage branches in dedicated directories
  • List all worktrees with their current status and associated branches
  • Switch between worktrees to work on different features in isolation
  • Cleanup inactive worktrees automatically with safety prompts
  • Interactive confirmations and automatic environment file handling
  • Ensures .gitignore includes the .worktrees directory and copies environment files from the main repo

Quick Start

  • Create a new worktree: bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-login
  • List worktrees: bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh list
  • Switch to a worktree: bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh switch feature-login
  • Copy environment files to an existing worktree: bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env feature-login
  • Cleanup inactive worktrees: bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup

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 without manual configuration?

Git worktree management for parallel development is automated by a single script that creates isolated worktrees, updates from main, ensures .gitignore entries, and copies environment files.

What is the best way to switch between multiple Git worktrees during code review?

Switching between Git worktrees for code review is handled by a dedicated manager script that lists all active worktrees with their current status and associated branches for seamless selection.

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

Copying environment files to a Git worktree is performed automatically during creation and can be triggered manually using the copy-env command to synchronize configurations from the main repository.

Can I automatically clean up inactive Git worktrees without accidentally deleting active branches?

Cleaning up inactive Git worktrees is supported with automatic detection and interactive safety prompts, ensuring active branches are preserved before removing any isolated development directories.

Does Git worktree management work without additional dependencies or external CLI tools?

Git worktree management operates using a standalone bash script with no external dependencies, requiring only a standard Git installation to create, list, switch, and clean up isolated worktrees.