using-git-worktrees

using-git-worktrees is a skill for Claude Code, Codex from wazimmerman/zimster. It costs 20 tokens per session (460 once invoked), scanned A, original, MIT.

A set of rules for isolating Git work, using branches or worktrees. A Git worktree is a separate working folder connected to the same repository, so different tasks can be checked out independently.

In plain words
What is it for?
Use it before making substantial changes, when the current checkout is dirty, or when several tasks need separate branches or folders.
Why use it?
It helps protect unrelated local changes and reduces conflicts when implementing consequential changes, experiments, or parallel tasks.

Skill for Claude CodeCodex

Part of the zimster plugin — 12 skills, 1 command, 4 agents, 1 hook 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/wazimmerman/zimster/using-git-worktrees
Any agent
npx skills add wazimmerman/zimster --skill using-git-worktrees
Clone the repo
git clone --depth 1 https://github.com/wazimmerman/zimster

Made for: Claude Code, Codex.

Or install zimster, the plugin that ships this one along with the rest of its 12 skills, 1 command, 4 agents, 1 hook.

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 using-git-worktrees

README.md
[![agentmods](https://agentmods.dev/badge/skills/wazimmerman/zimster/using-git-worktrees.svg)](https://agentmods.dev/skills/wazimmerman/zimster/using-git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/wazimmerman/zimster/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/wazimmerman/zimster/using-git-worktrees.svg" alt="Measured on agentmods" 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 460 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00020 $0.00460
Opus 5 $0.00010 $0.00230
Sonnet 5 $0.00004 $0.00092
Haiku 4.5 $0.00002 $0.00046

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

Security

Grade A, and why

using-git-worktrees 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 3d 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.

plugins/zimster/skills/using-git-worktrees/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.

Using Git Worktrees

Use isolation for consequential implementation, parallel work, or experiments. A clean dedicated feature branch can be sufficient; a worktree is not ritual.

Detect first

Run read-only commands:

git rev-parse --show-toplevel
git rev-parse --git-dir
git rev-parse --git-common-dir
git branch --show-current
git status --short
git worktree list --porcelain

Interpretation:

  • different git-dir/common-dir: already linked worktree;
  • empty branch: detached HEAD; understand harness controls;
  • dirty tree: preserve unrelated changes;
  • clean dedicated feature branch: usually isolated enough.

Deterministic policy

Context Behavior
Disposable/test repo explicitly intended for direct work Default branch allowed; do not commit unless policy/request says so.
Existing project on default branch Stop before implementation or create a feature branch/worktree unless explicitly authorized.
Existing clean feature branch/worktree Continue there and commit at verified slice boundaries.
Dirty checkout with unrelated changes Create a separate worktree/branch; do not move or overwrite changes.
Parallel implementers Give each an isolated branch/worktree or strictly disjoint ownership; never share one index concurrently.
User says do not commit Isolation may still be used, but leave changes uncommitted and report them.

Location and creation

Respect repository instructions and existing .worktrees/worktrees conventions. Otherwise use a project-local ignored directory that works on the host OS. Avoid hard-coded home paths and shell assumptions. Confirm the location is ignored before creation.

After creation, confirm branch/root, install only required dependencies, run the smallest baseline, and record path/branch/commit policy in the Git-local Zimster run record when durable state is required.

Cleanup

Remove a worktree only after branch outcome is decided and evidence is preserved. Never delete uncommitted work. Harness-managed worktrees may require native handoff controls; report this rather than forcing Git operations.

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. 3d ago First seen · 59 lines · 20 tokens per session scan A 62dd7380dcbb

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository wazimmerman/zimster (2 stars, last pushed 15d ago), licensed MIT. It adds 20 tokens to every session and 460 once invoked, about $0.0001 per session on Opus 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-08-31.

Related

Other skills, from other repositories

treework-manual

Use TreeWork Manual when the user asks for it, or when the Agent judges that organizing ongoing, multi-part work as a persistent Markdown Tree would improve direction, continuity, recovery, or handoff. Adapt the Tree's depth and document detail to the user's needs, domain, and situation rather than a fixed threshold.

Johnny-xuan/TreeWork · 68 tokens

treework

Use TreeWork, a tree-guided development plugin for complex or evolving software projects that need staged alignment, pre-coding technical Specs, declarative project-tree planning, branch-scoped Git worktrees, durable recovery, and protected completion. It teaches the Agent to move through development along the Tree…

Johnny-xuan/TreeWork · 68 tokens

repository-bootstrap

Audit and establish or upgrade the canonical repository governance baseline. Use only when explicitly asked to bootstrap, standardize, or upgrade a repository; do not use for feature development or source-code restructuring.

cz1993/vibe-coding-repository-standard · 41 tokens

repository-hygiene

Perform a read-only evidence-based audit of stale docs, agent files, scripts, generated artifacts, duplicate code, and optional tools. Use only when explicitly asked for cleanup or governance review; do not delete or refactor during the audit.

cz1993/vibe-coding-repository-standard · 52 tokens

safe-change

Trace, implement, test, and independently review one bounded software change. Use for ordinary feature, bug-fix, or refactor work after the repository is bootstrapped; do not use for broad repository cleanup, production operations, or undefined rewrites.

cz1993/vibe-coding-repository-standard · 54 tokens

apex-workflow

Use for configurable, high-rigor app execution across repos. Selects the lightest safe workflow mode from an app profile, creates or uses a slice manifest, and routes product, tracker, code-intelligence, UI/UX, and verification gates without hard-coding one app's rules.

0xCozart/apex-workflow · 63 tokens