worktree

worktree is a skill for Claude Code, Codex from byerlikaya/claude-starter-kit. It costs 56 tokens per session (813 once invoked), scanned A, original, MIT.

A Git worktree creates a separate working copy of a repository on its own branch, so another task can change files without touching the main copy.

In plain words
What is it for?
It is for isolated experiments, parallel file edits, and changes that may later be discarded safely.
Why use it?
It protects uncommitted work from risky experiments or parallel agents that might otherwise overwrite files.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions Claude Code.

Good fit It is for isolated experiments, parallel file edits, and changes that may later be discarded safely.

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

Made for: Claude Code, Codex.

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/byerlikaya/claude-starter-kit/worktree/github.svg)](https://agentmods.dev/skills/byerlikaya/claude-starter-kit/worktree)
Your own site
<a href="https://agentmods.dev/skills/byerlikaya/claude-starter-kit/worktree"><img src="https://agentmods.dev/badge/skills/byerlikaya/claude-starter-kit/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/byerlikaya/claude-starter-kit/worktree"><img src="https://agentmods.dev/badge/skills/byerlikaya/claude-starter-kit/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 813 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.00056 $0.00813
Opus 5 $0.00028 $0.00407
Sonnet 5 $0.00011 $0.00163
Haiku 4.5 $0.00006 $0.00081

Measured 9d ago against content hash c03a44fb8264, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 9d 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.

claude-starter/skills/worktree/SKILL.md · 43 lines

How it starts

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

Worktree Isolation

Trigger phrases: "worktree", "git worktree", "isolate the changes", "sandbox this work", "parallel file edits"

One rule: never let risky or parallel work run on top of uncommitted changes in the shared tree. A git worktree gives a second working copy of the same repo on its own branch — you experiment or fan out agents there, and the main tree (with your in-progress edits) is physically untouched. Throw the worktree away and nothing you cared about is lost.

Kit adaptation (local, .claude/): this exists because verification/fan-out subagents have discarded a session's uncommitted work by running a destructive git command over the shared tree. Those commands (reset --hard, clean -f, checkout -- ., restore) are §4.5-gated — but the real fix is to not put them near unsaved work. The Agent tool's isolation: "worktree" does this automatically for parallel mutating agents; reach for it there.

When to isolate

  • Fan-out that writes files — two+ agents editing the same repo in parallel would collide; give each its own worktree.
  • A throwaway experiment — you might keep it or bin it; a worktree makes "bin it" a one-liner, not a reset --hard.
  • A dirty tree you can't commit yet — you have unsaved work but need to try something risky; isolate rather than stash-and-pray.
  • Skip it for a single, in-place edit on a clean tree — a worktree is overhead there.

How

  1. Detect — are you already in a worktree? [ "$(git rev-parse --git-dir)" != "$(git rev-parse --git-common-dir)" ] is true inside one; don't nest.
  2. Creategit worktree add ../wt-<name> -b <branch> (new branch) or git worktree add ../wt-<name> <existing>. It shares the object store, so it's cheap.
  3. Work there — cd into it; edits, builds, and agent runs stay local to that copy.
  4. Fold back or discard — keep: commit on its branch, then merge. Discard: git worktree remove ../wt-<name> (add --force only if you mean to drop its changes).
  5. Clean upgit worktree prune removes stale entries. Never leave orphaned worktrees around.

Read the full file on GitHub · 43 lines

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. 9d ago First seen · 43 lines · 56 tokens per session scan A c03a44fb8264

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository byerlikaya/claude-starter-kit (22 stars, last pushed today), licensed MIT. It adds 56 tokens to every session and 813 once invoked, about $0.0003 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-03.

Related

Other skills, from other repositories

security-pipeline

Use when security verification is needed - pre-commit security checks, vulnerability scanning, STRIDE threat analysis. Integrates with /handoff-verify --security and /commit-push-pr. CWE Top 25 based.

sangrokjung/claude-forge · 48 tokens

caveman-commit

Ultra-compressed commit message generator. Cuts noise from commit messages while preserving intent and reasoning. Conventional Commits format. Subject ≤50 chars, body only when "why" isn't obvious. Use when user says "write a commit", "commit message", "generate commit", "/commit", or invokes /caveman-commit.…

stevesolun/ctx · 79 tokens

repo-stats-autoupdate

Keeps README badge + inline counts in sync with the real number of skills, agents, graph nodes/edges, communities, converted pipelines, and test inventory. Runs automatically on every commit via a git pre-commit hook. Use when the README drifts from reality or before publishing a release.

stevesolun/ctx · 66 tokens

no-mistakes

Validate committed feature-branch changes through the no-mistakes pipeline: intent, rebase, review, test, docs, lint, push, PR, and CI. Use when the user asks to run no-mistakes, ship safely, validate before pushing, or gate a change before it reaches upstream.

stevesolun/ctx · 67 tokens

core-workflow

Detailed development workflow patterns, checklists, and standards. Auto-loads for complex tasks, planning, debugging, testing, or when explicit patterns are needed. Contains session protocols, git conventions, security checklists, testing strategy, and communication standards.

travisjneuman/.claude · 53 tokens

auto-claude

Autonomous multi-agent coding with git worktree isolation, QA validation, and memory. Use for complex features requiring autonomous implementation.

travisjneuman/.claude · 30 tokens