worktree-enhanced

worktree-enhanced is a skill for Claude Code from jerseycheese/agent-skills. It costs 97 tokens per session (2,351 once invoked), scanned A, original, MIT.

A workflow for creating a separate Git worktree, which is an additional checkout of a repository for isolated development. It also handles the branch, project setup, environment files, and development-server coordination.

In plain words
What is it for?
Use it to start work on a new branch, issue, feature, or bug fix in isolation, with project-specific setup handled automatically.
Why use it?
It keeps feature or bug-fix work separate from the current checkout and helps avoid conflicts between development servers or parallel tasks.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: names the TodoWrite tool; positional $N argument.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is PORT="$(node scripts/worktree-port.cjs)".

Part of the workflow-skills plugin — 31 skills shipped together

Good fit Use it to start work on a new branch, issue, feature, or bug fix in isolation, with project-specific setup handled automatically.

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/jerseycheese/agent-skills
agentmods
npx agentmods add skills/jerseycheese/agent-skills/worktree-enhanced

Made for: Claude Code.

Or install workflow-skills, the plugin that ships this one along with the rest of its 31 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jerseycheese/agent-skills/worktree-enhanced.svg)](https://agentmods.dev/skills/jerseycheese/agent-skills/worktree-enhanced)
Your own site
<a href="https://agentmods.dev/skills/jerseycheese/agent-skills/worktree-enhanced"><img src="https://agentmods.dev/badge/skills/jerseycheese/agent-skills/worktree-enhanced.svg" alt="Measured on agentmods" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,351 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.00097 $0.02351
Opus 5 $0.00048 $0.01175
Sonnet 5 $0.00019 $0.00470
Haiku 4.5 $0.00010 $0.00235

Measured 8d ago against content hash a6efdd3fc259, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

worktree-enhanced 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 8d 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.

skills/worktree-enhanced/SKILL.md · 332 lines

How it starts

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

Enhanced Worktree Workflow

When to Use This Skill

Use this skill when:

  • Starting work on a new feature or bug fix
  • Need isolation from current workspace
  • Want parallel development on multiple issues
  • Executing implementation plans that require clean state

This skill handles the full worktree setup workflow with:

  • Dev server detection and coordination
  • Local env file propagation from the main checkout
  • Automatic dev server startup option
  • Project-specific worktree conventions

Enhanced Features

1. Dev Server Awareness

Every worktree gets its own dev-server port — never assume port 3000 belongs to the worktree you're in. If the project has adopted the per-worktree port pattern (scripts/worktree-port.cjs, installed by install-worktree-port.sh), resolve the port before checking it:

# Resolve this checkout's port: the per-worktree script if the project has it
# installed, else the port recorded in .claude/launch.json, else 3000 (the
# main-checkout default)
if [ -f scripts/worktree-port.cjs ]; then
  PORT="$(node scripts/worktree-port.cjs)"
else
  PORT="$(node -p "require('./.claude/launch.json').configurations[0].port" 2>/dev/null || echo 3000)"
fi

DEV_SERVER_PID=$(lsof -ti:"$PORT")

if [ -n "$DEV_SERVER_PID" ]; then
  echo "Dev server already running on port $PORT (PID: $DEV_SERVER_PID)"
else
  echo "No dev server running on port $PORT yet"
fi

If the project has no per-worktree port scripts yet, run install-worktree-port.sh <project-dir> (in shared/Development/tools/dev-server/) before creating more worktrees — otherwise every worktree's npm run dev fights over the same port.

2. Worktree Creation

# Standard worktree creation from base skill
git worktree add [path] -b [branch] [base-branch]

# Copy ignored local env files from the main checkout, if present. These files
# stay untracked, but worktrees need the same server-side keys and feature flags.
main_worktree="$(git worktree list --porcelain | awk '
  /^worktree / { path = substr($0, 10) }
  /^branch / && $2 !~ /worktrees/ {
    print path
    exit
  }
')"

for env_file in .env.local .env.development.local .env.test.local; do
  if [ -n "$main_worktree" ] &&
     [ "$main_worktree" != "[worktree-path]" ] &&
     [ -f "$main_worktree/$env_file" ] &&
     [ ! -f "[worktree-path]/$env_file" ]; then
    cp "$main_worktree/$env_file" "[worktree-path]/$env_file"
    echo "Copied $env_file from main checkout"
  fi
done

# Enhanced: Offer dev server startup
cd [worktree-path]

# Check if package.json exists
if [ -f package.json ]; then
  echo "Found package.json"
  echo ""
  echo "Dev server options:"
  echo "(a) Start dev server now (runs in background, on this worktree's own port)"
  echo "(b) Skip (I'll start it manually later)"
  echo "(c) Just point the browser at the main workspace's already-running server"

  # If user chooses (a):
  echo "Starting dev server in background..."
  npm run dev > dev-server.log 2>&1 &
  echo "Dev server started (PID: $!)"
  echo "Logs: tail -f dev-server.log"
fi

Read the full file on GitHub · 332 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. 8d ago First seen · 332 lines · 97 tokens per session scan A a6efdd3fc259

Subscribe to this mod's changes

worktree-enhanced is a skill published in the GitHub repository jerseycheese/agent-skills (1 stars, last pushed 6d ago), licensed MIT. It adds 97 tokens to every session and 2,351 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories

lov-gh-access

Open a private GitHub repo to external clients or contractors without making it public. Accepts a mixed list of GitHub usernames and/or email addresses, resolves each to a GitHub account (falling back to an email invitation when the user has no discoverable account yet), and invites them as collaborators with a chosen…

lovstudio/skills · 151 tokens

lov-gh-tidy

Interactive GitHub repo hygiene skill. Lists all open issues, PRs, stale branches, and orphan labels, shows a summary of each with analysis, then asks the user how to handle each item (close, merge, comment, delete, keep). Executes all chosen actions via gh CLI. Use when the user says "清理 GitHub", "tidy repo", "clean…

lovstudio/skills · 95 tokens

intuitive-squash

Squash local GSD or agent-generated commit history into a clean, reviewable story while preserving important fixes. Use when the user asks to squash commits, clean git history, compress phase commits, prepare a branch before PR, compare aggressive vs moderate squash options, or preserve hotfix/security commits during…

MiaoDX/intuitive-flow · 73 tokens

campaign-commit

Choose the correct commit command in a camp, also called a campaign. Use when you are about to commit and need to select camp commit, camp p commit, fest commit, or intentional root pointer sync via camp refs-sync.

Obedience-Corp/festival · 53 tokens

fest-execution

Execute active festival tasks. Use when finding the next task, marking tasks completed/blocked/reset, committing with festival traceability, advancing workflow steps, and validating sequence progress.

Obedience-Corp/festival · 38 tokens

camp-projects

Manage a camp's projects. Use when committing inside projects/, deciding status/pull/push scope (root vs submodule vs all), or creating/removing project worktrees.

Obedience-Corp/festival · 41 tokens