using-git-worktrees

A workflow for Git worktrees, which let one Git repository have several branches checked out in separate directories. Each directory can be used independently while sharing the repository's history.

In plain words
What is it for?
Use it to create isolated workspaces, install the project's dependencies, and run baseline tests before starting parallel development.
Why use it?
It prevents unfinished work on one branch from interfering with another branch, such as a hotfix or experiment. It also checks that the workspace location will not accidentally be tracked by Git.

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

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 444 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.00030 $0.00444
Opus 5 $0.00015 $0.00222
Sonnet 5 $0.00006 $0.00089
Haiku 4.5 $0.00003 $0.00044

Measured 2d ago against content hash ef9abaa14817, 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 2d 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/operations/using-git-worktrees/SKILL.md · 61 lines

What it actually says

Using Git Worktrees

What Are Worktrees?

Git worktrees let you check out multiple branches simultaneously in separate directories. Each worktree has its own working directory but shares the same git history.

When to Use

  • Working on a hotfix while a feature is in progress
  • Running tests on one branch while developing on another
  • Isolating experimental changes from stable work

Setup Pattern

1. Choose a Worktree Location

Check for project conventions:

  • Look for .worktrees/ directory
  • Check CLAUDE.md or architecture.md for guidance
  • Default: .worktrees/ in project root

2. Safety Verification

Before creating a worktree:

  • Ensure the worktree directory is in .gitignore
  • If not, add it before proceeding

3. Create the Worktree

git worktree add .worktrees/feature-name -b feature/feature-name

4. Install Dependencies

Detect project type and install:

  • Node.js: cd .worktrees/feature-name && npm install
  • Python: cd .worktrees/feature-name && pip install -r requirements.txt
  • Go: cd .worktrees/feature-name && go mod download

5. Run Baseline Tests

Before starting work, verify the worktree is healthy:

cd .worktrees/feature-name && npm test

Cleanup

When done with a worktree:

git worktree remove .worktrees/feature-name
git branch -d feature/feature-name  # if merged

Rules

  • Never delete a worktree directory manually — use git worktree remove
  • Don't modify the same branch from multiple worktrees
  • Clean up worktrees when done to avoid confusion
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. 2d ago First seen · 61 lines · 30 tokens per session scan A ef9abaa14817

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository Vimalk0703/shipworthy (7 stars, last pushed 4mo ago), licensed MIT. It adds 30 tokens to every session and 444 once invoked, about $0.0002 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

roam

Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring…

Cranot/roam-code · 86 tokens

ring:writing-plans

Writing a rolling-wave phased implementation plan from a spec before coding: a phase-epic-task hierarchy where Phase 1 is detailed into dispatch-ready tasks and later phases stay epic-level for elaboration during execution. Use when a multi-file feature needs decomposition; runs after ring:exploring-codebases or…

LerianStudio/ring · 94 tokens

ring:searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use…

LerianStudio/ring · 74 tokens

ring:exploring-codebases

Exploring a codebase across phases: scopes the target, detects architecture, components, and layers, deep-dives each discovered perspective, then synthesizes findings into actionable guidance with file:line evidence. Use to understand how a feature or system works before planning changes, or to orient on an unfamiliar…

LerianStudio/ring · 91 tokens

ring:writing-skills

Writing or editing a Ring skill: SKILL.md structure, frontmatter and Agent-Search-Optimization rules, token-efficiency targets, and bulletproofing (Iron Law, rationalization tables, Red Flags) so discipline-enforcing skills resist excuses. Use when creating or revising a skill. Delegates pressure-testing to…

LerianStudio/ring · 100 tokens

ring:applying-licenses

Applying or switching a repository's license (Apache 2.0, Elastic License v2, or Proprietary): rewrites the LICENSE file, updates Go/TS source headers, sets SPDX identifiers, and validates consistency after user confirmation. Use when asked to set, apply, or switch a license, or when scaffolding a service with no…

LerianStudio/ring · 94 tokens