worktree-agent

worktree-agent is a skill for Claude Code, Codex 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 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/notque/vexjoy-agent/worktree-agent
Any agent
npx skills add notque/vexjoy-agent --skill worktree-agent
Clone the repo
git clone --depth 1 https://github.com/notque/vexjoy-agent

Made for: Claude Code, Codex.

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.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.svg" alt="Measured on agentmods" 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. 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.01415
Opus 5 $0.00007 $0.00707
Sonnet 5 $0.00003 $0.00283
Haiku 4.5 $0.00001 $0.00142

Measured 2d ago against content hash 287c2444d0b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 (420 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. 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

agent-coverage-check

Check agent configuration coverage across hierarchy levels and phases. Use to ensure complete agent system coverage.

majiayu000/claude-skill-registry · 23 tokens

skillpack-creator

Create a reusable SkillPack from a successful completed task. Use when the user wants to convert a one-off research, coding, analysis, or content workflow into a distributable local SkillPack with skillpack.json, local skills under skills/, starter prompts, start scripts, and an optional zip package.

CreminiAI/skillpack · 67 tokens

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

CreminiAI/skillpack · 64 tokens

git-worktree

Manage isolated Git worktrees under one repository convention root. Create a new-branch worktree, list trees, remove an owned tree, or show prune candidates after authorization. Before any git worktree add, ensure the repo .gitignore excludes the convention root, appending the planned line when it is missing. Use for…

bahayonghang/my-ai-cli-toolkit · 135 tokens

humanizer-zh

Use when removing AI writing痕迹 from Chinese text to make it sound more natural and human-written.

oyi77/1ai-skills · 26 tokens