git-worktree

Create, list, switch, and clean up Git worktrees with environment file copying.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/ybbms777/compound-engineering --skill git-worktree-ybbms777
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/ybbms777/compound-engineering/tree/main/skills/git-worktree
Command: npx skills add https://github.com/ybbms777/compound-engineering --skill git-worktree-ybbms777

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, and includes scripts (resource) components.

What problem does it solve?

This Skill eliminates the friction of managing parallel development workflows, removing the need to constantly stash changes or switch branches when working on multiple features or code reviews at the same time.

Core Features & Use Cases

  • Automated Worktree Operations: Create, list, switch between, and clean up Git worktrees with interactive confirmations to prevent accidental data loss.
  • Seamless Environment Setup: Automatically copies .env files from the main repository to new worktrees and configures dev tool trust for mise and direnv with branch-aware safety rules.
  • Real-World Use Case: When you need to review a PR while actively working on a separate feature, use this Skill to create an isolated worktree for the review without disrupting your current development context.

Quick Start

Request the AI to create an isolated Git worktree for your ongoing code review task so you can test changes without affecting your active feature branch.

Frequently Asked Questions about git-worktree

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

FAQPage Schema
How do I review a pull request without stashing my current git branch changes?

To review a pull request without stashing changes, use an isolated git worktree to create a separate working directory. This allows you to test code reviews concurrently without disrupting your active feature branch context.

What is the best way to manage multiple parallel development branches locally?

The best way to manage parallel development branches locally is using git worktrees. This approach creates isolated environments for concurrent feature development, eliminating the friction of constant branch switching.

Can I automatically copy environment files when creating a new git worktree?

Yes, you can automatically copy environment files when creating a git worktree. The workflow copies .env files from the main repository to new worktrees during creation to ensure a seamless environment setup.

Does this git worktree workflow support dev tools like direnv and mise?

Yes, the git worktree workflow supports dev tools like direnv and mise. It configures dev tool trust automatically with branch-aware safety rules to ensure your local environment is correctly recognized.

How do I safely clean up temporary git worktrees after finishing a code review?

To safely clean up temporary git worktrees after a code review, use automated worktree cleanup operations. The process includes interactive confirmations and safety guardrails for review branches to prevent accidental data loss.