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 1mo 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 1mo 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. 1mo 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 (141 stars, last pushed 15d 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

Other skills, from other repositories

review-pr

Review a Pull Request in one of two postures: an expository "tour guide" that walks through changes in logical order, or an adversarial audit that assumes the change is wrong until proven safe and hunts for the failure mode. Triggers: "review PR #123", "adversarial review", "walk me through this PR", "PR tour guide"…

jontsai/claude-plugins · 139 tokens

update-feature-docs

Generate or update documentation for the current feature branch. Analyzes all changes (commits, diffs) between the feature branch and base branch, then creates or updates docs/features/ /README.md with incremental indexing based on existing feature docs. Use when documenting a feature branch, creating feature…

lukaskellerstein/claude-my-marketplace · 175 tokens

git-pr

For every git repo in the current folder, create and merge a PR for feature-branch work, then return to the default branch and pull. With no arguments this runs fully autonomously across ALL sub-repos — commit → push → PR → squash-merge → checkout main → pull. Use whenever the user asks to commit, ship, push…

lukaskellerstein/claude-my-marketplace · 117 tokens

release-notes

Generate user-facing release notes from tickets, PRDs, or changelogs. Creates clear, engaging summaries organized by category (new features, improvements, fixes). Use when writing release notes, creating changelogs, announcing product updates, or summarizing what shipped.

phuryn/pm-skills · 57 tokens

cloudflare-workers-ci-cd

Complete CI/CD guide for Cloudflare Workers using GitHub Actions and GitLab CI. Use for automated testing, deployment pipelines, preview environments, secrets management, or encountering deployment failures, workflow errors, environment configuration issues.

secondsky/claude-skills · 50 tokens

catchup

Answer "where did I stop?" for this project. Gives three short groups, done, open and next, taken from the last chat, the recorded to-dos, the last handoff note and git. Use when the user comes back to a project, starts a new chat, or asks where they left off. It writes nothing.

Avijit07x/claude-db · 71 tokens