git-worktree

git-worktree is a skill for Claude Code from NikiforovAll/claude-code-rules. It costs 57 tokens per session (1,789 once invoked), scanned C, original, Apache-2.0.

A tool for managing Git worktrees, which are separate working folders connected to different branches of the same Git project.

In plain words
What is it for?
It helps create, list, switch between, and remove worktrees for parallel development, bug fixes, and code reviews.
Why use it?
It lets developers work on several branches at once without repeatedly stashing or moving unfinished changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/dev/myproject.

Part of the handbook-git-worktree plugin — 1 skill shipped together

Good fit It helps create, list, switch between, and remove worktrees for parallel development, bug fixes, and code reviews.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add NikiforovAll/claude-code-rules
Claude Code
/plugin install handbook-git-worktree

Made for: Claude Code.

Or install handbook-git-worktree, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/nikiforovall/claude-code-rules/git-worktree/github.svg)](https://agentmods.dev/skills/nikiforovall/claude-code-rules/git-worktree)
Your own site
<a href="https://agentmods.dev/skills/nikiforovall/claude-code-rules/git-worktree"><img src="https://agentmods.dev/badge/skills/nikiforovall/claude-code-rules/git-worktree/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/nikiforovall/claude-code-rules/git-worktree"><img src="https://agentmods.dev/badge/skills/nikiforovall/claude-code-rules/git-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,789 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.01789
Opus 5.5 $0.00023 $0.00716
Sonnet 5.5 $0.00011 $0.00358
Haiku 4.5 $0.00006 $0.00179

Measured 3mo ago against content hash f8189b91ee1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

git-worktree scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

3. Remove worktree: `git worktree remove <path>` or manually `rm -rf <path>`
plugins/handbook-git-worktree/skills/git-worktree/SKILL.md · 261 lines

How it starts

The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Worktree Management

Overview

This skill provides comprehensive Git worktree management capabilities, enabling work on multiple branches simultaneously in isolated directories. Worktrees eliminate the need for stashing when switching contexts and are ideal for parallel development, quick bug fixes, and code reviews.

When to Use This Skill

Use this skill when the user wants to:

  • Create a new worktree from a local branch, remote branch, or new branch
  • List all active worktrees with detailed information
  • Delete and clean up worktrees
  • Get navigation commands to switch between worktrees
  • Set up parallel development environments

How It Works

Configuration

Location Strategy: Sibling directory pattern

  • Worktrees are created outside the main repository: ../<project>-<branch>
  • Example: Main repo at ~/dev/myproject, worktree at ~/dev/myproject-feature-x
  • Benefits: Clean separation, no nested repos, IDE-friendly

Naming Convention: <project>-<branch>

  • Project name extracted using: basename "$(git rev-parse --show-toplevel)"
  • Example: myproject-feature-auth, myapp-bugfix-login

Interface

Hybrid Mode: Accepts arguments when provided, prompts when missing

Usage patterns:

# Interactive menu
User: "Manage my worktrees"
User: "Create a worktree"

# Direct with arguments
User: "Create worktree from remote branch feature-x"
User: "List all worktrees"
User: "Delete worktree for branch hotfix-123"

Core Operations

1. List Worktrees

Purpose: Show all active worktrees with detailed information

What to display:

  • Index number for easy reference
  • Worktree path
  • Branch name
  • HEAD commit hash (short)
  • Commit message (first line)
  • Indicator for current worktree

Implementation:

# Get project name
project=$(basename "$(git rev-parse --show-toplevel)")

# List worktrees with details
git worktree list -v

Output format:

Git Worktrees for myproject:

1. /Users/dev/myproject (main)
   abc1234 Initial commit
   [CURRENT]

2. /Users/dev/myproject-feature-x (feature-x)
   def5678 Add authentication logic

3. /Users/dev/myproject-hotfix (hotfix-123)
   789abcd Fix login bug

Read the full file on GitHub · 261 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 261 lines · 57 tokens per session scan C f8189b91ee1e

Subscribe to this mod's changes

git-worktree is a skill published in the GitHub repository NikiforovAll/claude-code-rules (144 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 57 tokens to every session and 1,789 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

git-worktree compared with skills from other repositories

git-worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-worktreeNikiforovAll/claude-code-rulesSkill1441mo agoApache-2.0C57Claude Code
review-prjontsai/claude-pluginsSkill61mo agoMITA139Claude Code
git-prlukaskellerstein/claude-my-marketplaceSkill3yesterdaynoneA124Claude Code
update-feature-docslukaskellerstein/claude-my-marketplaceSkill3yesterdaynoneA175Claude Code
release-notesphuryn/pm-skillsSkill28k23d agoMITA57Claude Code
cloudflare-workers-ci-cdsecondsky/claude-skillsSkill2572d agoMITA50Claude Code
claude-code-bash-patternssecondsky/claude-skillsSkill2572d agoMITB52Claude Code