worktree

worktree is a skill for Claude Code from vindm/dotclaude. It costs 113 tokens per session (2,803 once invoked), scanned A, original, MIT.

A Git worktree setup for keeping each feature change in its own checkout of a project. It adds project settings read by a blocking check that stops edits made in the main checkout.

In plain words
What is it for?
Use it to set up and verify worktree-based development, including a test worktree that builds the project and a handoff for restarting and testing the protection.
Why use it?
It prevents multiple coding sessions or people from overwriting each other’s changes. It also avoids copying separate hook files that could become inconsistent.

Skill for Claude Code

Written for Claude Code: $CLAUDE_PLUGIN_ROOT variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; positional $N argument.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the dotclaude plugin — 7 skills, 5 agents, 5 hooks shipped together

Good fit Use it to set up and verify worktree-based development, including a test worktree that builds the project and a handoff for restarting and testing the protection.

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 vindm/dotclaude
Claude Code
/plugin install dotclaude

Made for: Claude Code.

Or install dotclaude, the plugin that ships this one along with the rest of its 7 skills, 5 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/vindm/dotclaude/worktree/github.svg)](https://agentmods.dev/skills/vindm/dotclaude/worktree)
Your own site
<a href="https://agentmods.dev/skills/vindm/dotclaude/worktree"><img src="https://agentmods.dev/badge/skills/vindm/dotclaude/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 worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/vindm/dotclaude/worktree"><img src="https://agentmods.dev/badge/skills/vindm/dotclaude/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,803 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00113 $0.02803
Opus 5.5 $0.00045 $0.01121
Sonnet 5.5 $0.00023 $0.00561
Haiku 4.5 $0.00011 $0.00280

Measured 3mo ago against content hash ebb6dd004f22, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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.

plugins/core/skills/worktree/SKILL.md · 209 lines

How it starts

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

/dotclaude:worktree — parallel-session isolation kit

You are setting up worktree-per-feature discipline: every substantive edit to the policed repo happens in a dedicated git worktree, enforced by a blocking PreToolUse hook. Read ../../principles/worktree-discipline.md FIRST — it carries the doctrine and the five hard-won lessons this flow encodes; this file is the procedure.

The hook is CONSUMED, not rendered. The plugin ships one debugged check-main-checkout-edit.sh (in hooks/scripts/, wired always-on) that reads a worktree: block from the project's dotclaude.yml and NO-OPs when there is none. So this flow does NOT copy a hook into the project — it writes the config the consumed hook reads. No per-project hook copy, no drift, and a project tunes its policing in one data file.

The deliverable is not files — it is a proven install: the worktree: config the consumed hook reads correctly, a smoke worktree that built the project for real, and an explicit restart + live-fire handoff.

Phase 1 — Read the project's concurrency shape

Before any question:

  1. Repo topology — is the project root the repo, or does the policed repo sit below it?

    git rev-parse --show-toplevel 2>/dev/null
    for d in */; do git -C "$d" rev-parse --show-toplevel 2>/dev/null; done
    git worktree list 2>/dev/null
    

    Multiple sibling repos → ask which one(s) carry the collision risk (usually the one being actively developed, not read-only references/snapshots).

  2. Parallel-session evidence — lock files (.session_lock, *.lock at repo root), CLAUDE.md sections about session coordination, git history mentions of collisions/clobbered work, scheduled/background agents. This calibrates urgency and whether a lease protocol already exists to narrow.

  3. Git-ignored per-machine files (lesson 2 — the fresh-worktree breakers):

    git -C <repo> status --ignored --porcelain | grep '^!!'
    

    Filter to files/dirs the build actually needs: .env*, config/* pointers, node_modules, credential stores. For each, note the likely recipe: copy a committed *.example template / symlink from main / regenerate / skip.

Read the full file on GitHub · 209 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 209 lines · 113 tokens per session scan A ebb6dd004f22

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository vindm/dotclaude (1 stars, last pushed 2mo ago), licensed MIT. It adds 113 tokens to every session and 2,803 once invoked, about $0.0005 per session on Opus 5.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-08-31.

Related

worktree compared with skills from other repositories

worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktreevindm/dotclaudeSkill12mo agoMITA113Claude Code
git-commit-helperalirezarezvani/claude-code-tresorSkill79020d agoMITA55Claude Code
changelogwesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k2d agononeA28Claude Code
emerging-techniques-model-mergingdavila7/claude-code-templatesSkill35ktodayMITA77Claude Code, Codex
prYeachan-Heo/oh-my-claudecodeSkill41ktodayMITA47Claude Code
shipplugin87/ux-ui-agent-skillsSkill3.3k12d agoMITA34Claude Code
kb-github-workflow-standardsCommunity-Access/accessibility-agentsSkill460todayMITA46Claude Code, Codex