git-worktree

git-worktree is a skill for Claude Code, Codex from MithunWijayasiri/dotclaude. It costs 70 tokens per session (1,881 once invoked), scanned A, original, MIT.

A Windows PowerShell tool for creating, switching to, and removing Git worktrees. A Git worktree is another working folder for the same repository, and this tool shares dependencies while copying the local environment file.

In plain words
What is it for?
Use it for named worktrees on Windows, especially when switching branches or creating and removing isolated working folders. It also handles a shared Node.js dependency folder and a copied .env file.
Why use it?
It lets developers work on another branch without a fresh dependency installation, while protecting the main dependency folder and secrets file from accidental changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it for named worktrees on Windows, especially when switching branches or creating and removing isolated working folders. It also handles a shared Node.js dependency folder and a copied .env file.

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

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/mithunwijayasiri/dotclaude/git-worktree/github.svg)](https://agentmods.dev/skills/mithunwijayasiri/dotclaude/git-worktree)
Your own site
<a href="https://agentmods.dev/skills/mithunwijayasiri/dotclaude/git-worktree"><img src="https://agentmods.dev/badge/skills/mithunwijayasiri/dotclaude/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/mithunwijayasiri/dotclaude/git-worktree"><img src="https://agentmods.dev/badge/skills/mithunwijayasiri/dotclaude/git-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,881 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00070 $0.01881
Opus 5.5 $0.00028 $0.00752
Sonnet 5.5 $0.00014 $0.00376
Haiku 4.5 $0.00007 $0.00188

Measured 11d ago against content hash 87e1114f39a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-worktree 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 11d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/wt-create.ps1, scripts/wt-remove.ps1), 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.

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-worktree/SKILL.md · 118 lines

How it starts

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

Git Worktree

Windows + PowerShell only. Worktrees live at <repo>/.claude/worktrees/<name>. Add .claude/worktrees/ to the repo's .gitignore — Claude Code doesn't.

Scripts: scripts/wt-create.ps1, scripts/wt-remove.ps1 (PowerShell 5.1+). Run as powershell -NoProfile -File <skill dir>\scripts\<script>.ps1 .... Below, $SKILL = this skill's directory (e.g. $HOME\.claude\skills\git-worktree).

Commands: create (/git-worktree feature-login), switch (/git-worktree switch), remove (/git-worktree remove). Bare /git-worktree → switch.

Hard rules

  • Never npm install / npm ci in a worktree whose node_modules is a junction — mutates main repo's deps. Only the drift path (Create step 3, npm ci option) makes a real node_modules where installing is safe.
  • Never delete a worktree directory while a node_modules junction is live. Unlink first (Remove step 3) — a recursive delete that follows the junction can eat main's node_modules.
  • Removal always user-confirmed. Never automatic, never inferred from "PR raised" or "work done".
  • Copy .env, never link it. A link → worktree edit silently rewrites the real secrets file.

Create

1. Guard. Record MAIN = git rev-parse --show-toplevel first — after entering, cwd is the worktree and this resolves differently.

powershell -NoProfile -File "$SKILL\scripts\wt-create.ps1" -Main "$MAIN"

Exit 1 → already inside .claude/worktrees/; worktrees don't nest. Tell user to /git-worktree remove or exit first.

2. Enter. EnterWorktree(name: "<name>") → creates .claude/worktrees/<name> on a new branch, switches session cwd. Set WT = returned path. Report the branch name from the result.

Base ref = worktree.baseRef setting: fresh (default) branches from origin/<default-branch>, head from current local HEAD. Don't change it. User wants to stack on unpushed local work → worktree.baseRef must be head in settings first; don't flip it silently.

3. node_modules + .env (one script):

Read the full file on GitHub · 118 lines

Files

What ships with it

2 files 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. 11d ago First seen · 118 lines · 70 tokens per session scan A 87e1114f39a9

Subscribe to this mod's changes

git-worktree is a skill published in the GitHub repository MithunWijayasiri/dotclaude (4 stars, last pushed 6d ago), licensed MIT. It adds 70 tokens to every session and 1,881 once invoked, about $0.0003 per session on Opus 5.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-10-09.

Related

Other skills, from other repositories

dockerized-service-release-deployment-workflow

Create a Dockerized-service release contract with clean GitHub Actions builds, main-anchored tags, immutable digest manifests, published-release deployments, production approval, health checks, and exact-digest rollback.

gaelic-ghost/socket · 49 tokens

coordinate-worktrees-and-threads

Assign worktree, branch, write, validation, integration, and cleanup ownership before parallel repository work. Use when a worker will inspect or modify repository state outside the coordinator's worktree.

gaelic-ghost/socket · 44 tokens

opencode-github

This skill covers OpenCode's GitHub integration, enabling you to use OpenCode directly within GitHub issues and pull requests. OpenCode integrates with your GitHub workflow — mention /opencode or /oc in your comment, and OpenCode will execute tasks within your GitHub Actions runner.

Timmy6942025/opencode-builder-skill · 0 tokens

release-prep

Checks that the current branch is ready for a release-please release PR — conventional commit types, version manifest sync, findings-store state, and CI status. Use when preparing or verifying a release, cutting a release PR, or confirming a branch is safe to merge for release.

ivuorinen/skills · 59 tokens

datalad

Retrieves, versions, and publishes scientific datasets with DataLad and git-annex, and captures computational provenance with datalad run, rerun, and containers-run. Use when cloning or fetching data from OpenNeuro, DANDI, datasets.datalad.org, or any DataLad dataset; when a file in a dataset reads as a broken symlink…

K-Dense-AI/scientific-agent-skills · 147 tokens

git-workflow

A guide for handling Git repository work safely, including status checks, branches, commits, pushes, pull requests, and rebasing. Git is a version-control system that records code changes and coordinates work between developers.

laolaoshiren/claude-code-skills-zh · 73 tokens