git-worktree

git-worktree is a skill for Claude Code, Codex from wan-huiyan/agent-traffic-control. It costs 74 tokens per session (3,090 once invoked), scanned B, original, MIT.

A skill for managing Git worktrees, which are separate checkouts of the same Git repository that can hold different branches at once.

In plain words
What is it for?
It is for creating, listing, switching between, and cleaning up worktrees, with support for copying .env files and handling related development-tool settings.
Why use it?
It keeps parallel development and code reviews isolated, reducing the chance that unfinished changes interfere with one another.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the agent-traffic-control plugin — 58 skills 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/wan-huiyan/agent-traffic-control/git-worktree
Any agent
npx skills add wan-huiyan/agent-traffic-control --skill git-worktree
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code, Codex.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 58 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-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-worktree.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-worktree)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-worktree"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,090 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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 $0.00074 $0.03090
Opus 5 $0.00037 $0.01545
Sonnet 5 $0.00015 $0.00618
Haiku 4.5 $0.00007 $0.00309

Measured 4d ago against content hash 7069215b811e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

git-worktree scanned grade B 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

[ -f "$WTM" ] || WTM="$(find -L "$HOME/.claude/plugins/cache" -mindepth 7 -maxdepth 7 \
plugins/agent-traffic-control/skills/git-worktree/SKILL.md · 364 lines

How it starts

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

Git Worktree Manager

This skill provides a unified interface for managing Git worktrees across your development workflow. Whether you're reviewing PRs in isolation or working on features in parallel, this skill handles all the complexity.

What This Skill Does

  • Create worktrees from main branch with clear branch names
  • List worktrees with current status
  • Switch between worktrees for parallel work
  • Clean up completed worktrees automatically
  • Interactive confirmations at each step
  • Automatic .gitignore management for worktree directory
  • Automatic .env file copying from main repo to new worktrees
  • Automatic dev tool trusting for mise and direnv configs with review-safe guardrails

Resolve the manager script first (once per shell)

Every command below runs "$WTM". Resolve it once:

# Three roots, in order. A plugin install creates NEITHER of the first two:
# CLAUDE_PLUGIN_ROOT is frequently unset in the shell a step actually runs in, and
# ~/.claude/skills/agent-traffic-control/ does not exist — the plugin lives under
# ~/.claude/plugins/cache/<marketplace>/agent-traffic-control/<version>/.
REL="skills/git-worktree/scripts/worktree-manager.sh"
WTM="${CLAUDE_PLUGIN_ROOT:+${CLAUDE_PLUGIN_ROOT}/$REL}"
[ -f "$WTM" ] || WTM="$HOME/.claude/skills/agent-traffic-control/$REL"
# Rank on the VERSION segment, not the whole path: the marketplace name precedes the
# version, so a plain `sort -V` over full paths would let aaa-mkt/2.5.0 lose to
# zzz-mkt/1.0.0. Here the version sits at NF-4 because the script nests two levels
# deeper than a flat plugin layout. Use `find`, not a glob — zsh fails a non-matching
# glob at expansion time, before 2>/dev/null can apply.
[ -f "$WTM" ] || WTM="$(find -L "$HOME/.claude/plugins/cache" -mindepth 7 -maxdepth 7 \
    -path "*/agent-traffic-control/*/$REL" 2>/dev/null \
  | awk -F/ '{print $(NF-4)"\t"$0}' | sort -V -k1,1 | tail -1 | cut -f2-)"

if [ ! -f "$WTM" ]; then
  echo "worktree-manager.sh: not found — tried \$CLAUDE_PLUGIN_ROOT/$REL," \
       "\$HOME/.claude/skills/agent-traffic-control/$REL, and" \
       "\$HOME/.claude/plugins/cache/*/agent-traffic-control/*/$REL"
fi

Read the full file on GitHub · 364 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. 4d ago First seen · 364 lines · 74 tokens per session scan B 7069215b811e

Subscribe to this mod's changes

git-worktree is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed 17d ago), licensed MIT. It adds 74 tokens to every session and 3,090 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

bridge

Join a shared per-project chat between AI coding agents (Claude Code, Cursor, …) — group channels + DMs — and receive messages from other instances using whatever your agent supports (push, loop, or poll). Use when coordinating multiple agent instances on the same project.

msanchezdev/agent-bridge · 57 tokens

codex-coplan

Bring in an external model (Codex) to co-develop a plan — both models draft independently, align on disagreements, and merge into one plan. Load this only when the user explicitly names Codex (e.g. "let's discuss this with Codex," "what does Codex think about this approach") — don't auto-trigger just because a plan…

jiayx01/codex-claude-skills · 92 tokens

loop-implement

Close a single implementation task with a methodology-grounded verification loop — define done, analyze, plan, write tests first (Red), implement (Green), run, self-review, get an independent test-quality audit, then judge against done; on failure reflect and retry (bounded). Use for one non-trivial task (feature…

choiyounggi/loop-orchestrator · 88 tokens

codex-orchestrator

Delegate execution tasks to Codex (Claude plans and reviews). Load this only when the user names Codex explicitly — no matter how big the task is, if the user hasn't mentioned Codex, do it yourself.

jiayx01/codex-claude-skills · 49 tokens

orchestrate

Orchestrate one natural-language goal into parallel tmux Claude Code sessions — clarify requirements, branch by environment, decompose into tasks (with approval), launch a session per task running loop-implement, review and integration-test, then merge after your confirmation. Use when asked to build/implement a goal…

choiyounggi/loop-orchestrator · 89 tokens

good-bad-ugly

Use when the user asks to "orchestrate", "conduct", invoke "good bad ugly" / "gbu", or tackle a large multi-part coding task (audits, refactor sweeps, multi-feature sessions, "clean this up and fix everything") — anything too big for one linear pass. Runs the tiered orchestration workflow: The Good (brain) plans and…

XyndoX/good-bad-ugly · 131 tokens