using-git-worktrees

Create isolated Git worktrees for simultaneous branch development.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Theopsguide/claude-agents --skill using-git-worktrees-theopsguide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Theopsguide/claude-agents/tree/main/plugins/development-workflow/skills/using-git-worktrees
Command: npx skills add https://github.com/Theopsguide/claude-agents --skill using-git-worktrees-theopsguide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines your development workflow by allowing you to work on multiple Git branches simultaneously in isolated directories. It eliminates the need for constant branch switching, stashing, and unstashing, saving you time and reducing context-switching overhead, so you can focus on coding.

Core Features & Use Cases

  • Isolated Workspaces: Create separate directories for each feature or bug fix, all sharing the same Git repository.
  • Automated Setup: Automatically detect and run project setup commands (e.g., npm install, pip install) within the new worktree.
  • Safety Verification: Ensures .gitignore is correctly configured to prevent accidental commits of worktree contents.
  • Clean Baseline: Verifies that the new worktree starts with passing tests, ensuring a clean development environment.
  • Use Case: You're working on a new feature, but a critical bug report comes in. Use this Skill to quickly spin up a worktree for the bug fix, address it, and return to your feature work without disrupting your current changes.

Quick Start

Example: Create a worktree for a new feature branch

(Assuming you are in the main repository directory)

This will create a new directory like .worktrees/my-feature

and switch to a new branch named feature/my-feature

git worktree add .worktrees/my-feature -b feature/my-feature cd .worktrees/my-feature