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.
npx skills add agent-rig/rig --skill rig-worktreegit clone --depth 1 https://github.com/agent-rig/rigWrote 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.
[](https://agentmods.dev/skills/agent-rig/rig/rig-worktree)<a href="https://agentmods.dev/skills/agent-rig/rig/rig-worktree"><img src="https://agentmods.dev/badge/skills/agent-rig/rig/rig-worktree/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.
<a href="https://agentmods.dev/skills/agent-rig/rig/rig-worktree"><img src="https://agentmods.dev/badge/skills/agent-rig/rig/rig-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00103 | $0.02464 |
| Opus 5.5 | $0.00041 | $0.00986 |
| Sonnet 5.5 | $0.00021 | $0.00493 |
| Haiku 4.5 | $0.00010 | $0.00246 |
Grade A, and why
rig-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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Worktree — isolated dev checkout lifecycle
Create / list / remove isolated git worktrees under .claude/worktrees/.
Creation produces a worktree that's actually ready to run: fetched from
origin, branched from the right base, env files symlinked, dependencies
installed. This is a shared bootstrap you can call directly (spikes,
ad-hoc branches, parallel experiments) and that implement-style flows and
prune/rig-tidy steps can delegate to.
The logic lives in two scripts so the invariants live in one place:
<SCRIPTS>/setup-worktree.sh (create) and
<SCRIPTS>/remove-worktree.sh (teardown), where <SCRIPTS> is resolved
per install (see Configuration). Creation encodes
three invariants that bite if skipped — fetch-before-branch (stale
local refs silently start you on a pre-merge tip), env symlinks (missing
secrets read as flaky/timeout test failures, not "config not found"),
and a per-worktree dependency install (installed deps don't carry across
worktrees → Cannot find package '...'). Don't reimplement these
inline; call the scripts.
Configuration
Script location (<SCRIPTS>). Where the helper scripts live depends on
which target installed them, so resolve — don't assume — from the repo root
(git rev-parse --show-toplevel), first hit wins:
.claude/scripts/— theclaude-codetarget (on a dual-target install this is a symlink at.rig/scripts/, so either entry finds the same file)..rig/scripts/— theagents-mdtarget (Codex, Cursor, Gemini CLI, …), where there is no.claude/at all.
If neither holds setup-worktree.sh, say so and stop rather than
reimplementing the script inline — its invariants are the whole point.
Reads .rig/config.json (missing keys → defaults):
| Key | Default | Used for |
|---|---|---|
vcs.baseRef |
origin/main |
Default --base the worktree branches from. |
vcs.branchConvention |
{user}/{ticket}-{slug} |
Template when inferring a branch name from a ticket ID. |
vcs.defaultBranch |
main |
The trunk (informational; the main worktree). |
runtime.installCommand |
derived from packageManager |
Passed to the setup script as --install-cmd. |
runtime.packageManager |
npm |
Derives the install command when installCommand is unset (bun→bun install, pnpm→pnpm install, yarn→yarn, npm→npm install, none→skip install). |
tracker.ticketPrefix |
— | Recognizing a ticket ID (e.g. ABC-521) to slot into the branch template. |
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.
- 3mo ago Changed · +21 lines 9d292fd08313
- 3mo ago First seen · 169 lines · 103 tokens per session scan A 8ba3ac18b499
rig-worktree is a skill published in the GitHub repository agent-rig/rig (4 stars, last pushed 1mo ago), licensed MIT. It adds 103 tokens to every session and 2,464 once invoked, about $0.0004 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-08-31.
rig-worktree compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rig-worktreeagent-rig/rig | Skill | 4 | 1mo ago | MIT | A | 103 | Claude Code |
| coco-shipcoco-research/coco | Skill | 324 | today | Apache-2.0 | A | 69 | Claude Code |
| pmstudio-changelogcoco-research/coco | Skill | 324 | today | Apache-2.0 | A | 98 | Claude Code, Codex |
| skill-evolutioncoco-research/coco | Skill | 324 | today | Apache-2.0 | A | 82 | Claude Code, Codex |
| cloudron-app-publishingmarcusquinn/aidevops | Skill | 481 | today | MIT | B | 18 | Claude Code |
| gsd-forensicscoco-research/coco | Skill | 324 | today | Apache-2.0 | A | 53 | Claude Code |
| gsd-quickcoco-research/coco | Skill | 324 | today | Apache-2.0 | A | 62 | Claude Code |