worktree

worktree is a skill for Claude Code from Rune-kit/rune. It costs 51 tokens per session (1,237 once invoked), scanned A, original, MIT.

A manager for Git worktrees, which are separate working directories connected to one repository. It creates isolated branches and workspaces for parallel work or experiments, then cleans them up.

In plain words
What is it for?
Use it to create, inspect, and remove isolated workspaces for parallel development, team tasks, or temporary experiments.
Why use it?
It lets developers work on multiple branches without constantly switching the main working directory or letting an experiment alter it.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Claude Code; mentions Codex; mentions Gemini CLI.

Part of the rune plugin — 66 skills, 1 command, 66 agents, 6 hooks shipped together

Good fit Use it to create, inspect, and remove isolated workspaces for parallel development, team tasks, or temporary experiments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rune-kit/rune/worktree
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 Rune-kit/rune --skill worktree
Clone the repo
git clone --depth 1 https://github.com/Rune-kit/rune

Made for: Claude Code.

Or install rune, the plugin that ships this one along with the rest of its 66 skills, 1 command, 66 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 worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/rune-kit/rune/worktree/github.svg)](https://agentmods.dev/skills/rune-kit/rune/worktree)
Your own site
<a href="https://agentmods.dev/skills/rune-kit/rune/worktree"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/worktree/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 worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/rune-kit/rune/worktree"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,237 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.00051 $0.01237
Opus 5.5 $0.00020 $0.00495
Sonnet 5.5 $0.00010 $0.00247
Haiku 4.5 $0.00005 $0.00124

Measured 8d ago against content hash b603f3763356, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 8d 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/worktree/SKILL.md · 144 lines

How it starts

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

worktree

Purpose

Reusable git worktree lifecycle management. Creates isolated workspaces for parallel agent development, manages branch naming, handles cleanup after merge or abort. Extracted from team to be usable by any skill that needs workspace isolation.

Triggers

  • Called by team (L1) for parallel stream isolation
  • Called by cook (L1) when user explicitly requests worktree isolation
  • /rune worktree create <name> — manual creation
  • /rune worktree cleanup — manual cleanup of stale worktrees

Calls (outbound)

None — pure git operations via Bash.

Called By (inbound)

  • team (L1): Phase 2 ASSIGN — create worktrees for parallel streams
  • cook (L1): optional isolation for complex features
  • User: direct invocation for manual worktree management

Operations

Create Worktree

Input: { name: string, base_branch?: string }
Default base: current HEAD

Steps:
0. Keep worktrees out of git: Bash: git check-ignore -q .claude/worktrees/ || echo ".claude/worktrees/" >> .gitignore
1. Bash: git worktree add .claude/worktrees/<name> -b rune/<name> [base_branch]
2. Verify: Bash: git worktree list | grep <name>
3. Return: { path: ".claude/worktrees/<name>", branch: "rune/<name>" }

Naming convention:
  - Branch: rune/<name> (e.g., rune/stream-a, rune/auth-feature)
  - Path: .claude/worktrees/<name>
  - Max 3 active worktrees (enforced)

Worktree directory per runtime: in Claude Code, worktrees live under the .claude/ folder, next to the ones its own claude --worktree sessions create. Compiled skills for every other runtime (Codex, Cursor, Gemini CLI, Grok Build, …) use .rune/worktrees/, so non-Claude projects never grow a .claude/ folder.

List Worktrees

Bash: git worktree list
→ Parse output into: [{ path, branch, commit }]
→ Filter: only rune/* branches (skip main worktree)

Cleanup Worktree

Input: { name: string, force?: boolean }

Steps:
1. Check if branch is merged: Bash: git branch --merged main | grep rune/<name>
2. If merged OR force:
   Bash: git worktree remove .claude/worktrees/<name> --force
   Bash: git branch -d rune/<name>  (or -D if force)
3. If NOT merged AND NOT force:
   WARN: "Branch rune/<name> has unmerged changes. Use force=true to remove."

Read the full file on GitHub · 144 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. 8d ago First seen · 144 lines · 51 tokens per session scan A b603f3763356

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository Rune-kit/rune (96 stars, last pushed 2d ago), licensed MIT. It adds 51 tokens to every session and 1,237 once invoked, about $0.0002 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-11-22.

Related

worktree compared with skills from other repositories

worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktreeRune-kit/runeSkill962d agoMITA51Claude Code
fix-pr-review-looprichkuo/rk-skillsSkill50todayMITA90Claude Code
create-releaserichkuo/rk-skillsSkill50todayMITA45Claude Code
new-issuerichkuo/rk-skillsSkill50todayMITA70Claude Code
loop-itsmallnest/goal-workflowSkill3032mo agoMITA93Claude Code
milestone-workflowrichkuo/rk-skillsSkill50todayMITA88Claude Code
codex-validate-plan-work-on-issuerichkuo/rk-skillsSkill50todayMITA111Claude Code