using-git-worktrees

using-git-worktrees is a skill for Claude Code from JeremyDev87/codingbuddy. It costs 38 tokens per session (3,049 once invoked), scanned C, original, MIT.

A guide to Git worktrees, which are separate working folders connected to the same Git repository. They let you work on multiple branches at the same time.

In plain words
What is it for?
Use it for parallel development, feature exploration, plan implementation, code review, and safely creating or removing worktrees.
Why use it?
It avoids repeatedly switching branches or stashing changes when tasks need isolated workspaces.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it for parallel development, feature exploration, plan implementation, code review, and safely creating or removing worktrees.

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

Made for: Claude Code.

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 using-git-worktrees

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/jeremydev87/codingbuddy/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/jeremydev87/codingbuddy/using-git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,049 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.00038 $0.03049
Opus 5.5 $0.00015 $0.01220
Sonnet 5.5 $0.00008 $0.00610
Haiku 4.5 $0.00004 $0.00305

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

Security

Grade C, and why

using-git-worktrees 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 2mo 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.

| **Bad** | `rm -rf .worktrees/my-feature` | Leaves orphaned metadata — breaks `git worktree list` and blocks branch ops |
packages/rules/.ai-rules/skills/using-git-worktrees/SKILL.md · 369 lines

How it starts

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

Using Git Worktrees

Overview

Git worktrees provide isolated working directories sharing a single .git repository. They enable parallel development without stashing, branch-switching conflicts, or duplicate clones.

Core principle: EVERY worktree operation must be verified before and after. Unverified worktrees cause lost work, orphaned branches, and corrupted state.

The Iron Law

NO WORKTREE CREATION WITHOUT SAFETY CHECKS.
NO WORKTREE REMOVAL WITHOUT UNCOMMITTED CHANGE VERIFICATION.

If you skip the safety checks, you will lose work. There are no exceptions.

When to Use

  • Parallel execution: Running multiple tasks simultaneously (taskMaestro waves)
  • Feature isolation: Working on a feature without disrupting main branch state
  • Plan implementation: Creating a dedicated workspace before implementing a plan
  • Exploration: Trying an approach without affecting current work
  • Code review: Checking out a PR branch while keeping your current work intact

Use this ESPECIALLY when:

  • You need to work on multiple issues simultaneously
  • You want to preserve your current branch state while exploring something else
  • A brainstorming session has produced a design ready for implementation
  • You are about to run /taskmaestro wave-transition

Don't skip when:

  • "It's just a quick branch switch" (worktrees prevent accidental stash loss)
  • "I'll remember to clean up later" (stale worktrees accumulate silently)
  • "The repo is small, cloning is fine" (clones don't share history; worktrees do)

Phase 1: Assessment

BEFORE creating any worktree, answer these questions:

1.1 Determine the Purpose

Purpose Directory Convention Branch Convention
Parallel execution (taskMaestro) .taskmaestro/wt-N taskmaestro/<epoch>/pane-N
Tool-managed isolation Tool-specific (e.g., .claude/worktrees/) Auto-managed by the tool
Standalone / manual .worktrees/<descriptive-name> wt/<description> or feat/<issue>-<slug>

Read the full file on GitHub · 369 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. 2mo ago First seen · 369 lines · 38 tokens per session scan C bfc2dcad6aa8

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository JeremyDev87/codingbuddy (30 stars, last pushed 7mo ago), licensed MIT. It adds 38 tokens to every session and 3,049 once invoked, about $0.0002 per session on Opus 5.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.

Related

using-git-worktrees compared with skills from other repositories

using-git-worktrees next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
using-git-worktreesJeremyDev87/codingbuddySkill307mo agoMITC38Claude Code
ring:committing-changesLerianStudio/ringSkill21829d agoApache-2.0A74Claude Code, Cursor
ring:opening-pull-requestsLerianStudio/ringSkill21829d agoApache-2.0A83Claude Code, Cursor
ring:shipping-changesLerianStudio/ringSkill21829d agoApache-2.0A86Claude Code, Cursor
ring:generating-pr-descriptionsLerianStudio/ringSkill21829d agoApache-2.0A61Claude Code, Cursor
ring:generating-release-guidesLerianStudio/ringSkill21829d agoApache-2.0A85Cursor
ring:cleaning-commentsLerianStudio/ringSkill21829d agoApache-2.0A64Claude Code, Cursor