worktree

worktree is a skill for Claude Code from vanducng/skills. It costs 134 tokens per session (6,755 once invoked), scanned A, original, MIT.

A workflow for creating isolated Git worktrees, which are separate working folders connected to branches in the same repository. It prepares each folder with copied environment files, separate ports, and detected setup steps.

In plain words
What is it for?
Use it to create, inspect, and clean workspaces for parallel feature development.
Why use it?
It lets several features or agents run at once without mixing files, branches, environment settings, or local servers.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool; mentions Claude Code.

Part of the vd plugin — 80 skills, 14 agents 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/vanducng/skills/worktree
Any agent
npx skills add vanducng/skills --skill worktree
Clone the repo
git clone --depth 1 https://github.com/vanducng/skills

Made for: Claude Code.

Or install vd, the plugin that ships this one along with the rest of its 80 skills, 14 agents.

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/vanducng/skills/worktree.svg)](https://agentmods.dev/skills/vanducng/skills/worktree)
Your own site
<a href="https://agentmods.dev/skills/vanducng/skills/worktree"><img src="https://agentmods.dev/badge/skills/vanducng/skills/worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,755 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.00134 $0.06755
Opus 5 $0.00067 $0.03377
Sonnet 5 $0.00027 $0.01351
Haiku 4.5 $0.00013 $0.00675

Measured 2d ago against content hash a17b8d20de77, 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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/worktree.cjs, scripts/worktree.test.cjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 · 417 lines

How it starts

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

Worktree

Spin up an isolated git worktree so a new feature, bugfix, or parallel agent run lives on its own branch and its own filesystem path - without disturbing your main checkout. Each worktree arrives ready to run: env files copied, a private port block assigned, install commands detected. By default the agent session moves into the new worktree so subsequent work happens there - pass --no-enter to stay put. Pairs naturally with vd:cook and vd:fix (implement in the worktree) and vd:ship (land it).

What this skill is - and isn't

Skill Question it answers Output
vd:worktree Where does this feature/branch live on disk, and how does it run without colliding? Worktree + branch + env + ports, ready for work
vd:git How do I stage/commit/push this branch? Conventional commits on the current branch
vd:ship Is this branch ready to land? Tests → review → version → PR
vd:scout / vd:plan What am I going to build? Reports + phase files
vd:herd-worktree How should a Laravel app served by Herd be isolated? This skill's worktree mechanics + Herd link/secure/env/DB/Vite setup

Standard location: .worktrees/

All worktrees live at <git-root>/.worktrees/<repo>-<feature>/ - one rule for every repo type:

  • Standalone<repo>/.worktrees/
  • Monorepo<monorepo-root>/.worktrees/
  • Submodule → topmost superproject's .worktrees/

.worktrees/ is a top-level sibling of the .workbench/ artifact umbrella, deliberately not nested under it. Worktrees are full checkouts (heavy, contain source), so nesting them inside .workbench/ would pollute artifact globs (reports/, plans/) and bloat the umbrella. The script auto-appends /.worktrees/ and .env.worktree to .git/info/exclude when the repo doesn't already ignore them, so git status stays clean without touching tracked files.

Worktrees + the umbrella (artifacts survive worktree removal). Artifact paths anchor to the main worktree, so work done from any linked worktree writes back to the main checkout's .workbench/ - surviving git worktree remove. Under paths.layout: feature-first, each worktree's branch resolves its own feature (e.g. feat/ELT-3316-….workbench/features/elt-3316-…/), so parallel worktrees on different tickets land in separate feature folders under the one shared main umbrella - never colliding, never duplicated. A linked worktree has no local .workbench/.

Read the full file on GitHub · 417 lines

Files

What ships with it

2 files 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. 2d ago First seen · 417 lines · 134 tokens per session scan A a17b8d20de77

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository vanducng/skills (7 stars, last pushed 2d ago), licensed MIT. It adds 134 tokens to every session and 6,755 once invoked, about $0.0007 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-04.

Related

Other skills, from other repositories

git-workflow

安全处理 Git 状态检查、提交信息、commit、分支、push、PR 和 rebase。用于用户要求检查改动、生成或创建提交、管理分支、推送、发起 PR 或整理历史时;严格区分每个动作的授权,并保护工作树中已有和无关的修改。.

laolaoshiren/claude-code-skills-zh · 73 tokens

changelog-gen

Changelog 生成器 - 从 Git 历史自动生成 CHANGELOG.

laolaoshiren/claude-code-skills-zh · 19 tokens

resolve-pr-comments

Evaluate, fix, answer, and reply to GitHub pull request review comments and conversation comments. Handles both change requests (fix or skip) and reviewer questions (explain using reasoning recalled from past Claude Code transcripts). Use when the user asks to "resolve PR comments", "fix review comments", "address PR…

tobihagemann/turbo · 95 tokens

create-pr

Create a GitHub pull request with a drafted title and description. Use when the user asks to "create a PR", "create a pull request", "open a PR", or "submit a PR".

tobihagemann/turbo · 44 tokens

update-pr

Update an existing GitHub pull request's title and description to reflect the current state of the branch. Use when the user asks to "update the PR", "update PR description", "update PR title", "refresh PR description", or "sync PR with changes".

tobihagemann/turbo · 56 tokens

changelog-rules

Shared changelog conventions and formatting rules referenced by /create-changelog and /update-changelog. Not typically invoked directly.

tobihagemann/turbo · 29 tokens