worktree

Create Git worktrees with branches and prune old ones after safety checks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the creation and management of Git worktrees, streamlining your development workflow by allowing you to easily branch off and work on new features or fixes in isolated environments.

Core Features & Use Cases

  • Create New Worktree: Easily create a new Git worktree with a dedicated branch based on your current branch.
  • Prune Old Worktrees: Safely remove outdated or unused worktrees after performing necessary checks for open PRs, unmerged commits, and uncommitted files.
  • Use Case: When starting a new feature, you can use /worktree feature-name "Description of feature" to create a new worktree and branch, keeping your main development line clean. Later, you can use /worktree prune to clean up any worktrees you no longer need.

Quick Start

Create a new git worktree for a feature named 'new-login' with the description 'Implement new user login flow'.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I create a git worktree with a new branch for feature development?

To create a git worktree, use the command syntax to specify a feature name and description, which generates a new worktree and dedicated branch based on your current branch, keeping your main development line clean.

What is the safest way to prune old git worktrees without losing uncommitted changes?

Pruning old git worktrees safely requires checking for open PRs, unmerged commits, and uncommitted files before removal. This safety check process ensures no data loss occurs when cleaning up outdated worktrees.

When should I use git worktrees instead of standard branching for my development workflow?

Git worktrees are ideal when you need isolated environments for new features or fixes. They allow you to branch off and work independently without switching branches in your main directory, streamlining your development workflow.

Does pruning a worktree check for open pull requests before deletion?

Yes, pruning a worktree explicitly checks for open PRs alongside unmerged commits and uncommitted files. These safety checks prevent accidental data loss by verifying no pending work exists before removing the worktree.

Can I create a git worktree branch off a specific branch instead of the current one?

The worktree creation process supports creating branches off your current active branch. You can configure the worktree path while specifying the feature name and description to isolate new development work.