worktree

worktree is a skill for Claude Code from WaterplanAI/agentic-config. It costs 39 tokens per session (3,706 once invoked), scanned C, original, MIT.

A Git worktree setup command. A worktree is a separate working directory connected to the same Git repository, allowing another branch to be worked on independently.

In plain words
What is it for?
Use it to create a named worktree and branch, link or copy shared assets, and set up project-specific environments and direnv configuration.
Why use it?
It avoids manually setting up a separate checkout and its project environment when working on parallel branches.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is source: ../../../repo-assets/services/api.

Part of the ac-git plugin — 7 skills shipped together

Good fit Use it to create a named worktree and branch, link or copy shared assets, and set up project-specific environments and direnv configuration.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/WaterplanAI/agentic-config
agentmods
npx agentmods add skills/waterplanai/agentic-config/worktree

Made for: Claude Code.

Or install ac-git, the plugin that ships this one along with the rest of its 7 skills.

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/waterplanai/agentic-config/worktree/github.svg)](https://agentmods.dev/skills/waterplanai/agentic-config/worktree)
Your own site
<a href="https://agentmods.dev/skills/waterplanai/agentic-config/worktree"><img src="https://agentmods.dev/badge/skills/waterplanai/agentic-config/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/waterplanai/agentic-config/worktree"><img src="https://agentmods.dev/badge/skills/waterplanai/agentic-config/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,706 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00039 $0.03706
Opus 5.5 $0.00016 $0.01482
Sonnet 5.5 $0.00008 $0.00741
Haiku 4.5 $0.00004 $0.00371

Measured 19d ago against content hash 1a4678ebc6b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

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 19d 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.

rm -rf "$TARGET"
plugins/ac-git/skills/ac-git/worktree/SKILL.md · 489 lines

How it starts

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

Create New Worktree

Creates a new git worktree with:

  • Shared assets (symlinked or copied)
  • Independent environment per project type
  • Proper .envrc configuration for direnv

Arguments

  • worktree_name (required): Name for the worktree and branch
  • assets_path (optional): Path to external assets directory to symlink from

Cookbook

Setup guide: cookbook/setup.md -- guided walkthrough for creating .worktree.yml (read when no config exists or user requests setup help)

Parallelization

CRITICAL: Use Task tool with model: haiku for parallel execution when:

  • Setting up assets in multiple directories
  • Installing dependencies in multiple environments
  • Any operation that can run independently

Spawn separate haiku agents for each independent task to maximize parallelization.

Example - parallel environment setup:

Task(model: haiku, prompt: "Setup Python venv in /path/to/backend")
Task(model: haiku, prompt: "Run npm install in /path/to/frontend")
Task(model: haiku, prompt: "Create symlinks for assets in /path/to/data")

Send all independent Task calls in a SINGLE message to run them concurrently.

Pre-Flight Checks

  1. Verify git repo root:

    git rev-parse --show-toplevel
    
  2. Validate worktree name:

    • Must be provided
    • No spaces or special chars (except - and _)
  3. Check for existing worktree/branch:

    • If worktree exists: STOP and report
    • If branch exists: Ask user to confirm reuse
  4. Check for .worktree.yml:

    REPO_ROOT=$(git rev-parse --show-toplevel)
    find "$REPO_ROOT" -maxdepth 1 -name ".worktree.yml" -type f | head -1
    
    • If .worktree.yml exists: continue to Asset Discovery (Step 4) normally
    • If .worktree.yml does NOT exist: prompt the user via AskUserQuestion:

      No .worktree.yml found in your project. This file configures how worktrees set up assets (symlinks, copies) and environments. Without it, the skill infers configuration from directory structure and .gitignore.

      Would you like to create a .worktree.yml now? I can guide you through the setup. (You can skip this and the skill will use inference instead.)

    • If user says yes: read cookbook/setup.md and follow the guided creation flow. After creating the config, continue to Step 4 (Asset Discovery) using the new config.
    • If user says no or skips: continue to Step 4 (Asset Discovery) with inference mode.

Read the full file on GitHub · 489 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. 19d ago First seen · 489 lines · 39 tokens per session scan C 1a4678ebc6b3

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository WaterplanAI/agentic-config (31 stars, last pushed 20d ago), licensed MIT. It adds 39 tokens to every session and 3,706 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-11-12.

Related

worktree compared with skills from other repositories

worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktreeWaterplanAI/agentic-configSkill3120d agoMITC39Claude Code
generate-release-noteshuytieu/COG-second-brainSkill1.6k1mo agoMITA27Claude Code
share-a-libraryMoizIbnYousaf/Ai-Agent-SkillsSkill1.2k2mo agoMITA41Claude Code, Codex
git-flow-prsoulcodex/agenticSkill1011d agoMITA103Claude Code, Codex
new-gh-issue-orchestrationsoulcodex/agenticSkill1011d agoMITA54Claude Code, Codex
git-worktree-workspacessoulcodex/agenticSkill1011d agoMITA58Claude Code, Codex
llm-gaterohitg00/pro-workflowSkill3.0k2mo agononeA38Claude Code