git-worktree

git-worktree is a skill for Claude Code from siva01c/claude-plugins. It costs 132 tokens per session (1,297 once invoked), scanned A, original, MIT.

Instructions for using Git worktrees, which let multiple independent working folders share one Git repository.

In plain words
What is it for?
Use it for parallel features, isolated bug fixes, experiments, or running tests on one branch while editing another.
Why use it?
Separate folders let agents or developers work on different branches at the same time without overwriting each other's changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is git worktree add ../hotfix -b hotfix origin/main.

Part of the git-tools plugin — 1 skill shipped together

Good fit Use it for parallel features, isolated bug fixes, experiments, or running tests on one branch while editing another.

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/siva01c/claude-plugins
agentmods
npx agentmods add skills/siva01c/claude-plugins/git-worktree

Made for: Claude Code.

Or install git-tools, the plugin that ships this one along with the rest of its 1 skill.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/siva01c/claude-plugins/git-worktree"><img src="https://agentmods.dev/badge/skills/siva01c/claude-plugins/git-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 132 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,297 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.00132 $0.01297
Opus 5.5 $0.00053 $0.00519
Sonnet 5.5 $0.00026 $0.00259
Haiku 4.5 $0.00013 $0.00130

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

Security

Grade A, and why

git-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 1mo 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.

git-tools/skills/git-worktree/SKILL.md · 177 lines

How it starts

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

Git Worktree Skill

Git worktrees let you check out multiple branches of the same repository into separate directories simultaneously. Each directory is a fully independent working tree — its own HEAD, index, and files — but all share the same .git history and objects, so they stay lightweight.

Use this skill to give each agent or parallel task its own isolated workspace.


When to reach for worktrees

  • Two or more agents might edit the same files simultaneously
  • A task should not disturb the current branch's working state
  • You need a throwaway sandbox that can be discarded cleanly if things go wrong
  • The user asks to work on multiple features or fixes in parallel
  • You want to run tests on one branch while editing another

Core commands

Create a worktree

# New branch from current HEAD
git worktree add ../my-task -b my-task-branch

# From a specific commit or existing branch
git worktree add ../hotfix -b hotfix origin/main

# Detached HEAD (no branch)
git worktree add --detach ../scratch HEAD

# Empty worktree on an unborn branch (blank slate)
git worktree add --orphan ../experiment -b experiment

The new directory is ready to use immediately. cd into it and work normally.

List all worktrees

git worktree list
# /path/to/main        abc1234 [main]
# /path/to/my-task     def5678 [my-task-branch]

Remove a worktree when done

# Clean remove (fails if the worktree has uncommitted changes)
git worktree remove ../my-task

# Force remove (discard dirty worktree)
git worktree remove --force ../my-task

# If you deleted the directory manually, clean up the metadata
git worktree prune

Move a worktree

git worktree move ../my-task ../new-location

Lock / unlock (for portable drives or network shares)

git worktree lock ../my-task --reason "on external drive"
git worktree unlock ../my-task

Repair after a manual move

# Run inside the moved worktree
git worktree repair

# Or from main, pointing at each moved worktree
git worktree repair ../new-location-1 ../new-location-2

Read the full file on GitHub · 177 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. 1mo ago First seen · 177 lines · 132 tokens per session scan A 2d2cc75e0ee6

Subscribe to this mod's changes

git-worktree is a skill published in the GitHub repository siva01c/claude-plugins (16 stars, last pushed 22d ago), licensed MIT. It adds 132 tokens to every session and 1,297 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-08-30.

Related

Other skills, from other repositories

openspec-archive-change

Archive a completed OpenSpec change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete. Also use when the user says "openspec archive" or "opsx archive".

jim60105/copilot-prompt · 50 tokens

bump-version

Automate version bumping following semantic versioning and changelog management. Use when the user wants to bump a version, create a release, update the changelog, or tag a new version in a project using semver conventions and Keep a Changelog format.

jim60105/copilot-prompt · 56 tokens

commit

Create a git commit with clear, conventional commit messages. You MUST read this when the user wants to commit staged changes, write a commit message, or finalize code changes with proper conventional commit format since it describes how to follow the user's specific requirements.

jim60105/copilot-prompt · 51 tokens

app-release

Automates the release process for Skill Lake app, including version bumping, building, packaging, and publishing to GitHub and Homebrew.

emlog/skill-lake · 31 tokens

changelog-generator

Convierte un git log, lista de commits o notas de lanzamiento en un changelog pulido orientado al usuario. Usa cuando estés escribiendo notas de versión, generando una entrada en CHANGELOG.md o documentando qué cambió en una versión. Produce una sección de changelog estructurada con encabezado de versión, cambios…

mohitagw15856/pm-claude-skills · 96 tokens

pr-description-writer

Redacta una descripción de pull request clara y estructurada a partir de un diff de git, resumen de rama o lista de commits. Úsalo cuando te pidan escribir una descripción de PR, redactar una solicitud de cambios o documentar cambios de código. Produce una descripción con resumen, motivación, cambios realizados, pasos…

mohitagw15856/pm-claude-skills · 80 tokens