worktree

A tool for managing Git worktrees, which are separate working folders connected to the same repository. It can create, inspect, list, repair, restack, and remove these folders and their branches.

In plain words
What is it for?
Use it to create a work folder for an issue, check whether one exists, list worktrees, recover paused work, remove finished work, and clean up branches that have been merged.
Why use it?
It keeps separate coding tasks isolated so changes for one issue do not interfere with another.

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

Made for: Claude Code, Codex.

Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,612 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.00020 $0.01612
Opus 5 $0.00010 $0.00806
Sonnet 5 $0.00004 $0.00322
Haiku 4.5 $0.00002 $0.00161

Measured today against content hash 5edcf3d169d9, 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 today.

The scan reads SKILL.md. This mod also ships 21 executable files (scripts/lib/kendex-env.sh, tests/worktree_atomic_symlink_swap.sh, tests/worktree_autorepair_hooks.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agents/skills/worktree/SKILL.md · 72 lines

How it starts

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

Worktree Management

Problem with this skill? Run kendex report — it files to the owning repo automatically. Do not hand-file.

.agents/skills/worktree/scripts/worktree <command> [options]

Worktrees live at <parent-of-checkout>/.worktrees/<checkout-name>/{id}, outside the repo root. Every command's contract — flags, exit codes, failure semantics, recovery — is its --help; the top-level worktree --help carries the command index, path and issue-ID rules, configuration variables, and setup-path hardening.

Commands

Command Description
create Claim a new issue worktree — a new-work claim, not a discovery command: existing ownership exits 75, and owned work is inspected or monitored, never given a second implementer. Reuse and conflict recovery: create --help
restack Guardedly continue, skip, or abort a tool-created paused restack
list List all worktrees
remove Remove worktree, clean symlinks, prune branches
cleanup Remove worktrees whose branches are merged
path / exists Print / check the worktree path for an issue ID
check Pre-create git state check (JSON: uncommitted, unpushed)
push Push worktree branch with auto-rebase and pinned --force-with-lease; the rebase-map: contract for remapping pre-rebase SHAs is in push --help
fix-links / repair-links Restore configured symlinks; repair-links is the git-hook-driven variant that never destroys untracked data
codex-setup / codex-branch / codex-cleanup, claude-setup / claude-cleanup App-created worktree hooks — installation wiring: references/hooks.md

Policy-blocked rebase (cherry-pick replay fallback)

When an execution policy rejects top-level git rebase porcelain, never retry the porcelain and never substitute a raw --force push — add --replay to the guarded restack (create --help); the controls stay restack continue|skip|abort <ID>.

Read the full file on GitHub · 72 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. today Changed 5edcf3d169d9
  2. 2d ago First seen · 72 lines · 20 tokens per session scan A 077c34ea4c6e

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository vanillagreencom/kendex (65 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 1,612 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

surf

Control Chrome browser via CLI for testing, automation, and debugging. Use when the user needs browser automation, screenshots, form filling, page inspection, network/CPU emulation, DevTools streaming, or AI queries via ChatGPT/Gemini/Perplexity/Grok/AI Studio.

w-winter/dot314 · 60 tokens

prose-review

Review prose written for others -- user-facing docs, prompts for other LLMs, inline comments, docstrings, and other-facing messages -- for local jargon leakage, orphaned references, missing grounding, and audience or genre misfit.

w-winter/dot314 · 50 tokens

text-search

Search indexed text corpora with qmd. For indexed content, prefer qmd over grep.

w-winter/dot314 · 22 tokens

repoprompt-tool-guidance-refresh

Refresh RepoPrompt tool guidance when the CLI/MCP surface changes. Tracks RepoPrompt CE (rpce-cli, the maintained target) across versions, and can diff the frozen Classic CLI (rp-cli) against CE. Uses /.pi/agent/skills/repoprompt-tool-guidance-refresh/scripts/track-rp-version.sh to capture/diff --help and -l (tool…

w-winter/dot314 · 115 tokens

xcodebuildmcp

Build/test Xcode projects via the XcodeBuildMCP MCP server using a local CLI wrapper for pi (no MCP support). Use when the user mentions Xcode, xcodebuild, iOS builds/tests, or XcodeBuildMCP.

w-winter/dot314 · 56 tokens

agent-browser

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

w-winter/dot314 · 51 tokens