git-worktrees

git-worktrees is a skill for Claude Code from technicalpickles/pickled-claude-plugins. It costs 78 tokens per session (634 once invoked), scanned A, original, MIT.

A guide for creating and removing Git worktrees. A worktree is a separate working folder connected to the same Git repository, allowing multiple branches to be checked out at once.

In plain words
What is it for?
Use it when creating a worktree, choosing its starting branch, switching with worktrunk, or removing a worktree after its branch merges.
Why use it?
It helps avoid branching from the wrong commit and prevents leftover worktrees after a pull request is merged. It also covers common cleanup and sandbox errors.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the git plugin — 9 skills shipped together

Good fit Use it when creating a worktree, choosing its starting branch, switching with worktrunk, or removing a worktree after its branch merges.

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

Made for: Claude Code.

Or install git, the plugin that ships this one along with the rest of its 9 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 git-worktrees

README.md
[![agentmods](https://agentmods.dev/badge/skills/technicalpickles/pickled-claude-plugins/git-worktrees/github.svg)](https://agentmods.dev/skills/technicalpickles/pickled-claude-plugins/git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/technicalpickles/pickled-claude-plugins/git-worktrees"><img src="https://agentmods.dev/badge/skills/technicalpickles/pickled-claude-plugins/git-worktrees/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 git-worktrees

Your own site · 80×15
<a href="https://agentmods.dev/skills/technicalpickles/pickled-claude-plugins/git-worktrees"><img src="https://agentmods.dev/badge/skills/technicalpickles/pickled-claude-plugins/git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 634 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.00078 $0.00634
Opus 5.5 $0.00031 $0.00254
Sonnet 5.5 $0.00016 $0.00127
Haiku 4.5 $0.00008 $0.00063

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

Security

Grade A, and why

git-worktrees 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 12d 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.

plugins/git/skills/git-worktrees/SKILL.md · 36 lines

How it starts

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

Git worktrees

Use whichever worktree tool the user prefers. If none is stated and wt (worktrunk) is on PATH, lean toward it: it has non-interactive flags and lifecycle hooks the others lack.

Create

Branch from origin/<default>, not local main. When local main is ahead of origin, the first push drags unpushed commits into the PR.

  • git worktree add -b <branch> <path> origin/<default>
  • wt: wt switch --create <branch> --base origin/<default> --yes --no-cd --format=json, then cd to .path. A trailing "has no upstream information" error after creation is harmless; check git worktree list before retrying.
  • EnterWorktree: it already branches from origin/<default>, so check git log origin/main..main for local-only commits first. Its guard rejects &&, $(...) and multi-line commands.

Remove after merge

Once a worktree's PR merges, remove it in the same session without asking, and report it as done. Cleanup is not a step to hand back to the user.

  • Keep it only when the user said they're still using it, or it is the root of a live session (a desktop-app worktree session, this one included), since removing that breaks the session. Say which exception applied.
  • git fetch first. After a squash-merge, stale refs make removal tools think the branch is unmerged.
  • cd out of the worktree before removing it.
  • Never force. Removal refuses a dirty worktree, and that refusal is the safety net. Read what it refused on and report it instead of passing -f or -D.

By tool:

  • git worktree remove <path>, then git branch -d <branch> if the branch isn't needed.
  • wt: wt remove <branch> -y. It keeps an unmerged branch on its own.
  • A worktree this session entered with EnterWorktree: ExitWorktree with the remove action.

Sandbox

Under the command sandbox, Operation not permitted in a worktree is usually the path denylist (.claude/agents/*, .claude/commands/*, .mcp.json, .git/hooks/*, rc files), not the worktree location. If creating one fails that way partway through, the branch may already exist; retry without creating it (wt switch <branch>, or git worktree add <path> <branch>) unsandboxed.

Read the full file on GitHub · 36 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. 12d ago First seen · 36 lines · 78 tokens per session scan A 5c07f121a4d9

Subscribe to this mod's changes

git-worktrees is a skill published in the GitHub repository technicalpickles/pickled-claude-plugins (13 stars, last pushed 8d ago), licensed MIT. It adds 78 tokens to every session and 634 once invoked, about $0.0003 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-11-18.

Related

git-worktrees compared with skills from other repositories

git-worktrees next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-worktreestechnicalpickles/pickled-claude-pluginsSkill138d agoMITA78Claude Code
ecosystem-managingVidyFoo/antigravity-skill-engineSkill132mo agoMITA27Claude Code, Codex
release-prfabiandistler/agentsSkill2todaynoneA47Claude Code, Codex
releaseu9401066/template-is-all-you-needSkill38mo agoApache-2.0A60Claude Code
git-precommitu9401066/template-is-all-you-needSkill38mo agoApache-2.0A92Claude Code
Worktree Managersmith-horn/product-builder-starterSkill118mo agononeA43Claude Code, Codex
commit-messageLion-1209/Lion-SkillsSkill55mo agoMITA15Claude Code