Agent skill

Worktree Agent

by notque in notque/vexjoy-agent

Mandatory rules for agents in git worktree isolation. An agent skill from notque/vexjoy-agent.

MITAuto-check passedDevelopment

Install Worktree Agent

skills CLI
$ npx skills add notque/vexjoy-agent --skill worktree-agent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install notque/vexjoy-agent worktree-agent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/notque/vexjoy-agent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/process/worktree-agent .claude/skills/worktree-agent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
worktree-agent
GitHub stars
435
Token cost
~1.5k tokens
SKILL.md length
626 words
Files
3 (incl. scripts)
Skills in repo
61
Repo updated
First seen
Licence
MIT

At a glance

Mandatory rules for agents in git worktree isolation. An agent skill from notque/vexjoy-agent.

  • Tasks that involve Git worktrees
  • SKILL.md covers Rule 1: Verify Your Working…, Rule 2: Create Feature Branch…, Rule 3: Use Worktree-Relative… and Rule 4: Ignore Auto-Plan Hooks, plus 9 more sections
  • Runs Python scripts from its folder; calls git, ruff and bash

What it does

Worktree Agent is an agent skill from notque/vexjoy-agent. Mandatory rules for agents in git worktree isolation.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `scripts/tests/test_worktree_capacity.py` and `scripts/worktree_capacity.py`).

It sits in Development, covering Git worktrees. It works with Git and Ruff. The repository describes itself as: VexJoy AI Agent with Jev Intelligent Routing - /do routes plain-English requests to the right specialist agent and gates the work with reviews, tests, and a learning loop. The licence is MIT.

When your agent uses it

  • Tasks that involve Git worktrees

Example prompts

  • “/worktree-agent”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 5218674. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • ruff
    • bash
    • python3
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Worktree Agent loads about 1.5k tokens when it runs. Until then it costs about 17 tokens; SKILL.md has 626 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~17
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from notque/vexjoy-agent at commit 5218674, republished under its MIT licence (© notque). 626 words, ~1,467 tokens.

Download SKILL.mdSave it as .claude/skills/worktree-agent/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
worktree-agent
description
Mandatory rules for agents in git worktree isolation.
promoted_to
do
user-invocable
false
context
fork
tags
worktree, isolation, parallel, agent
routing.triggers
worktree agent, git worktree, git worktree rules, isolated agent
routing.category
git-workflow

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

bash
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":

bash
# 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":

bash
# 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

bash
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

Use the commit message specified in your prompt. No attribution lines.

Rule 8: Run Both ruff Checks Before Declaring CI-Ready

For any Python code changes, run both checks before pushing or creating a PR:

bash
ruff check . --config pyproject.toml
ruff format --check . --config pyproject.toml

Running only ruff check misses formatting violations. The Tests / lint CI job runs both — if you skip ruff format --check, the PR will fail CI and cannot merge due to branch protection.

Rule 9: Run Preflight Check on Start

Run the preflight script at the start of any worktree task to confirm clean state:

bash
bash scripts/worktree-preflight.sh <intended-branch-name>

If it exits 1, fix the reported issue before proceeding.

Rule 10: Reserve disk capacity before creating a checkout

The dispatcher runs this before each implementation worktree:

bash
python3 ~/.claude/skills/process/worktree-agent/scripts/worktree_capacity.py \
  --repo "$(git rev-parse --show-toplevel)" --strict

The JSON report has three states:

StateDispatcher action
ready (<80% used)Create the one implementation checkout for the candidate.
cleanup-soon (80–<85%)Reclaim accepted clean checkouts before adding another. Use root read-only review work where possible.
blocked (≥85%)Integrate, deploy, verify, or reclaim; create no new checkout.

The report lists clean candidates only. The dispatcher confirms their task is inactive before removal because Git cleanliness alone does not prove that fact.

Show full SKILL.md (214 more words)Show less

Rule 11: Assign checkout roles deliberately

TaskCheckout policy
Source implementation or repairOne writable task worktree, reused through review corrections.
Code review, test-plan review, or read-only investigationRead the candidate through git diff or git show from the repository root; allocate no checkout.
Large repository implementationCreate a sparse worktree containing declared source/test/config scopes; include whole-repository content only when the task requires it.

For a sparse implementation checkout:

bash
git worktree add --no-checkout <worktree-path> -b <branch> <base-sha>
git -C <worktree-path> sparse-checkout init --no-cone
git -C <worktree-path> sparse-checkout set --no-cone <declared-path>...
git -C <worktree-path> checkout

Record any full-checkout reason in the dispatch handoff.

Post-Merge Cleanup

After integration or a PR merge, the dispatcher first confirms that the task is inactive and the checkout is clean, then runs:

bash
git worktree remove -- <accepted-worktree-path>
bash scripts/worktree-cleanup.sh --force

git worktree remove frees the materialized checkout while preserving its branch for recovery. The cleanup script then prunes stale .git/worktrees entries and removes merged harness branches.

Failure Modes This Prevents

FailureRuleWithout It
Agent edits main repo files1, 6Changes leak to main, get stashed/lost
Context wasted on task_plan.md4Implementation budget consumed by planning
Commit on wrong branch2Orchestrator merges wrong content
PR has changes from 2 ADRs5, 6Cross-contamination between agents
Branch locked by worktree2Fatal error on checkout
PR fails CI on format8Merge blocked; ruff format --check was skipped
New task fails to create worktree9Branch name collision from prior stale run

© notque, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in skills/process/worktree-agent of notque/vexjoy-agent.

  • SKILL.md
  • scripts/tests/test_worktree_capacity.py
  • scripts/worktree_capacity.py

Open the folder on GitHubat commit 5218674

Compare with similar skills

Worktree Agent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Worktree Agent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Worktree Agent this skillnotque/vexjoy-agent435—~1.5kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k33 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Saleor Commit Workflowsaleor/saleor23k—~575Automated safety check: PassBSD-3-Clause

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 33 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Commits changes in the Saleor codebase and works through pre-commit hook failures from ruff, mypy, the GraphQL schema check and the migrations check.

    23k GitHub stars~575 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated 10 days ago
    DevelopmentAuto-check passed

More from notque/vexjoy-agent

All 61 skills in this repo
  • Game Asset Generator

    notque/vexjoy-agent

    Deterministic palette/matrix pixel art (not AI). An agent skill from notque/vexjoy-agent.

    435 GitHub stars~2.3k tokensUpdated 4 days ago
    Auto-check: notes
  • PR Workflow

    notque/vexjoy-agent

    Pull request lifecycle: commit, codex review, sync, review, fix, status, cleanup, and PR mining.

    435 GitHub stars~2.8k tokensUpdated 4 days ago
    Auto-check: notes
  • Architecture Deepening

    notque/vexjoy-agent

    Improve architecture across modules by deepening interfaces.

    435 GitHub stars~3.3k tokensUpdated 4 days ago
    Auto-check: notes
  • Code Quality

    notque/vexjoy-agent

    Code quality: cleanup, linting, formatting, quality gates. An agent skill from notque/vexjoy-agent.

    435 GitHub stars~1.5k tokensUpdated 4 days ago
    Auto-check: notes
  • Codebase Analyzer

    notque/vexjoy-agent

    Statistical rule discovery from Go codebase patterns. An agent skill from notque/vexjoy-agent.

    435 GitHub stars~2k tokensUpdated 4 days ago
    Auto-check: notes
  • Comment Quality

    notque/vexjoy-agent

    Review and fix temporal references in code comments. An agent skill from notque/vexjoy-agent.

    435 GitHub stars~2k tokensUpdated 4 days ago
    Auto-check: notes

Works with

Categories

Questions about Worktree Agent

What does Worktree Agent do?

Mandatory rules for agents in git worktree isolation. An agent skill from notque/vexjoy-agent. Worktree Agent is an agent skill from notque/vexjoy-agent. Mandatory rules for agents in git worktree isolation.

When should I use Worktree Agent?

Worktree Agent fits situations like: tasks that involve Git worktrees.

How do I install Worktree Agent in Claude Code?

Run `npx skills add notque/vexjoy-agent --skill worktree-agent -a claude-code`. Or copy the skill folder (skills/process/worktree-agent in notque/vexjoy-agent) into .claude/skills/worktree-agent in your project. Claude Code loads it when a task matches its description.

How do I install Worktree Agent in Codex?

Run `npx skills add notque/vexjoy-agent --skill worktree-agent -a codex`. Or copy the skill folder (skills/process/worktree-agent in notque/vexjoy-agent) into .agents/skills/worktree-agent in your project. Codex loads it when a task matches its description.

Can I use Worktree Agent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add notque/vexjoy-agent --skill worktree-agent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/worktree-agent, .gemini/skills/worktree-agent, .github/skills/worktree-agent and .opencode/skills/worktree-agent in your project.

What does Worktree Agent need to run?

Going by SKILL.md and its folder, Worktree Agent needs Python for the scripts in its folder and the command-line tools its instructions call (git, ruff, bash, python3 and gh). Our summary lists: Python 3.

Does Worktree Agent access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Worktree Agent safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Worktree Agent use?

Worktree Agent is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Worktree Agent use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Worktree Agent?

Skills that share tags, products or a category with Worktree Agent: Finishing a Development Branch (obra/superpowers, 296k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Worktree Agent?

notque (a GitHub user) maintains it in notque/vexjoy-agent, which has 435 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on October 3, 2026.

Source: notque/vexjoy-agent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.