worktree

worktree is a skill for Claude Code, Codex from tony/skills. It costs 24 tokens per session (3,140 once invoked), scanned A, a copy of action-worktree, MIT.

A Git workflow for taking one ticket, or a closely related group of tickets, into its own branch and Git worktree. A worktree is a separate working copy of the same repository.

In plain words
What is it for?
Use it to resolve a ticket, create its isolated worktree, implement the change, run required checks, and create commits.
Why use it?
It keeps ticket work isolated from the current files and branch while following the team’s branch and commit conventions.

Skill for Claude CodeCodex

Part of the action plugin — 2 skills shipped together

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

Made for: Claude Code, Codex.

Or install action, the plugin that ships this one along with the rest of its 2 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

README.md
[![agentmods](https://agentmods.dev/badge/skills/tony/skills/worktree.svg)](https://agentmods.dev/skills/tony/skills/worktree)
Your own site
<a href="https://agentmods.dev/skills/tony/skills/worktree"><img src="https://agentmods.dev/badge/skills/tony/skills/worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,140 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 97% copy Near-identical to another mod 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.00024 $0.03140
Opus 5 $0.00012 $0.01570
Sonnet 5 $0.00005 $0.00628
Haiku 4.5 $0.00002 $0.00314

Measured yesterday against content hash e36b6aab60e1, 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 yesterday.

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.

Origin

This is a copy

97% identical to action-worktree — 41 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/action/skills/worktree/SKILL.md · 276 lines

How it starts

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

/action:worktree

Take one or more tickets to a working branch in its own git worktree. Resolve the ticket(s) read-only, name the branch the way the team actually names branches, create the worktree beside the repo (or in a temp root), implement, and land gated commits — pushing or opening a PR only when asked.

One worktree, one branch, one deliverable — carrying one ticket by default, and several when they genuinely share a change. Crosscutting is first-class, not an error.

This skill is invoked by name, never routed to on the model’s initiative: it creates worktrees and branches, modifies files, and creates commits, so it must be user-explicit, not router-inferred. To land review findings on the current branch, use /respond:action; this command starts ticket work on a new branch.

/action:worktrees delegates to this file's phases by name and number. When renaming, renumbering, or reordering phases here, update that file's references in the same change; on any disagreement between the two files, this one wins.

Core thesis

A ticket describes an outcome; a branch is the unit of delivery. This command is the plumbing between the two, done the way the tracker and the team already expect: the branch name carries the ticket ID so linking happens server-side, the worktree keeps the main checkout untouched, and the gates keep every commit green.

Three disciplines:

  1. Tickets are read-only. Resolution pulls title, description, acceptance criteria, and the branch-name field — and writes nothing back (see The Iron Rule).
  2. Names follow the precedence ladder. Explicit ask > project conventions > ticket-system default > observed repo norms > slug fallback — per ../../references/ticket-detection.md.
  3. The main checkout is never disturbed. All work happens in the worktree; the default exit is a gated commit, not a push.

The Iron Rule

TICKETS ARE READ-ONLY

Neither resolution nor any later phase writes to a ticket — no assign, no comment, no state transition, no label, no estimate, no gh issue develop; every tracker operation is a read. Linking rides on names, server-side, so an abandoned branch unwinds with nothing to undo. The full forbidden-operations list and rationale: ../../references/ticket-detection.md § The read-only invariant.

Read the full file on GitHub · 276 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. yesterday First seen · 276 lines · 24 tokens per session scan A e36b6aab60e1

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository tony/skills (2 stars, last pushed 6d ago), licensed MIT. It adds 24 tokens to every session and 3,140 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 97% identical to action-worktree, differing in 41 lines, and is treated as a copy.

Related

Other skills, from other repositories

postgres-database-migration

Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases. Trigger when user asks to: Test a schema migration before applying it to production Add, remove, or rename columns safely on a live table Change a column's data…

timescale/pg-aiguide · 220 tokens

design-postgis-tables

Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications.

timescale/pg-aiguide · 31 tokens

migrate-postgres-tables-to-hypertables

Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation. Trigger when user asks to: Migrate or convert PostgreSQL tables to hypertables Execute hypertable migration with minimal downtime Plan blue-green migration for large tables Validate…

timescale/pg-aiguide · 181 tokens

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…

timescale/pg-aiguide · 190 tokens

setup-timescaledb-hypertables

Use this skill when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data. Use this to improve the performance of any insert-heavy table. Trigger when user asks to: Create or design SQL schemas/tables AND…

timescale/pg-aiguide · 219 tokens

postgres-hybrid-text-search

Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…

timescale/pg-aiguide · 162 tokens