worktree-isolation

worktree-isolation is a skill for Claude Code, Codex from bostonaholic/team. It costs 28 tokens per session (817 once invoked), scanned C, original, MIT.

A method for running coding work in separate Git worktrees, which are independent working folders linked to the same repository. It supports parallel work and projects that span multiple repositories.

In plain words
What is it for?
Use it to isolate parallel feature work, run team workflows, and coordinate changes across frontend, backend, or shared repositories.
Why use it?
It keeps the main working folder clean while separate tasks are developed and reviewed without interfering with one another.

Skill for Claude CodeCodex

Written for Claude Code and Codex: user-invocable in frontmatter, but also agents/openai.yaml present.

Part of the team plugin — 88 skills, 13 agents, 2 hooks shipped together

Good fit Use it to isolate parallel feature work, run team workflows, and coordinate changes across frontend, backend, or shared repositories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bostonaholic/team/worktree-isolation
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 bostonaholic/team --skill worktree-isolation
Clone the repo
git clone --depth 1 https://github.com/bostonaholic/team

Made for: Claude Code, Codex.

Or install team, the plugin that ships this one along with the rest of its 88 skills, 13 agents, 2 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-isolation

README.md
[![agentmods](https://agentmods.dev/badge/skills/bostonaholic/team/worktree-isolation.svg)](https://agentmods.dev/skills/bostonaholic/team/worktree-isolation)
Your own site
<a href="https://agentmods.dev/skills/bostonaholic/team/worktree-isolation"><img src="https://agentmods.dev/badge/skills/bostonaholic/team/worktree-isolation.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 817 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.00028 $0.00817
Opus 5 $0.00014 $0.00409
Sonnet 5 $0.00006 $0.00163
Haiku 4.5 $0.00003 $0.00082

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

Security

Grade C, and why

worktree-isolation 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 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$dir" && echo "swept: $dir"
skills/worktree-isolation/SKILL.md · 81 lines

How it starts

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

Worktree Isolation

Each /team run uses one isolated worktree per affected repo. The router owns isolation. Read references/lifecycle.md before setup or teardown.

Single-repo

Without docs/plans/<id>/4-repos.md, create the home worktree at <repo>/.claude/worktrees/<id> on branch <id> from origin/HEAD.

Multi-repo

With 4-repos.md, create one worktree per listed repo on <id>. Require each absolute repo realpath to be a direct sibling of home; refuse failures. Use:

git -C <repo-path> worktree add .claude/worktrees/<id> -b <id> origin/HEAD

The home worktree alone holds docs/plans/<id>/. Append all paths under ## Worktrees in 4-repos.md.

Reusing an existing worktree

When already in a linked worktree on a non-default branch, reuse it without a new branch or copy. Refuse a linked worktree on the default branch. Use team-worktree for git-dir/common-dir detection.

Why first

WORKTREE is phase 1 of 8, before QUESTION. Create artifacts there so recovery can infer WORKTREE before 1-task.md. Report absolute docs/plans/<id>/ path.

Ship and teardown

Keep worktrees until merge or explicit removal. Prefer the PR-aware skills/pr-cleanup/SKILL.md. The full eight-step manual is in the lifecycle reference. Hard rules: preserve commits; never delete a primary clone; verify each removed path; pull --rebase origin <base>; remote prune origin; verify docs/plans/<id> is untracked before deleting only that topic; run skills/sweeping-local-state/SKILL.md last and skip its reviewer-only section.

After removal, run this residue sweep exactly. It deletes only unregistered directories with no .git and no files outside tmp/, .omc/, or docs/plans/:

root="$(git -C <repo-path> rev-parse --show-toplevel)"
live="$(git -C "$root" worktree list --porcelain | sed -n 's/^worktree //p')"
for dir in "$root"/.claude/worktrees/*; do
  [ -d "$dir" ] || continue
  printf '%s\n' "$live" | grep -qxF "$dir" && continue
  if [ -e "$dir/.git" ]; then
    echo "kept (still a checkout): $dir"; continue
  fi
  extra="$(find "$dir" -type f \
    -not -path "$dir/tmp/*" -not -path "$dir/.omc/*" -not -path "$dir/docs/plans/*")"
  if [ -n "$extra" ]; then
    printf 'kept (holds unexpected files): %s\n%s\n' "$dir" "$extra"
  else
    rm -rf "$dir" && echo "swept: $dir"
  fi
done

Read the full file on GitHub · 81 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 Changed · -174 lines · -12 tokens per session 54b4345b108e
  2. 4d ago First seen · 255 lines · 40 tokens per session scan C 11976bb4b63c

Subscribe to this mod's changes

worktree-isolation is a skill published in the GitHub repository bostonaholic/team (11 stars, last pushed today), licensed MIT. It adds 28 tokens to every session and 817 once invoked, about $0.0001 per session on Opus 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-09-03.