git-worktree

git-worktree is a skill for Claude Code, Codex from marcusrbrown/systematic. It costs 36 tokens per session (1,000 once invoked), scanned C, a copy of git-worktree, MIT.

A manager for Git worktrees, which are separate working folders connected to the same repository. They let developers work on multiple branches at the same time without repeatedly switching one folder.

In plain words
What is it for?
Use it to create, list, switch between, or clean up worktrees for parallel development or isolated reviews. It also applies repository-specific setup and safety checks.
Why use it?
It handles setup details that are easy to miss when creating worktrees manually, such as copying environment files and managing development-tool permissions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions AGENTS.md.

Good fit Use it to create, list, switch between, or clean up worktrees for parallel development or isolated reviews. It also applies repository-specific setup and safety checks.

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

Made for: Claude Code, Codex.

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/marcusrbrown/systematic/git-worktree/github.svg)](https://agentmods.dev/skills/marcusrbrown/systematic/git-worktree)
Your own site
<a href="https://agentmods.dev/skills/marcusrbrown/systematic/git-worktree"><img src="https://agentmods.dev/badge/skills/marcusrbrown/systematic/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/marcusrbrown/systematic/git-worktree"><img src="https://agentmods.dev/badge/skills/marcusrbrown/systematic/git-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,000 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 77% copy Near-identical to another mod 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.00036 $0.01000
Opus 5.5 $0.00014 $0.00400
Sonnet 5.5 $0.00007 $0.00200
Haiku 4.5 $0.00004 $0.00100

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

Security

Grade C, and why

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

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/worktree-manager.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

On exit 3, report the error and ask. Never retry with `--force`, `rm -rf`, another path or another name.
Origin

This is a copy

77% identical to git-worktree — 312 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/git-worktree/SKILL.md · 59 lines

How it starts

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

Git Worktree Manager

scripts/worktree-manager.sh creates, lists, switches and cleans up worktrees. Every worktree lands at .worktrees/<branch> under the main repository root, from any subdirectory or from inside another worktree. Nested names work: feat/x lands at .worktrees/feat/x.

Rules

  • A named location or tool wins. If the user, a project instruction, or another loaded skill or config names a different location or tool, follow it and skip the script. Read the repo's AGENTS.md and any other project instruction file for one before you create.
  • Otherwise never use raw git worktree add, a sibling directory, /tmp, or a path inside another worktree.
  • Refused layout. Exit 3 unsupported-layout means a bare repository, core.bare, a separate git directory or a submodule. Report it and ask for a location or tool. Run raw git worktree add only with the user's approval.
  • Skip worktrees for small or read-only work. Fix a typo in place. Read a file from another branch with git show <branch>:<path>.

Commands

SKILL_DIR="<skill directory stated when this skill loads>";
bash "$SKILL_DIR/scripts/worktree-manager.sh" <command>

A worktree's name is its path under .worktrees/, for example feat/x. Run help for the full usage.

Command Effect
create <branch> [--base <ref>] New branch from origin/<default branch>, fetched first. Prints branch=, base= and, last, path=.
list One line per worktree.
switch <name> Prints the path and nothing else.
copy-env [<name>] Copies git-ignored .env* files; never overwrites.
cleanup Report only.
cleanup --remove <name>... Removes the named clean worktrees.

Exit codes: 0 ok, 1 error, 2 usage, 3 refused. Errors print error: <code>: <message> on stderr. The script never reads stdin.

On exit 3, report the error and ask. Never retry with --force, rm -rf, another path or another name.

  • base-unresolved: ask the user which base to use with --base. Never assume main.
  • branch-exists, target-exists: report it, with the printed path, and ask. Never delete the directory.

Read the full file on GitHub · 59 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 Changed · -276 lines · -3 tokens per session scan A → C d9145a28c1ef
  2. 3mo ago First seen · 335 lines · 39 tokens per session scan A b69e548eada2

Subscribe to this mod's changes

git-worktree is a skill published in the GitHub repository marcusrbrown/systematic (33 stars, last pushed today), licensed MIT. It adds 36 tokens to every session and 1,000 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). It is 77% identical to git-worktree, differing in 312 lines, and is treated as a copy.

Related

git-worktree compared with skills from other repositories

git-worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-worktreemarcusrbrown/systematicSkill33todayMITC36Claude Code, Codex
archify-prtt-a1i/archifySkill103k2d agoApache-2.0A98Claude Code, Codex
prYeachan-Heo/oh-my-claudecodeSkill41ktodayMITA47Claude Code
worktreesalvinunreal/oh-my-opencode-slimSkill10ktodayMITA23Claude Code, Codex
flow-next-landgmickel/flow-nextSkill7372d agoMITA35Claude Code, Codex
flow-next-worktree-kitgmickel/flow-nextSkill7372d agoMITA43Claude Code, Codex
gitcode-yeongyu/oh-my-openagentSkill71ktodaynoneA109Codex