Back to Skills

git-worktree

This skill manages Git worktrees for isolated parallel development. It handles creating, listing, switching, and cleaning up worktrees with a simple interactive interface, following KISS principles.

6,114stars482forksUpdated 1/23/2026

Security Assessment

Low Risk(80/100)

Detected risks:

Sensitive File Access([SKILL.md] .env)
Security Score80/100

About git-worktree

The 'git-worktree' skill is designed to simplify and streamline the management of Git worktrees, enabling isolated parallel development workflows. By handling tasks such as creating, listing, switching, and cleaning up worktrees, it eliminates the complexity of managing multiple branches and development environments in Git. This skill follows the KISS (Keep It Simple, Stupid) principles to provide a user-friendly and efficient way to work on features and review code without interfering with the main development branch. It automates key actions like copying environment files and ensuring proper Git configurations, making parallel development easier and more organized.

Key features of the 'git-worktree' skill include the ability to create new worktrees based on a main branch or another base branch, list existing worktrees with their current status, and switch seamlessly between worktrees to manage different tasks concurrently. The skill also supports automatic management of .gitignore files and environment variables, ensuring a consistent and clean setup for each worktree. Cleanup of completed worktrees is also automated, minimizing manual maintenance. The interactive nature of this skill prompts users for confirmations, helping avoid mistakes and ensuring the integrity of the workflow.

This skill is particularly useful for developers working on multiple features or reviewing pull requests (PRs) in isolation. It integrates with Claude workflows, but can also be manually invoked via simple bash commands. Target users include developers who frequently need to juggle multiple tasks, such as feature development, code reviews, and parallel development. It is an ideal solution for teams who want to simplify Git management and ensure consistent development environments.

FAQ

How do I use the git-worktree skill?

You can use the skill by invoking the `worktree-manager.sh` script with specific commands such as `create`, `list`, `switch`, and `cleanup`. It can be triggered both manually via bash commands or automatically through Claude workflows for code reviews and feature work.

Can I use `git worktree add` directly instead of the manager script?

No, it is essential to always use the `worktree-manager.sh` script. This script ensures proper setup, including copying environment files and updating the .gitignore file, which the raw `git worktree add` command does not handle.

Does the skill manage environment files?

Yes, the skill automatically copies relevant environment files, such as `.env`, `.env.local`, and `.env.test`, from the main repository to new worktrees, ensuring a consistent development environment.

What happens if I clean up a worktree?

When you clean up a worktree, the skill removes the worktree directory and ensures that the environment remains clean, helping you maintain an organized workspace without leaving orphaned directories.

Is there any specific requirement for using the git-worktree skill?

To use the skill effectively, you must invoke the `worktree-manager.sh` script, and the skill assumes that you are working within a Git-based repository. It also requires bash support for executing the commands.

Install git-worktree

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill