worktree

worktree is a skill for Claude Code from mistralai/mistral-vibe. It costs 50 tokens per session (1,137 once invoked), scanned A, original, Apache-2.0.

A Git worktree management workflow that creates separate working directories from one repository. A worktree lets you work on another branch without switching the branch in your main checkout.

In plain words
What is it for?
Use it to create, reuse, list, and remove worktrees, including worktrees for new or existing branches.
Why use it?
It isolates parallel tasks and helps prevent separate sessions or branches from overwriting each other's working files.

Skill for Claude Code ✓ vendor

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it to create, reuse, list, and remove worktrees, including worktrees for new or existing branches.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mistralai/mistral-vibe/worktree
About the project

Mistral Vibe is a command-line coding assistant that lets users converse with a codebase and use natural language to explore or change projects. Developers use it for file editing, code searching, version-control tasks, and shell commands through Mistral’s models. Its catalogue add-ons provide skills and instructions for customizing the assistant’s workflows.

mistralai/mistral-vibe · 5,193 stars · on GitHub

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 mistralai/mistral-vibe --skill worktree
Clone the repo
git clone --depth 1 https://github.com/mistralai/mistral-vibe

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 worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/mistralai/mistral-vibe/worktree/github.svg)](https://agentmods.dev/skills/mistralai/mistral-vibe/worktree)
Your own site
<a href="https://agentmods.dev/skills/mistralai/mistral-vibe/worktree"><img src="https://agentmods.dev/badge/skills/mistralai/mistral-vibe/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/mistralai/mistral-vibe/worktree"><img src="https://agentmods.dev/badge/skills/mistralai/mistral-vibe/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,137 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.00050 $0.01137
Opus 5.5 $0.00020 $0.00455
Sonnet 5.5 $0.00010 $0.00227
Haiku 4.5 $0.00005 $0.00114

Measured 1mo ago against content hash 78087e952889, 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 1mo 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.

vibe/plugins/builtins/vibe/skills/worktree/SKILL.md · 99 lines

How it starts

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

Worktree Management

Git worktrees live under $VIBE_HOME/worktrees/ (default ~/.vibe/worktrees/), each in a per-repository bucket named <repo_root.name>-<sha256(common_git_dir)[:12]> so worktrees from different repos never collide.

$VIBE_HOME/worktrees/
  .claims/<bucket>/<name>/          # claim records and holder markers
    record.json                     # metadata: branch, base_commit, branch_created, claimed_at
    recovery.json                   # snapshot metadata for a retained chat
    holders/                        # one empty file per live session
  <bucket>/<name>/                  # the actual git worktree checkout

Creating a worktree

  1. Compute the bucket from the repo root and common git dir.
  2. Validate the name (single portable path segment; no <>:"/\|?*, no trailing space or dot, no Windows reserved names like CON/PRN/NUL/ COM1-COM9/LPT1-LPT9, not . or ..).
  3. Reserve the directory with mkdir (atomic claim — fails if taken).
  4. For a new branch, start from the remote's default branch (fetch first, best-effort). For an existing branch, check it out into the worktree.
  5. git worktree add -b <name> <path> <start_point> (or without -b for reuse).
  6. Record the worktree's own HEAD as base_commit — this is the baseline for cleanup, not the invoking checkout's HEAD.
  7. Write record.json under .claims/<bucket>/<name>/.

When no name is given, derive one by slugifying the prompt: NFKD-normalize, lowercase, replace non-[a-z0-9]+ with -, take the first 6 words, trim to 40 chars, drop trailing stop words. Branch gets a vibe/ prefix. Append -2, -3, etc. on collision (up to 100). Fall back to a random slug if empty.

Reuse an existing worktree only after validating: no symlinks in the path, .git is a file (not a directory), same common git dir, matching branch.

Holding

A session using a worktree must register as a holder to prevent the background cleanup from removing it. Holder files are locked for the lifetime of the session; an unlocked marker left by a crashed process is stale and may be removed. A temporary holder protects a worktree while a session attaches.

Read the full file on GitHub · 99 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. 1mo ago Changed · +1 lines 78087e952889
  2. 1mo ago First seen · 98 lines · 50 tokens per session scan A c261ec34c9fb

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository mistralai/mistral-vibe (5,193 stars, last pushed 2d ago), licensed Apache-2.0. It adds 50 tokens to every session and 1,137 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-09-10.