worktree-agent

worktree-agent is a skill for Claude Code from notque/vexjoy-agent. It costs 14 tokens per session (1,415 once invoked), scanned A, original, MIT.

Rules for agents working in isolated Git worktrees, which are separate working directories for branches of the same repository.

In plain words
What is it for?
Use them when creating feature branches, checking the working directory, handling branch conflicts, and making changes in isolation.
Why use it?
They reduce mistakes such as editing the main checkout, using the wrong branch, or colliding with another worktree.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash scripts/worktree-preflight.sh <intended-branch-name>.

Good fit Use them when creating feature branches, checking the working directory, handling branch conflicts, and making changes in isolation.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/notque/vexjoy-agent
agentmods
npx agentmods add skills/notque/vexjoy-agent/worktree-agent

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-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/notque/vexjoy-agent/worktree-agent/github.svg)](https://agentmods.dev/skills/notque/vexjoy-agent/worktree-agent)
Your own site
<a href="https://agentmods.dev/skills/notque/vexjoy-agent/worktree-agent"><img src="https://agentmods.dev/badge/skills/notque/vexjoy-agent/worktree-agent/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-agent

Your own site · 80×15
<a href="https://agentmods.dev/skills/notque/vexjoy-agent/worktree-agent"><img src="https://agentmods.dev/badge/skills/notque/vexjoy-agent/worktree-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,415 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 26
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00014 $0.01415
Opus 5.5 $0.00006 $0.00566
Sonnet 5.5 $0.00003 $0.00283
Haiku 4.5 $0.00001 $0.00142

Measured 28d ago against content hash 287c2444d0b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

worktree-agent 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 28d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/tests/test_worktree_capacity.py, scripts/worktree_capacity.py), 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.

skills/process/worktree-agent/SKILL.md · 160 lines

How it starts

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

Worktree Agent Rules

Mandatory rules for any agent dispatched with isolation: "worktree".

Rule 1: Verify Your Working Directory

On start, run pwd. Your path MUST contain .claude/worktrees/. If your CWD is the main repo path, STOP and report the error.

Rule 2: Create Feature Branch First

git checkout -b <branch-name>

Never commit on the default worktree-agent-* branch. Create your feature branch FIRST.

If git checkout -b <branch-name> fails with "a branch named X already exists":

# Option A: the branch has no commits beyond main — safe to reset and reuse
git branch -D <branch-name>
git checkout -b <branch-name>

# Option B: the branch is checked out in another active worktree — use a unique name
git checkout -b <branch-name>-2   # or append timestamp: $(date +%s)

If git checkout -b <branch-name> fails with "X is already used by worktree at Y":

# Branch is live in another worktree — use a unique suffix
git checkout -b <branch-name>-$(date +%s)

To update a branch held by another worktree (e.g. an existing PR branch): work detached from origin/<branch> and push with git push origin HEAD:<branch>. gh pr merge's post-merge local-checkout errors are harmless.

Rule 3: Use Worktree-Relative Paths

Never hardcode absolute paths from the main repo. Use $(git rev-parse --show-toplevel)/path. Exception: Reading gitignored ADR files requires the main repo absolute path.

Rule 4: Ignore Auto-Plan Hooks

Keep planning inline instead of creating task_plan.md. If the auto-plan hook fires, continue with the current task and keep your attention on implementation.

Rule 5: Stage Specific Files Only

git add path/to/specific/file.py

Never git add ., git add -A, or git add --all. Verify with git diff --cached --stat.

Rule 6: Do Not Touch the Main Worktree

Never write to paths outside your worktree directory. Never run git checkout in the main repo.

Rule 7: Commit with Conventional Format

Read the full file on GitHub · 160 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 29d ago Changed · -93 lines · +8 tokens per session 2bce4d61355b
  2. 1mo ago First seen · 160 lines · 14 tokens per session scan A 287c2444d0b6

Subscribe to this mod's changes

worktree-agent is a skill published in the GitHub repository notque/vexjoy-agent (442 stars, last pushed today), licensed MIT. It adds 14 tokens to every session and 1,415 once invoked, about $0.0001 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-03.

Related

Other skills, from other repositories

git-worktree-manager

Manage git worktrees for isolated branch development - create, list, switch, and clean up worktrees for parallel feature development, safe experimentation, and CI/CD isolation.

chainlesschain/chainlesschain · 37 tokens

auto-git-commiter

Use when automatically commit and push OpenClaw changes to GitHub. Enable continuous improvement with automatic versioning, changelogs, and deployment-ready commits. Use when working with auto git commiter.

oyi77/1ai-skills · 47 tokens

lakefs-versioning

Use when lakeFS data versioning — Git-like branching for data lakes, atomic commits, time travel, CI/CD. Use when working with lakefs versioning.

oyi77/1ai-skills · 38 tokens

deploy-agent

Use when ship code through controlled pipeline with verification gates and rollback plans.

oyi77/1ai-skills · 17 tokens

hyperframes-changelog-video

Turn a weekly changelog .md into a finished branded changelog video using HyperFrames. Use when the user provides a changelog/digest markdown and wants the weekly video, or says 'changelog video'. Self-contained — fonts, background, lexicon, and scripts ship in the skill. Produces square 1080, 45-60s videos with…

oyi77/1ai-skills · 85 tokens

hyperframes-pr-to-video

Turn a GitHub pull request into a changelog, feature-reveal, fix, or refactor explainer video using HyperFrames. Use when the user provides a PR URL, owner/repo#N ref, or says 'this PR'. Reads diff via gh CLI, visualizes code changes as animated diffs with narration. Teaches diff parsing, change visualization, and…

oyi77/1ai-skills · 84 tokens