worktree

worktree is a skill for Claude Code from greglas75/zuvo. It costs 61 tokens per session (7,303 once invoked), scanned A, original, MIT.

A Git worktree tool that gives a branch its own working directory, with commands for creating, finishing, and cleaning up worktrees.

In plain words
What is it for?
Use it before feature work that needs branch isolation, or to finish and reclaim old worktrees.
Why use it?
It keeps separate tasks isolated so changes in one branch do not interfere with work in another.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Part of the zuvo plugin — 56 skills, 47 agents, 5 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/greglas75/zuvo/worktree
Any agent
npx skills add greglas75/zuvo --skill worktree
Clone the repo
git clone --depth 1 https://github.com/greglas75/zuvo

Made for: Claude Code.

Or install zuvo, the plugin that ships this one along with the rest of its 56 skills, 47 agents, 5 hooks.

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 worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/greglas75/zuvo/worktree.svg)](https://agentmods.dev/skills/greglas75/zuvo/worktree)
Your own site
<a href="https://agentmods.dev/skills/greglas75/zuvo/worktree"><img src="https://agentmods.dev/badge/skills/greglas75/zuvo/worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,303 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00061 $0.07303
Opus 5 $0.00030 $0.03651
Sonnet 5 $0.00012 $0.01461
Haiku 4.5 $0.00006 $0.00730

Measured 2d ago against content hash ad0f12e63af0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

worktree scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/worktree/SKILL.md · 564 lines

How it starts

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

zuvo:worktree

Git worktree isolation with structured completion options.

Three modes: CREATE (set up a new worktree), FINISH (wrap up work in the current worktree), and PRUNE (reclaim finished worktrees and fix a nested layout).

Detect mode automatically:

  • If the user explicitly says "create", "finish", or "prune"/"cleanup", honor that regardless.
  • If the current directory IS inside a worktree (check git worktree list), default to FINISH.
  • If the current directory is the main checkout, default to CREATE.

CREATE Mode

Step 0: Accumulation Precheck

Run PRUNE steps 1-2 (bookkeeping reconcile + classification) in report-only form. Removing nothing, print one line:

Worktrees in this repo: <n> live (<n> reclaimable, <n> idle >30d). Layout: <sibling | NESTED>.

If reclaimable or nested worktrees exist, point at zuvo:worktree prune and continue with CREATE. Never block CREATE on cleanup.

Step 1: Determine Worktree Directory

Compute the default first -- it is a sibling of the repo, never a child:

REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_NAME=$(basename "$REPO_ROOT")
DEFAULT_WTDIR="$(dirname "$REPO_ROOT")/${REPO_NAME}-worktrees"

Resolution order. Use the first match, do NOT ask the user:

  1. $ZUVO_WORKTREE_DIR if set -- absolute path, or relative to $REPO_ROOT.
  2. Project instructions preference -- a worktree/worktrees section in the project AGENTS.md or CLAUDE.md that declares a directory. If the declared path is inside $REPO_ROOT, honor it but emit the nested-layout warning below.
  3. Existing sibling -- $DEFAULT_WTDIR already exists.
  4. Existing nested directory (LEGACY) -- .worktrees/, worktrees/, or .claude/worktrees/ inside $REPO_ROOT. Use it so worktrees for one repo do not end up split across two locations, but you MUST emit the nested-layout warning and offer the PRUNE-mode migration in the same turn.
  5. Default -- $DEFAULT_WTDIR. Create it with mkdir -p.

Read the full file on GitHub · 564 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. 2d ago First seen · 564 lines · 61 tokens per session scan A ad0f12e63af0

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository greglas75/zuvo (6 stars, last pushed yesterday), licensed MIT. It adds 61 tokens to every session and 7,303 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

kanso-pr

Use when the user asks to write a pull request description, open a PR, draft PR notes, or summarise a branch for review.

blakecyze/kanso · 32 tokens

ring:committing-changes

Commit changes with scope allowlist enforcement, atomic grouping, GPG-signed conventional commits, and trailer management. Detects the repo's PR-validation scope policy before proposing any message. Use when the user asks to commit or has changes ready to record. Skip when the working tree is clean or the user wants…

LerianStudio/ring · 74 tokens

ring:opening-pull-requests

Open a GitHub Pull Request with automatic base branch detection, scope allowlist enforcement, PR template filling, and post-create base verification. Replaces ring:generating-pr-descriptions. Use after pushing a branch when ready to open a PR. Skip if the branch is not yet pushed or there are uncommitted changes …

LerianStudio/ring · 83 tokens

ring:shipping-changes

End-to-end git orchestrator: branch → commit → push → PR, with a full plan presented before any execution. Detects base branch and scope allowlist once and propagates to all phases. Use when ready to ship a complete unit of work. Skip if only one phase is needed: commit-only → ring:committing-changes, PR-only →…

LerianStudio/ring · 86 tokens

ring:generating-release-guides

Generating an internal Operations-facing update/migration guide from the git diff between two refs, documenting per-change client impact, deploy ordering, monitoring, and rollback notes in English, pt-br, or both. Use when preparing a version release or recording what changed for the Ops team. Runs read-only by…

LerianStudio/ring · 85 tokens

ring:cleaning-comments

Cleaning redundant and obvious comments following clean code principles while preserving meaningful documentation. Supports git scope filtering (staged, unstaged, branch, commit-range). Use when code has excessive comments, during code review, or post-refactor cleanup. Skip when reviewing documentation files or…

LerianStudio/ring · 64 tokens