git-worktrees

git-worktrees is a skill for Claude Code from itallstartedwithaidea/agent-skills. It costs 21 tokens per session (1,271 once invoked), scanned A, original, MIT.

A Git feature for keeping several branches checked out in separate folders at the same time. Git is a version-control system that records code changes and branches are separate lines of development.

In plain words
What is it for?
It helps develop multiple tasks concurrently, give separate agents isolated workspaces, test a clean checkout, and manage branches through merging and cleanup.
Why use it?
It lets parallel tasks work without repeatedly switching branches or overwriting uncommitted changes. Separate folders also provide clean code copies for testing.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents; mentions Claude Code; built for cline.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/user/project.

Part of the software-dev-skills plugin — 8 skills shipped together , and of all-skills

Good fit It helps develop multiple tasks concurrently, give separate agents isolated workspaces, test a clean checkout, and manage branches through merging and cleanup.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add itallstartedwithaidea/agent-skills
Claude Code
/plugin install software-dev-skills

Made for: Claude Code.

Or install software-dev-skills, the plugin that ships this one along with the rest of its 8 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/itallstartedwithaidea/agent-skills/git-worktrees/github.svg)](https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/git-worktrees"><img src="https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/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/itallstartedwithaidea/agent-skills/git-worktrees"><img src="https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,271 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00021 $0.01271
Opus 5.5 $0.00008 $0.00508
Sonnet 5.5 $0.00004 $0.00254
Haiku 4.5 $0.00002 $0.00127

Measured 1mo ago against content hash 6841177a8e93, 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 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 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

subprocess.run(
skills/software-dev/git-worktrees/SKILL.md · 135 lines

How it starts

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

Git Worktrees

Part of Agent Skills™ by googleadsagent.ai™

Description

Git Worktrees enables parallel development by maintaining multiple checked-out branches simultaneously in separate directories. Instead of stashing changes and switching branches, the agent creates isolated worktrees for each task, providing clean test baselines and eliminating context-switching overhead. Each worktree is a fully independent workspace tied to its own branch.

This skill is essential for subagent-driven development, where multiple agents work on different tasks concurrently. Without worktrees, agents would clobber each other's uncommitted changes. With worktrees, each agent operates in its own directory with its own branch, and the orchestrator merges completed work back into the main line.

Worktrees also provide clean baselines for testing. When you need to verify that tests pass on a clean checkout—without build artifacts, local config, or uncommitted changes—a fresh worktree gives you exactly that. The worktree lifecycle is managed explicitly: create when a task starts, verify when it completes, and prune when it merges.

Use When

  • Multiple tasks must be developed in parallel without interference
  • Subagents need isolated filesystems for concurrent work
  • You need a clean checkout to run tests without local artifacts
  • Hotfix work must happen while a feature branch is in progress
  • Best-of-N implementations need separate workspaces
  • You want to compare behavior across branches side by side

How It Works

graph TD
    A[Main Repo] --> B["git worktree add ../task-1 -b feature/task-1"]
    A --> C["git worktree add ../task-2 -b feature/task-2"]
    A --> D["git worktree add ../hotfix -b hotfix/urgent"]
    B --> E[Agent 1 works in ../task-1]
    C --> F[Agent 2 works in ../task-2]
    D --> G[Agent 3 works in ../hotfix]
    E --> H[PR + Merge]
    F --> H
    G --> H
    H --> I["git worktree remove ../task-1"]
    H --> J["git worktree remove ../task-2"]
    H --> K["git worktree remove ../hotfix"]

Read the full file on GitHub · 135 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 · 135 lines · 21 tokens per session scan A 6841177a8e93

Subscribe to this mod's changes

git-worktrees is a skill published in the GitHub repository itallstartedwithaidea/agent-skills (44 stars, last pushed 6mo ago), licensed MIT. It adds 21 tokens to every session and 1,271 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). 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

skills-update

USE WHEN: updating locked agent skills from skills-lock.json, refreshing upstream skill content, or running npx skills update for project skills. DO NOT USE WHEN: adding new skills (use npx skills add with explicit approval), running bare npx skills update without skill names, or updating project-local skills that are…

louisbrulenaudet/monorepo-template · 72 tokens

changeset

USE WHEN: a change under apps/ or packages/ (or an app runtime dependency bump) needs its release note, the user asks to add, fix, or check a changeset, a PR is about to open, or pnpm release:check fails. DO NOT USE WHEN: editing the release pipeline itself (.changeset/config.json, release.yml, the check scripts) …

louisbrulenaudet/monorepo-template · 87 tokens

git-wrapup

Land working-tree changes as logical commits — the work grouped by concern, topped by a release commit (version bump, changelog, regenerated artifacts). The work commits land first, then the version bump, verification, and the release commit on top. Stops at "committed locally on main" — or, when the project releases…

cyanheads/mcp-ts-core · 109 tokens

release-and-publish

Ship a release end-to-end across every registry the project targets (npm, MCP Registry, GitHub Releases for .mcpb bundles, GHCR). Runs the final verification gate, fast-forwards main when the release rode a release PR, creates the annotated tag on the commit main now points at, pushes commits and tags, then publishes…

cyanheads/mcp-ts-core · 155 tokens

release-pr-review

Review pass on an open release PR (release/ → main) — the step between git-wrapup and release-and-publish when a project releases in gated release PR mode. Reads the PR's commit range through the code-simplifier lens plus a correctness review, verifies whatever an automated reviewer left on the PR, lands fixes as…

cyanheads/mcp-ts-core · 136 tokens

files-mutation

Select and safely apply repository edits, writes, and transactional patches with herdrfsedit, herdrfswrite, and herdrfspatch.

whshang/herdr-mcp · 33 tokens