create-worktree

A workflow for creating a separate Git worktree, branch, and tmux window for a coding task. A Git worktree is another working folder connected to the same repository.

In plain words
What is it for?
Use it to start work on a general feature or fix with a generated or supplied branch name and task instructions.
Why use it?
It keeps task changes isolated while giving the work its own terminal session.

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

Made for: Claude Code, Codex.

Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,164 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.00096 $0.01164
Opus 5 $0.00048 $0.00582
Sonnet 5 $0.00019 $0.00233
Haiku 4.5 $0.00010 $0.00116

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

Security

Grade A, and why

create-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 2d 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.

plugins/create-worktree/skills/create-worktree/SKILL.md · 100 lines

How it starts

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

Create Worktree

Create a dedicated worktree + tmux window via workmux add, with a task prompt injected into the new agent session.

Workflow

1. Determine the Branch Name

The user provides either:

  • An explicit branch name (e.g., "create worktree feature/my-thing") -- use as-is
  • A task description (e.g., "create a worktree for adding dark mode") -- construct a branch name using the TYPE/SLUG format

Branch naming rules (TYPE/SLUG):

  • TYPE: Use fix if the user mentions "fix", "bug", "patch", or similar. Use feature for everything else.
  • SLUG: Slugify the description: lowercase, replace spaces and special characters with hyphens, collapse consecutive hyphens, trim leading/trailing hyphens, truncate to 50 characters at a word boundary.

Examples:

  • "create worktree for adding dark mode" -> feature/adding-dark-mode
  • "spin up a worktree to fix the auth timeout" -> fix/auth-timeout
  • "new worktree feature/refactor-config" -> feature/refactor-config (used as-is)

2. Compose the Task Prompt

Build a prompt string that gives the new agent context about its task:

Work on: [user's task description]

Branch: [BRANCH_NAME]

Keep the prompt concise -- a few sentences at most. Use the user's own description of the task as the core content.

If the user provided only a branch name with no description, derive a human-readable description from the branch name (e.g., feature/add-dark-mode becomes "Work on: add dark mode").

3. Create the Worktree

Important: The workmux add command must be fully detached from the Claude Code process. workmux creates tmux windows and spawns new Claude sessions, which cannot initialize while the parent Claude Code process is alive. The launch-workmux script handles backgrounding, detaching, waiting, and outputting the log.

Template escaping: workmux renders the prompt body through MiniJinja, so any literal {{, {%, or {# token in the task description (e.g. GitHub Actions ${{ inputs.x }} expressions, Jinja/Liquid/Tera/Helm/Vue templates, Handlebars-style snippets) would otherwise be parsed as a template variable reference and rejected with Template uses undefined variables. The launch-workmux script reads the prompt from stdin, writes an escaped temporary prompt file for workmux add -P, and removes that temporary file after workmux add exits. Each escaped delimiter renders back to the literal characters, so the prompt stored at <worktree>/.workmux/PROMPT-*.md matches the original input.

Read the full file on GitHub · 100 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. 2d ago First seen · 100 lines · 96 tokens per session scan A 94674c6af2bd

Subscribe to this mod's changes

create-worktree is a skill published in the GitHub repository cboone/agent-harness-plugins (2 stars, last pushed 1mo ago), licensed MIT. It adds 96 tokens to every session and 1,164 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories