worktree

worktree is a skill for Claude Code, Codex from DGouron/review-flow. It costs 34 tokens per session (1,140 once invoked), scanned A, original, MIT.

A Git feature for keeping multiple branches in separate working directories at the same time. This workflow creates, lists, connects, synchronises, and removes those directories while protecting the main branch.

In plain words
What is it for?
Starting isolated work areas, moving a session into one, syncing it with master, checking its status, and removing it after work is finished.
Why use it?
It lets several coding tasks proceed in parallel without repeatedly switching branches or accidentally committing directly to the main branch.

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/dgouron/review-flow/worktree
Any agent
npx skills add DGouron/review-flow --skill worktree
Clone the repo
git clone --depth 1 https://github.com/DGouron/review-flow

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 worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/dgouron/review-flow/worktree.svg)](https://agentmods.dev/skills/dgouron/review-flow/worktree)
Your own site
<a href="https://agentmods.dev/skills/dgouron/review-flow/worktree"><img src="https://agentmods.dev/badge/skills/dgouron/review-flow/worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,140 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.00034 $0.01140
Opus 5 $0.00017 $0.00570
Sonnet 5 $0.00007 $0.00228
Haiku 4.5 $0.00003 $0.00114

Measured 4d ago against content hash 03b8481ce48c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

worktree 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.

.claude/skills/worktree/SKILL.md · 192 lines

How it starts

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

Command /worktree - Git Worktree Management

Manages Git worktrees for working on multiple branches in parallel across different Claude Code sessions.

Absolute Security Rules

NEVER push directly to `master`!
NEVER commit directly to `master`!
Only allowed action on `master`: git pull origin master
Always create a PR to merge into `master`

Configuration

Parameter Value
Worktrees directory .claude/worktrees/
Main branch master
Default --from branch master

Subcommands

/worktree or /worktree list

Lists all existing worktrees with their branch and status.

/worktree add <name> [--from <branch>]

Creates a new worktree with a "home-base" branch.

  • By default, based on master
  • Path: .claude/worktrees/<name>

/worktree remove <name>

Removes a worktree (asks for confirmation if not clean).

/worktree sync [name]

Synchronizes the worktree with master (pull only).

/worktree connect <name>

Changes the current session's working directory to the specified worktree.

  • Verifies the worktree exists
  • Moves into <worktree_path>
  • Displays the worktree's git status

Worktree Architecture

claude-review-automation/             <- Main worktree (master)
├── src/
├── .claude/
│   └── worktrees/
│       ├── refactor/                 <- Refactor worktree
│       │   ├── src/
│       │   └── ...
│       ├── debug/                    <- Debug worktree
│       │   ├── src/
│       │   └── ...
│       └── feature-x/               <- Feature worktree
│           ├── src/
│           └── ...
└── ...

Concept: "Home-Base" Branches

Each worktree has a "home-base" branch that serves as a starting point.

Branch Role
refactor, debug, etc. Worktree home-base (synced with master)
feat/xxx-*, fix/xxx-* Working branches

Workflow inside a worktree:

# 1. You are on the home-base (e.g., refactor)
git status  # On the refactor branch

# 2. Create a feature branch for your ticket
git checkout -b feat/xxx-description

# 3. Work, commit...
git add .
git commit -m "feat(scope): description"

# 4. Push the feature branch (NEVER the home-base)
git push origin feat/xxx-description

# 5. Create a PR to master (via gh CLI)

# 6. Once merged, return to home-base and sync
git checkout refactor
git pull origin master

Read the full file on GitHub · 192 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 · 192 lines · 34 tokens per session scan A 03b8481ce48c

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository DGouron/review-flow (42 stars, last pushed yesterday), licensed MIT. It adds 34 tokens to every session and 1,140 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-30.

Related

Other skills, from other repositories

selecting-vizro-charts

Use this skill when choosing chart types, applying Plotly Express conventions, configuring colors, building KPI cards, or adding tables (AG Grid) to Vizro dashboards. Activate when the user asks which chart fits their data, needs custom chart functions, wants to set colors or palettes, is creating KPI metric cards, or…

mckinsey/vizro · 78 tokens

verify-changes

Verify a code change in this repo before committing or opening a PR. Use after editing collector (backend), web (frontend), shared package, or the Go agent — picks the minimal sufficient check set per touched area.

foru17/neko-master · 47 tokens

new-skill

Scaffold a new brooks-lint analysis skill so it passes npm run validate and npm run evals on the first try — generates skills/{name}/SKILL.md (with the mandatory "Do NOT trigger for:" clause and a Process section citing guide step ranges) plus skills/{name}/{name}-guide.md (sequentially numbered steps), then appends…

hyhmrright/brooks-lint · 145 tokens

monitor-webcams

Discover live webcams in a map viewport and resolve thumbnails or player URLs. Use when the user asks for visual context near a location, route, border, port, or city.

koala73/worldmonitor · 39 tokens

track-tariff-trends

Retrieve MFN applied tariff-rate timeseries for a reporting country — applied vs bound rates by year, plus the optional US effective tariff rate. Use when the user asks how a country's MFN tariffs have changed over time.

koala73/worldmonitor · 51 tokens

frontend-conventions

Frontend convention reference (SvelteKit / Svelte 5). Auto-injected into frontend-aware agents - not user-invocable.

fpindej/netrock · 27 tokens