using-git-worktrees

using-git-worktrees is a skill for Claude Code, Codex from brunob54/superpowers-orchestrator. It costs 48 tokens per session (751 once invoked), scanned A, original, MIT.

A Git worktree workflow for creating an isolated copy of a repository on a separate branch. A worktree lets you work on another branch without changing the current checkout.

In plain words
What is it for?
It helps choose and verify a worktree directory, check ignore rules, create a descriptive branch, and prepare a separate workspace for implementation.
Why use it?
It reduces the risk of mixing experimental or risky changes into the branch you are currently using.

Skill for Claude CodeCodex

Part of the superpowers-orchestrator plugin — 28 skills, 2 agents, 6 hooks 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/brunob54/superpowers-orchestrator/using-git-worktrees
Any agent
npx skills add brunob54/superpowers-orchestrator --skill using-git-worktrees
Clone the repo
git clone --depth 1 https://github.com/brunob54/superpowers-orchestrator

Made for: Claude Code, Codex.

Or install superpowers-orchestrator, the plugin that ships this one along with the rest of its 28 skills, 2 agents, 6 hooks.

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/brunob54/superpowers-orchestrator/using-git-worktrees.svg)](https://agentmods.dev/skills/brunob54/superpowers-orchestrator/using-git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/brunob54/superpowers-orchestrator/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/brunob54/superpowers-orchestrator/using-git-worktrees.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 751 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.00048 $0.00751
Opus 5 $0.00024 $0.00376
Sonnet 5 $0.00010 $0.00150
Haiku 4.5 $0.00005 $0.00075

Measured 4d ago against content hash def162b17f6b, 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 4d 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 · 117 lines

How it starts

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

Using Git Worktrees

Create an isolated branch workspace with safe defaults.

Required Start

Announce: I'm using the using-git-worktrees skill to set up an isolated workspace.

Directory Selection Priority

Check in order:

ls -d .worktrees 2>/dev/null     # Preferred (hidden)
ls -d worktrees 2>/dev/null      # Alternative
  1. If .worktrees/ exists — use it. If both exist, .worktrees/ wins.
  2. If worktrees/ exists — use it.
  3. Check project guidance file (e.g. CLAUDE.md) for a stated preference:
    grep -i "worktree.*director" CLAUDE.md 2>/dev/null
    
  4. Ask user.

Safety Check

For project-local worktree directories, verify ignore rules before creating:

git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If not ignored:

  1. Add the appropriate line to .gitignore.
  2. Commit the .gitignore change immediately before proceeding — an uncommitted ignore entry is easy to lose and leaves the worktree contents exposed to accidental staging.

Creation Steps

1. Detect project root and branch name

project=$(basename "$(git rev-parse --show-toplevel)")

Choose a descriptive BRANCH_NAME for the feature being isolated.

2. Create worktree and branch

git worktree add <path> -b <BRANCH_NAME>

Critical: The cd <path> in this step does not persist across separate shell calls. Use the full worktree path — cd <path> && <command> — in every subsequent Bash call rather than assuming the working directory carried over.

3. Run project setup

Auto-detect the project ecosystem and run the appropriate setup:

# Node.js
if [ -f package.json ]; then npm install; fi

# Rust
if [ -f Cargo.toml ]; then cargo build; fi

# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi

# Go
if [ -f go.mod ]; then go mod download; fi

If none of these files exist, skip dependency installation and note it in the output.

Read the full file on GitHub · 117 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. 4d ago First seen · 117 lines · 48 tokens per session scan A def162b17f6b

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository brunob54/superpowers-orchestrator (3 stars, last pushed 5d ago), licensed MIT. It adds 48 tokens to every session and 751 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

github-pr-review

Handles PR review comments and feedback resolution. Use when user wants to resolve PR comments, handle review feedback, fix review comments, address PR review, check review status, respond to reviewer, verify PR readiness, review PR comments, analyze review feedback, evaluate PR comments, assess review suggestions, or…

fvadicamo/dev-agent-skills · 95 tokens

privacy-guard

Prevents private infrastructure details (node hostnames, internal project names, local usernames and personal emails, absolute home paths, private and VPN IP ranges) from leaking into public repositories through commits, PRs, docs or release artifacts. Use when working in a public or soon-to-be-public repo, before…

fvadicamo/dev-agent-skills · 128 tokens

decision-records

Creates, supersedes and validates decision records (ADRs) against the convention a collection already follows, instead of imposing a published one. Use when the user wants to record a decision, write an ADR, supersede an existing decision, audit or lint a decisions folder, check that an ADR index is in sync, or asks…

fvadicamo/dev-agent-skills · 113 tokens

github-pr-creation

Creates GitHub Pull Requests with automated validation and task tracking. Use when user wants to create PR, open pull request, submit for review, or check if ready for PR. Analyzes commits, validates task completion, generates Conventional Commits title and description, suggests labels. NOTE - for merging existing…

fvadicamo/dev-agent-skills · 75 tokens

github-pr-merge

Merges GitHub Pull Requests after validating pre-merge checklist. Use when user wants to merge PR, close PR, finalize PR, complete merge, approve and merge, or execute merge. Runs pre-merge validation (tests, lint, CI, comments), confirms with user, merges with proper format, handles post-merge cleanup.

fvadicamo/dev-agent-skills · 72 tokens

git-commit

Creates git commits following Conventional Commits format with type/scope/subject. Use when user wants to commit changes, create commit, save work, or stage and commit. Enforces project-specific conventions from CLAUDE.md.

fvadicamo/dev-agent-skills · 49 tokens