git-worktree

git-worktree is a skill for Claude Code, Codex from fmind/dot. It costs 20 tokens per session (800 once invoked), scanned A, original, MIT.

A guide for using Git worktrees, which are extra working folders connected to one Git repository. It keeps development or checks separate from another checkout, including selected uncommitted changes.

In plain words
What is it for?
Use it to review a commit in a clean folder, develop on another branch, or validate a dirty working-tree candidate safely. It helps isolate environments, generated files, ports, databases, and caches.
Why use it?
It prevents tests, builds, hooks, and edits from disturbing the source checkout or its staged changes. It also provides a cleanup process and keeps credentials and live resources out of the isolated copy.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review a commit in a clean folder, develop on another branch, or validate a dirty working-tree candidate safely. It helps isolate environments, generated files, ports, databases, and caches.

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

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/fmind/dot/git-worktree/github.svg)](https://agentmods.dev/skills/fmind/dot/git-worktree)
Your own site
<a href="https://agentmods.dev/skills/fmind/dot/git-worktree"><img src="https://agentmods.dev/badge/skills/fmind/dot/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/fmind/dot/git-worktree"><img src="https://agentmods.dev/badge/skills/fmind/dot/git-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 800 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.00020 $0.00800
Opus 5.5 $0.00008 $0.00320
Sonnet 5.5 $0.00004 $0.00160
Haiku 4.5 $0.00002 $0.00080

Measured 11d ago against content hash 99c8c3156ca1, 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.

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 · 47 lines

How it starts

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

Git Worktree

Choose a branch in the current checkout or an isolated workspace according to the task. A branch-only request needs no extra checkout and follows the branches guide; isolation, candidate identity, and cleanup follow the workflow below.

Workflow

  1. Record the source: inspect git status --short, git diff, git diff --cached, git rev-parse HEAD, and git worktree list --porcelain. Identify whether the candidate is a commit, the index, or selected working-tree changes.
  2. Choose isolation: use a linked worktree for a committed revision or new branch. Use the dirty candidate procedure when validation must include uncommitted files, or when checks must not share Git refs or hooks with the source.
  3. Create a fresh destination: choose a new sibling or temporary path outside the source. For a read-only review of committed code, use git worktree add --detach <destination> <revision>; for implementation, use git worktree add -b <new-branch> <destination> <base>.
  4. Inspect execution inputs: read the destination's tasks and hooks before running them; isolate virtual environments, build output, coverage, ports, databases, and caches that tests mutate. Do not copy credentials or reuse a live database to make a fixture pass.
  5. Run the owning gate: invoke the project's commands from the destination. Formatter output changes the tested candidate; compare it with the intended source before transferring proof or applying any resulting edits.
  6. Return only intended changes: review the destination diff, transfer task-owned changes when authorized, and preserve the source index. Commits, pushes, and merges follow the user's requested delivery flow.
  7. Clean up deliberately: inspect destination status and recover useful artifacts first. Use git worktree remove <destination> for an owned clean linked worktree; retain a dirty one until its changes are accounted for. Remove only the recorded disposable clone for a copied candidate.
  8. Report identity: revision, included dirty changes, executed gate, source-versus-tested differences, and any retained workspace.

Read the full file on GitHub · 47 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 Changed 99c8c3156ca1
  2. 12d ago Changed · +8 lines · -2 tokens per session 36bed29ea4d7
  3. 23d ago Changed fd27c5e54415
  4. 29d ago Changed · +1 lines · -12 tokens per session 9cd1ecc96c5d
  5. 1mo ago Changed · +1 tokens per session 3b0468c09c9f
  6. 1mo ago First seen · 38 lines · 33 tokens per session scan A e268afe315b8

Subscribe to this mod's changes

git-worktree is a skill published in the GitHub repository fmind/dot (11 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 800 once invoked, about $0.0001 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-09-10.