worktree

worktree is a skill for Claude Code from vanducng/skills. It costs 134 tokens per session (6,316 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 — 96 skills, 14 agents shipped together

Good fit Use it to create, inspect, and clean workspaces for parallel feature development.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vanducng/skills/worktree
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.

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 96 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/github.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/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/vanducng/skills/worktree"><img src="https://agentmods.dev/badge/skills/vanducng/skills/worktree.svg" alt="Reviewed on agentmods" width="80" 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,316 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 3
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Tool Misuse · line 37
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.06316
Opus 5.5 $0.00054 $0.02526
Sonnet 5.5 $0.00027 $0.01263
Haiku 4.5 $0.00013 $0.00632

Measured 18d ago against content hash f3902c922618, 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 18d 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 · 306 lines

How it starts

The opening of the file, as written. The whole thing — 306 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).

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 (full checkouts would pollute artifact globs and bloat the umbrella). The script auto-appends /.worktrees/ and .env.worktree to .git/info/exclude when not already ignored, so git status stays clean.

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/. Under paths.layout: feature-first, each worktree's branch resolves its own feature (e.g. feat/PROJ-3316-… → .workbench/features/proj-3316-…/), so parallel worktrees on different tickets land in separate feature folders under the one shared main umbrella. A linked worktree has no local .workbench/.

Hazard: git clean -fdx in the main checkout can delete in-repo worktrees (single -f skips dirs containing .git, double -ff does not). Run clean afterward to tidy stale metadata.

Overrides: --worktree-root <path> flag → WORKTREE_ROOT env → .worktrees default. Older worktrees in sibling worktrees/ or legacy .work/worktrees/ dirs keep working (list/status/remove/clean find them via git); new ones land in .worktrees/.

Read the full file on GitHub · 306 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. 18d ago Changed · +5 lines f3902c922618
  2. 26d ago Changed · +1 lines e155c250627e
  3. 1mo ago Changed · +3 lines 151e4a3d0a41
  4. 1mo ago Changed · +17 lines 4d3f42efcceb
  5. 1mo ago Changed · -4 lines 51ba0d07bdb7
  6. 1mo ago Changed · -133 lines 3a8d02fdc781
  7. 2mo 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 (8 stars, last pushed yesterday), licensed MIT. It adds 134 tokens to every session and 6,316 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-09-04.

Related

worktree compared with skills from other repositories

worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktreevanducng/skillsSkill8yesterdayMITA134Claude Code
commitdenysdovhan/agentsSkill218d agoMITA35Codex
working-in-isolationslowdini/slow-powersSkill21mo agoMITA58Claude Code
dataladK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA147Claude Code
prYeachan-Heo/oh-my-claudecodeSkill41kyesterdayMITA47Claude Code
moai-workflow-worktreemodu-ai/moai-adkSkill1.3k3d agoApache-2.0A41Claude Code
pr-summaryscenario-labs/skillsSkill3.2kyesterdayMITA42Codex