create-worktree

A command that creates a separate Git worktree, which is another working folder connected to the same repository, on a new branch.

In plain words
What is it for?
Use it to start feature, bug-fix, documentation, refactoring, or maintenance work in a new branch and folder, optionally from a chosen base revision.
Why use it?
It keeps parallel work isolated so changes in one task do not disturb the current checkout.

Command for Cursor

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 commands/jabrena/plinth/create-worktree
Clone the repo
git clone --depth 1 https://github.com/jabrena/plinth

Made for: Cursor.

Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 674 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.00014 $0.00674
Opus 5 $0.00007 $0.00337
Sonnet 5 $0.00003 $0.00135
Haiku 4.5 $0.00001 $0.00067

Measured 2d ago against content hash 10f8f9db8b77, 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.

.cursor/commands/create-worktree.md · 68 lines

How it starts

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

create-worktree

Always create a new branch and linked Git worktree for isolated or parallel work without changing the current checkout.

Usage

/create-worktree <issue-or-change|type description> [<target-path>] [<base-reference>]

Accepted Inputs

  • An issue/change identifier, or an explicit branch type and description
  • Optional preferred target path
  • Optional base reference
  • Supported branch types: feat, fix, docs, refactor, and chore
  • Preferred branch format: <type>/<issue-or-change>-<kebab-case-description> when an issue or OpenSpec change is available, otherwise <type>/<kebab-case-description>
  • Fresh-name rule: if the preferred branch name or target path already exists, derive the next unused suffix such as -2, -3, and continue with the fresh branch/worktree

Owning Agent

@plinth-tech-lead

Associated Capabilities

  • Git branch naming and validation
  • Git linked worktrees
  • Parallel OpenSpec child-change coordination

Workflow

  1. Resolve the preferred branch name from the issue/change identifier or explicit branch details.
  2. Resolve an absolute preferred target path and the base reference.
  3. Resolve the repository default branch and the current branch.
  4. Verify the current checkout is main or the repository default branch before creating the worktree branch.
  5. If the current branch is not main or the default branch, stop and ask whether to switch to the default branch, choose a different base, or continue explicitly from the current branch.
  6. Verify the repository and selected base reference are valid before creating anything.
  7. Derive a fresh branch name and fresh target path when the preferred branch exists, is checked out in another worktree, or the preferred target path exists.
  8. Verify the final branch name does not exist, is not checked out in another worktree, and the final target path does not exist.
  9. Run the equivalent of git worktree add -b <branch> <target-path> <base-reference>.
  10. Report the created branch, absolute worktree path, base reference, and cleanup command.

Read the full file on GitHub · 68 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 · 68 lines · 14 tokens per session scan A 10f8f9db8b77

Subscribe to this mod's changes

create-worktree is a command published in the GitHub repository jabrena/plinth (435 stars, last pushed yesterday), licensed Apache-2.0. It adds 14 tokens to every session and 674 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.