using-git-worktrees

using-git-worktrees is a skill for Claude Code, Codex from saajunaid/caddis-plugin. It costs 34 tokens per session (1,531 once invoked), scanned C, a copy of using-git-worktrees, MIT.

A workflow for creating separate Git worktrees, which are additional working folders connected to the same repository. It helps keep feature work isolated from the current folder.

In plain words
What is it for?
Use it before starting isolated feature work or following an implementation plan that should not modify the current workspace.
Why use it?
It prevents unfinished changes in one task from interfering with another and includes checks for choosing and preparing the worktree safely.

Skill for Claude CodeCodex

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

Good fit Use it before starting isolated feature work or following an implementation plan that should not modify the current workspace.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/using-git-worktrees/github.svg)](https://agentmods.dev/skills/saajunaid/caddis-plugin/using-git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/using-git-worktrees/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 using-git-worktrees

Your own site · 80×15
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/using-git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,531 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 83% 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.00034 $0.01531
Opus 5.5 $0.00014 $0.00612
Sonnet 5.5 $0.00007 $0.00306
Haiku 4.5 $0.00003 $0.00153

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

Security

Grade C, and why

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

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

Do not delete a worktree folder by hand or with `rm -rf`: on Windows it can follow a junction into
Origin

This is a copy

83% identical to using-git-worktrees — 243 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.

.github/skills/devops/using-git-worktrees/SKILL.md · 125 lines

How it starts

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

Using Git Worktrees

A worktree gives one branch its own folder. It shares the repository with the main checkout.

Branch in place by default. Run git switch -c <branch>. Never create a sibling repository folder. Use a worktree only when the checkout is not safe to move.

Announce at start: "I am using the using-git-worktrees skill to set up an isolated workspace."

When to use a worktree

Use a worktree when any of these is true:

  1. The repo AGENTS.md says Shared checkout: yes (a dev service serves from it) and your change touches served code. A change to .caddis/ or docs/ only may use a branch.
  2. Another session or agent may be live in the checkout, or you cannot tell. Codex and agy cannot detect peers. For them, "cannot tell" means not safe.
  3. git status shows changes you did not make. Never stash, commit, reset or carry them.
  4. Two or more agents edit at the same time. Each editing agent gets its own worktree. The orchestrator creates and removes them. Read-only subagents share the checkout and never move HEAD.

If none is true, stop here and use git switch -c.

Create the worktree

  1. Fetch: git fetch origin.
  2. Find the default branch (main in most repos): git symbolic-ref --short refs/remotes/origin/HEAD. It prints origin/main. Use the part after origin/ as <default>.
  3. Create the worktree from origin/<default>, never from the local HEAD, at <worktree root>\<repo>\<short-name>. Never under %TEMP%: Windows cleanup (Storage Sense) can empty it and delete a worktree that holds unmerged work. The worktree root is $env:CADDIS_WORKTREE_ROOT when set, else the .worktrees folder beside the main checkout (for E:\Projects\<repo> that is E:\Projects\.worktrees\<repo>\<short-name>). <repo> is the main checkout's folder name. The caddis script caddis_worktree_root.py prints the path; use it so the rule lives in one place:
$wt = python "<caddis scripts>\caddis_worktree_root.py" <short-name> --record --purpose "<why>"   # run in the repo; prints the path
git worktree add -b <branch> $wt origin/<default>

Read the full file on GitHub · 125 lines

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. 24d ago Changed · +17 lines 41c324bc16c6
  2. 1mo ago Changed · +13 lines 855ae0d69c38
  3. 1mo ago Changed · -123 lines scan A → C 67f7ee806bd5
  4. 2mo ago Changed · -1 tokens per session 7e47ca2e33ce
  5. 2mo ago First seen · 218 lines · 35 tokens per session scan A 796e6376ba29

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed 3d ago), licensed MIT. It adds 34 tokens to every session and 1,531 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 83% identical to using-git-worktrees, differing in 243 lines, and is treated as a copy.

Related

using-git-worktrees compared with skills from other repositories

using-git-worktrees next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
using-git-worktreessaajunaid/caddis-pluginSkill03d agoMITC34Claude Code, Codex
commitcongchuanling-dot/CohortSkill1803mo agoMITA59Claude Code
agent-release-swarmruvnet/rufloSkill83ktodayMITA19Claude Code
github-automationruvnet/rufloSkill83ktodayMITA61Claude Code
upgrading-core-dependenciesJetBrains/thinkrailSkill8.5kyesterdayApache-2.0A59Claude Code, Codex
reviewing-a-prJetBrains/thinkrailSkill8.5kyesterdayApache-2.0A56Claude Code, Codex
release-cutBlackBeltTechnology/pi-agent-dashboardSkill357todayMITA93Claude Code, Codex