worktree

A dispatcher that starts coding tasks in separate Git worktrees using workmux. A worktree is an additional working directory connected to the same Git repository, so tasks can be developed independently.

In plain words
What is it for?
It helps turn one or more task descriptions into named worktrees, prompt files, and workmux commands. It is for launching independent implementation tasks when the request contains enough context.
Why use it?
It separates parallel tasks and prevents their file changes from interfering with one another. The dispatcher delegates exploration and implementation to the worktree agents.

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

Made for: Claude Code, Codex.

Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,320 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.00017 $0.01320
Opus 5 $0.00009 $0.00660
Sonnet 5 $0.00003 $0.00264
Haiku 4.5 $0.00002 $0.00132

Measured yesterday against content hash 567cdd88e50a, 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 yesterday.

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 · 156 lines

How it starts

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

Launch one or more tasks in new git worktrees using workmux.

Tasks: $ARGUMENTS

You are a dispatcher, not an implementer

HARD RULE — NO EXCEPTIONS: Do NOT explore, read, grep, glob, or search the codebase. Do NOT use the Task/Explore agent. Do NOT investigate the problem. You are a thin dispatcher — your ONLY job is to write prompt files and run workmux add. The worktree agent will do all the exploration and implementation.

If the user's message contains enough context to write a prompt, write it immediately. If not, ask the user for clarification — do NOT try to figure it out by reading code.

If tasks reference earlier conversation (e.g., "do option 2"), include all relevant context in each prompt you write.

If tasks reference a markdown file (e.g., a plan or spec), re-read the file to ensure you have the latest version before writing prompts.

For each task:

  1. Generate a short, descriptive worktree name (2-4 words, kebab-case)
  2. Write a detailed implementation prompt to a temp file
  3. Run workmux add <worktree-name> -b -P <temp-file> to create the worktree

The prompt file should:

  • Include the full task description
  • Use RELATIVE paths only (never absolute paths, since each worktree has its own root directory)
  • Be specific about what the agent should accomplish

Skill delegation

If the user passes a skill reference (e.g., /auto, /plan-review), the prompt should instruct the agent to use that skill instead of writing out manual implementation steps.

Skills can have flags. If the user passes /auto --gemini, pass the flag through to the skill invocation in the prompt.

Example prompt:

[Task description here]

Use the skill: /skill-name [flags if any] [task description]

Do NOT write detailed implementation steps when a skill is specified — the skill handles that.

Flags

--merge: When passed, add instruction to use /merge skill at the end to commit, rebase, and merge the branch.

...
Then use the /merge skill to commit, rebase, and merge the branch.

Read the full file on GitHub · 156 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. yesterday First seen · 156 lines · 17 tokens per session scan A 567cdd88e50a

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository raine/workmux (2,284 stars, last pushed 2d ago), licensed MIT. It adds 17 tokens to every session and 1,320 once invoked, about $0.0001 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens