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

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/andreaswasita/copilot-agents-dojo/using-git-worktrees
Any agent
npx skills add andreaswasita/copilot-agents-dojo --skill using-git-worktrees
Clone the repo
git clone --depth 1 https://github.com/andreaswasita/copilot-agents-dojo

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.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.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 1,097 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.01097
Opus 5 $0.00010 $0.00549
Sonnet 5 $0.00004 $0.00219
Haiku 4.5 $0.00002 $0.00110

Measured 5d ago against content hash a32aff189e7e, 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 5d 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. 5d 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 (51 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. 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.

Related

Other skills, from other repositories

decision-ledger

Use throughout a session to track open decision threads and draft them to .governance/claims/ when they close. 会话全程使用:跟踪开放的决策线程,线程闭合时起草到账本。Records what was decided and why, at the moment it is decided, so the reasoning survives a lost account, a deleted transcript or a compaction. Drafting is automatic and free…

johnrucnapier-sketch/ACGM-for-Claude-Code · 99 tokens

governance-bootstrap

Use when setting up this governance system from zero in a project that has none. 在一个尚无治理的项目里从零建治理时调用。This is a HUMAN-DRIVEN, multi-session guided checklist — NOT an autonomous action. 这是人驱动的多会话引导清单,非自主执行。Walks the 8-step bootstrap recipe — audit, constitution, rewrite root rules, ADR log, snapshot + drift scripts…

johnrucnapier-sketch/ACGM-for-Claude-Code · 107 tokens

session-grounding

Use at the START of every new, resumed, cleared or compacted session, and when picking up half-done work in a governed project — before taking ANY action. 在每个新开/续接/clear/compact 后的 Session,以及接手半截工作时,动手前先走此流程。Read current truth sources, identify track and scope, report five items and WAIT for human confirmation. A…

johnrucnapier-sketch/ACGM-for-Claude-Code · 105 tokens

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

AndreasKarz/Vibe-Coding-Dev-Setup · 45 tokens

database-specialist

Data-pipeline implementation specialist — change-tracker/data-loader configurations, stored procedure integration, MongoDB repository code, DI registration, and Squadron-based database tests. Triggers: SqlChangeTracker, SqlDataLoader, SqlExecutionContext, IMongoCollection, MongoConventions, DomainEntityRepository…

AndreasKarz/Vibe-Coding-Dev-Setup · 81 tokens

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of "Word doc", "word document", ".docx", or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when…

AndreasKarz/Vibe-Coding-Dev-Setup · 168 tokens