git-worktrees

git-worktrees is a skill for Claude Code from bostonaholic/rpikit. It costs 37 tokens per session (1,935 once invoked), scanned A, original, MIT.

A Git worktree guide for creating separate folders connected to one Git repository, so different branches can be worked on at the same time.

In plain words
What is it for?
Use it when starting isolated feature work, testing changes separately, reviewing pull requests, or running long tasks alongside other work.
Why use it?
It keeps parallel or experimental changes isolated from the current workspace and avoids repeated stashing or branch switching.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md.

Part of the rpikit plugin — 16 skills, 7 agents shipped together

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.

agentmods
npx agentmods add skills/bostonaholic/rpikit/git-worktrees
Any agent
npx skills add bostonaholic/rpikit --skill git-worktrees
Clone the repo
git clone --depth 1 https://github.com/bostonaholic/rpikit

Made for: Claude Code.

Or install rpikit, the plugin that ships this one along with the rest of its 16 skills, 7 agents.

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/bostonaholic/rpikit/git-worktrees.svg)](https://agentmods.dev/skills/bostonaholic/rpikit/git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/bostonaholic/rpikit/git-worktrees"><img src="https://agentmods.dev/badge/skills/bostonaholic/rpikit/git-worktrees.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,935 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00037 $0.01935
Opus 5 $0.00018 $0.00967
Sonnet 5 $0.00007 $0.00387
Haiku 4.5 $0.00004 $0.00194

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

skills/git-worktrees/SKILL.md · 362 lines

How it starts

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

Git Worktrees

Create isolated workspaces for parallel development without disrupting current work.

Purpose

Git worktrees allow multiple branches to be checked out simultaneously in separate directories. This enables parallel work without stashing, context switching, or polluting the main workspace. This skill provides structured worktree creation with safety verification.

Integration

Called by

  • implementing-plans - Offers worktree isolation before implementation
  • User directly via /rpikit:git-worktrees

Pairs with

  • finishing-work - Handles worktree cleanup after implementation
  • writing-plans - Plans may specify worktree isolation for high-stakes changes

When to Use

Use worktrees when:

  • Starting feature work that shouldn't affect main workspace
  • Working on multiple features in parallel
  • Testing changes in isolation
  • Running long processes while continuing other work
  • Reviewing PRs without disrupting current work

Skip worktrees when:

  • Quick single-file fixes
  • Changes that don't need isolation
  • The main workspace is already clean

Directory Selection Priority

When creating worktrees, check these locations in order:

1. Check for Existing Worktree Directory

Look for:
- .worktrees/ (hidden, preferred)
- worktrees/ (visible)

If both exist, prefer .worktrees/

2. Check Project Configuration

Look in CLAUDE.md or project documentation for:
- Stated worktree location preference
- Project-specific conventions

3. Ask the User

If no preference found:

"Where should worktrees be created?"
- .worktrees/ (project-local, recommended, must be in .gitignore)
- worktrees/ (project-local, visible, must be in .gitignore)
- External location (e.g., ~/worktrees/project-name/)

Safety Verification

Critical for project-local worktrees:

Before creating a worktree in .worktrees/ or worktrees/, verify the specific directory you're using is ignored:

# For .worktrees/ (check returns 0 if ignored)
git check-ignore -q .worktrees

# For worktrees/ (check returns 0 if ignored)
git check-ignore -q worktrees

Read the full file on GitHub · 362 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. 6d ago First seen · 362 lines · 37 tokens per session scan A 9b4ce300d475

Subscribe to this mod's changes

git-worktrees is a skill published in the GitHub repository bostonaholic/rpikit (20 stars, last pushed 6d ago), licensed MIT. It adds 37 tokens to every session and 1,935 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

implement

Drive a single workshop ticket through the inner SWE↔Tester loop. Resolves the ticket from implementyourself/tasks/, creates an implementing/from-scratch branch (a fixed default — not derived from the ticket; subsequent tickets stack on top), launches the software-engineer agent to implement it, then routes by…

Arindam200/awesome-ai-apps · 197 tokens

fanout

Run independent subtasks in parallel — one git worktree and one implementation sub-agent per task, each opening its own PR — then cross-review every PR. polly never merges; the human does.

omnigent-ai/omnigent · 43 tokens

changelog

Turn a range of commits or merged PRs into a changelog entry grouped by change type. Use when the user asks for release notes, a changelog, or "what changed" between two points.

omnigent-ai/omnigent · 44 tokens

pod-init

Initialize CocoPlus project bundle in the current directory. Creates .cocoplus/ directory structure, copies all templates, initializes AGENTS.md, project.md, flow.json, and creates the initial git commit. Run this once per project before using any other CocoPlus command.

Snowflake-Labs/cocoplus · 57 tokens

ship

Enter the Ship phase of CocoBrew. Reads review.md approval, generates structured commit, creates semantic version tag, optionally creates PR via gh CLI, and records deployment details. Requires approved review.

Snowflake-Labs/cocoplus · 41 tokens

lean-review

CocoLean diff-scoped over-engineering audit — scans uncommitted git diff and applies five classification tags (delete/stdlib/native/yagni/shrink) to identify unnecessary surface area before commit.

Snowflake-Labs/cocoplus · 44 tokens