using-git-worktrees

using-git-worktrees is a skill for Claude Code, Codex from CraftOS-dev/CraftBot. It costs 35 tokens per session (1,344 once invoked), scanned A, original, MIT.

A guide for creating isolated Git worktrees before feature work or implementation. A Git worktree is a separate working directory linked to the same repository, so branches can be worked on independently.

In plain words
What is it for?
It helps choose a worktree location, verify it is ignored by Git, and prepare a separate workspace for implementation.
Why use it?
It reduces conflicts with the current workspace and avoids switching branches while other work is in progress. It also checks that the chosen worktree directory is safe to use.

Skill for Claude CodeCodex

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

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/jesse/myproject/.worktrees/auth.

Good fit It helps choose a worktree location, verify it is ignored by Git, and prepare a separate workspace for implementation.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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/craftos-dev/craftbot/using-git-worktrees/github.svg)](https://agentmods.dev/skills/craftos-dev/craftbot/using-git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/craftos-dev/craftbot/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/craftos-dev/craftbot/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/craftos-dev/craftbot/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/craftos-dev/craftbot/using-git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,344 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.
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.00035 $0.01344
Opus 5.5 $0.00014 $0.00538
Sonnet 5.5 $0.00007 $0.00269
Haiku 4.5 $0.00003 $0.00134

Measured 1mo ago against content hash de9dcde34840, 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.

Origin

Copies of this mod

8 near-identical copies found in the catalogue:

skills/using-git-worktrees/SKILL.md · 219 lines

How it starts

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

Using Git Worktrees

Overview

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Core principle: Systematic directory selection + safety verification = reliable isolation.

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

Directory Selection Process

Follow this priority order:

1. Check Existing Directories

# Check in priority order
ls -d .worktrees 2>/dev/null     # Preferred (hidden)
ls -d worktrees 2>/dev/null      # Alternative

If found: Use that directory. If both exist, .worktrees wins.

2. Check CLAUDE.md

grep -i "worktree.*director" CLAUDE.md 2>/dev/null

If preference specified: Use it without asking.

3. Ask User

If no directory exists and no CLAUDE.md preference:

No worktree directory found. Where should I create worktrees?

1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global location)

Which would you prefer?

Safety Verification

For Project-Local Directories (.worktrees or worktrees)

MUST verify directory is ignored before creating worktree:

# Check if directory is ignored (respects local, global, and system gitignore)
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored:

Per Jesse's rule "Fix broken things immediately":

  1. Add appropriate line to .gitignore
  2. Commit the change
  3. Proceed with worktree creation

Why critical: Prevents accidentally committing worktree contents to repository.

For Global Directory (~/.config/superpowers/worktrees)

No .gitignore verification needed - outside project entirely.

Creation Steps

1. Detect Project Name

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

2. Create Worktree

# Determine full path
case $LOCATION in
  .worktrees|worktrees)
    path="$LOCATION/$BRANCH_NAME"
    ;;
  ~/.config/superpowers/worktrees/*)
    path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME"
    ;;
esac

# Create worktree with new branch
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"

Read the full file on GitHub · 219 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 · 219 lines · 35 tokens per session scan A de9dcde34840

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository CraftOS-dev/CraftBot (399 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 1,344 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-09-03.

Related

Other skills, from other repositories

artifact-storage-policy

A set of rules for choosing where project deliverables are stored in Google Drive or GitHub, how they are named, and how they are checked after saving.

a275618631/codex-antigravity-collaboration · 68 tokens

merge-batch

Prepare and merge an owner-selected PR batch with contributor credit and exact-candidate admission. Use for a pasted PR list; combined focused validation is diagnostic, and every actual landing still requires its applicable checks and authorization.

diegosouzapw/OmniRoute · 46 tokens

changelog-composer

Generates structured changelogs and release notes from git history and PRs, classifying breaking changes, features, fixes, performance, docs. Triggers on: "generate changelog", "write release notes", "what changed since", "prepare release", "release notes for", "diff since tag".

Mathews-Tom/armory · 67 tokens

worktree-handoff

Create a git worktree for a task and record handoff context into a plan file that is committed to the branch. Discovers existing plan files in the user's configured todos or plans directory, appends a dated Handoff Context section, and commits everything before printing the next-session pickup message. Use when the…

hanamizuki/solopreneur · 112 tokens

shipping-and-launch

A production-release checklist and planning guide for putting software in front of real users. It covers testing, security, monitoring, staged rollout, and rollback, which means returning to the previous working version.

vinvcn/addyosmani-agent-skills-zh · 49 tokens

sync-forks

Check how many of your GitHub forks are out of date and sync them.

sfc-gh-eraigosa/dotfiles · 20 tokens