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.
/plugin marketplace add NikiforovAll/claude-code-rules/plugin install handbook-git-worktreeWrote 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.
[](https://agentmods.dev/skills/nikiforovall/claude-code-rules/git-worktree)<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.
<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>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.
| Model | Per session | Once 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 |
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>` 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
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.
- 1mo ago First seen · 261 lines · 57 tokens per session scan C f8189b91ee1e
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.
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"…
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…
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…
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.
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.
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.