using-git-worktrees

using-git-worktrees is a skill for Claude Code from HigorAlves/orc. It costs 18 tokens per session (1,427 once invoked), scanned A, original, MIT.

A guide to using Git worktrees, which create separate working folders for different branches while sharing the same repository history.

In plain words
What is it for?
Use it to create safe workspaces for feature development, select suitable locations, and check that worktrees are clean before removal.
Why use it?
It helps developers work on isolated changes without switching the current branch or mixing files from separate tasks.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: mentions Claude Code; mentions AGENTS.md; $skill-name invocation.

Good fit Use it to create safe workspaces for feature development, select suitable locations, and check that worktrees are clean before removal.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/higoralves/orc/using-git-worktrees
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.

Any agent
npx skills add HigorAlves/orc --skill using-git-worktrees
Clone the repo
git clone --depth 1 https://github.com/HigorAlves/orc

Made for: Claude Code.

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/higoralves/orc/using-git-worktrees/github.svg)](https://agentmods.dev/skills/higoralves/orc/using-git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/higoralves/orc/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/higoralves/orc/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/higoralves/orc/using-git-worktrees"><img src="https://agentmods.dev/badge/skills/higoralves/orc/using-git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,427 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.00018 $0.01427
Opus 5.5 $0.00007 $0.00571
Sonnet 5.5 $0.00004 $0.00285
Haiku 4.5 $0.00002 $0.00143

Measured 25d ago against content hash 8cffb91e4fb2, 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 25d 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.

codex/orc/content/skills/using-git-worktrees/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 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."

[!NOTE] 📋 Harness-managed worktrees land in the pinned location automatically. orc ships WorktreeCreate/WorktreeRemove hooks (hooks/scripts/worktree-*.sh): any worktree Claude Code itself creates (--worktree, or an agent with isolation: worktree) is placed under <repo>/.orc/.worktrees/<sanitized-branch> and cleaned up only when the tree is clean. This skill's manual process below applies when YOU create the worktree.

Directory Selection Process

Iron rule: orc worktrees always live under .orc/.worktrees/ — at the repo root or, in workspace mode, the workspace root. Never under $HOME, never elsewhere. .orc/ is always git-ignored in an orc project, so worktree contents can never pollute the tree. There is no "ask the user where", no global location, and no AGENTS.md location override — the location is fixed by design.

Exactly two cases:

Workspace mode

If the caller sourced lib/workspace-detect.sh and ORC_CONTEXT=workspace, use the workspace-shared trees root, keyed per repo:

path="$ORC_WORKSPACE_ROOT/.orc/.worktrees/<repo>/<branch>"

Use this when the caller provides a repo + branch pair (e.g. from $orc-start or $orc-flow Phase 4 in workspace mode). Workspace-mode worktrees are always per-repo and always require a target repo — if the caller hasn't passed repo, treat it as repo mode for the current repo instead.

Repo mode (default)

Otherwise use the current repo's own .orc/.worktrees/:

path="$(git rev-parse --show-toplevel)/.orc/.worktrees/<branch>"

Safety Verification

MUST confirm .orc/ is ignored before creating the worktree. It almost always is (orc scaffolds it into .gitignore), but verify — a worktree inside a tracked .orc/ would get its entire checkout staged.

Read the full file on GitHub · 162 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 25d ago Changed 8cffb91e4fb2
  2. 1mo ago Changed · -49 lines · -17 tokens per session 990efa492d13
  3. 1mo ago Changed 821ff0e76b81
  4. 2mo ago First seen · 211 lines · 35 tokens per session scan A 6767b1556dd4

Subscribe to this mod's changes

using-git-worktrees is a skill published in the GitHub repository HigorAlves/orc (7 stars, last pushed 3d ago), licensed MIT. It adds 18 tokens to every session and 1,427 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

using-git-worktrees compared with skills from other repositories

using-git-worktrees next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
using-git-worktreesHigorAlves/orcSkill73d agoMITA18Claude Code
fable-shipdebabsah/fable-methodSkill04mo agoMITA46Claude Code
changelogwesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k2d agononeA28Claude Code
land-and-deployFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A41Claude Code
review-prFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A45Claude Code
release-notes-generatorFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A59Claude Code
release-notesFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A13Claude Code