using-git-worktrees

using-git-worktrees is a skill for Claude Code, Codex from andreaswasita/copilot-agents-dojo. It costs 20 tokens per session (1,097 once invoked), scanned A, original, MIT.

A Git workflow that gives each substantial coding task its own worktree, which is a separate working directory linked to the same repository, and its own feature branch.

In plain words
What is it for?
It is for isolating development work, installing dependencies separately, and preparing changes before merging them into main.
Why use it?
It keeps unfinished changes separate from the main branch and supports multiple tasks at the same time.

Skill for Claude CodeCodex

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is git worktree add ../project-feature-name -b feature/feature-name.

Good fit It is for isolating development work, installing dependencies separately, and preparing changes before merging them into main.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/andreaswasita/copilot-agents-dojo
agentmods
npx agentmods add skills/andreaswasita/copilot-agents-dojo/using-git-worktrees

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/andreaswasita/copilot-agents-dojo/using-git-worktrees/github.svg)](https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/using-git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/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/andreaswasita/copilot-agents-dojo/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/using-git-worktrees.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 1,097 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.01097
Opus 5.5 $0.00008 $0.00439
Sonnet 5.5 $0.00004 $0.00219
Haiku 4.5 $0.00002 $0.00110

Measured 1mo ago against content hash a32aff189e7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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/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 Skill

Creates an isolated git worktree on a dedicated feature branch for every development task, so main is never touched until finishing-a-development-branch says so. Does NOT replace feature branches when worktrees are impractical (CI, single-file fix) — the isolation principle is what matters.

When to Use

  • Starting any non-trivial development task (default behavior).
  • Before the agent would otherwise modify code on main.
  • When parallel development tracks are needed (multiple worktrees in flight).
  • After brainstorming produces an approved design.
  • NOT for a one-line typo fix where a branch is sufficient.

Prerequisites

  • git ≥ 2.5 with worktree support.
  • The repository is already cloned (a worktree extends an existing clone).
  • The powershell Copilot tool to run git.
  • A naming convention agreed for the branch: feature/*, fix/*, experiment/*.
  • The project's dependency install command (npm install, pip install -r requirements.txt, etc.).

How to Run

1. From the main repo root, create the worktree with a new branch.
2. Change into the worktree directory.
3. Install dependencies inside it.
4. Confirm a green test baseline.
5. Work only inside the worktree — never touch the main worktree.

Quick Reference

Operation Command
Create git worktree add ../<dirname> -b <branch>
List git worktree list
Remove git worktree remove ../<dirname>
Prune stale git worktree prune
Branch prefix Use
feature/<slug> New features
fix/<slug> Bug fixes
experiment/<slug> Spikes / throwaway
Dependency bootstrap Detect signal
npm install package.json
pip install -r requirements.txt requirements.txt
go mod download go.mod
mvn dependency:resolve pom.xml
dotnet restore *.csproj

Procedure

Step 1: Create the Worktree

From the main repo root, run via the powershell tool:

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. 1mo ago First seen · 125 lines · 20 tokens per session scan A a32aff189e7e

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository andreaswasita/copilot-agents-dojo (54 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 1,097 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-08-30.