worktree

worktree is a skill for Claude Code, Codex from get-bb/bb. It costs 33 tokens per session (940 once invoked), scanned A, original, MIT.

A tool for inspecting and changing a pool of ready Git worktrees. A worktree is a separate working directory for a branch; the pool prepares some in advance for new threads.

In plain words
What is it for?
Use it to view the pool, set its size, or turn it off for a project.
Why use it?
It can remove setup waiting for new work on the default branch, while showing when prepared worktrees are outdated or being rebuilt.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to view the pool, set its size, or turn it off for a project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/get-bb/bb/worktree
About the project

bb is an agentic IDE that lets users control, customize, and automate a software-development environment through a desktop app, web app, command-line interface, or HTTP API. Developers use it to run work in observable threads that can be steered or handed off to other agents. Its catalogue add-ons provide skills and instructions for working with bb.

get-bb/bb · 6,182 stars · on GitHub · getbb.app

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.

Any agent
npx skills add get-bb/bb --skill worktree
Clone the repo
git clone --depth 1 https://github.com/get-bb/bb

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/get-bb/bb/worktree/github.svg)](https://agentmods.dev/skills/get-bb/bb/worktree)
Your own site
<a href="https://agentmods.dev/skills/get-bb/bb/worktree"><img src="https://agentmods.dev/badge/skills/get-bb/bb/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.

agentmods 80×15 button for worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/get-bb/bb/worktree"><img src="https://agentmods.dev/badge/skills/get-bb/bb/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 940 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.00033 $0.00940
Opus 5.5 $0.00013 $0.00376
Sonnet 5.5 $0.00007 $0.00188
Haiku 4.5 $0.00003 $0.00094

Measured 5d ago against content hash 0918f889a314, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 5d 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.

plugins/environment-git-worktree/skills/worktree/SKILL.md · 67 lines

What it actually says

Warm worktrees

Use bb worktree pool status --json to see which projects keep warm worktrees, how many are ready or preparing on each checkout, the default base they sit on, and how many threads took one or missed since the server started.

bb worktree pool status [--json]
bb worktree pool set <project-id> <size> [--host <host-id>] [--json]
bb worktree pool folders <project-id> [<folder>...] [--host <host-id>] [--json]

size is 0 to 4 per checkout; 0 turns the pool off and deletes its idle worktrees. Without --host it sets the project's count, which every machine with a checkout keeps. With --host (an id from bb host list) it sets that machine's own count, which wins over the project's; the size project makes the machine follow the project's count again. Status JSON gives each checkout's effective size and its own hostSize (null when it follows the project). Resolve the project id with bb project list. Only turn a pool on when the user asks for it: each warm worktree runs the project's .bb-env-setup.sh in the background, and it is replaced every eight hours or when the default branch is rewritten.

Only new worktree threads on the default base take a warm worktree. bb reads the remote's current default base with git ls-remote while the title is generated (falling back to the last fetched base when the remote can't be reached). A warm worktree at that commit starts the thread without setup; one behind it is fast-forwarded to that commit and .bb-env-setup.sh runs again before the thread starts, so the thread always starts on the current base with setup run against it. Named bases, existing worktrees and restores build a fresh worktree, and so does a thread that finds no usable warm worktree.

A worktree thread can also branch the project's other git repositories (bb project folder list <project-id>). List them in the inputs: bb thread spawn --environment-provider git-worktree --environment-inputs '{"branch":{"kind":"default"},"folders":["/abs/folder"]}'. Each listed folder gets its own worktree next to the main one, on the thread's branch and from that repository's default branch, and the thread works in that worktree instead of the shared folder; folders not listed stay shared. Each new folder worktree runs its own .bb-env-setup.sh before the main worktree's, in the order listed, and its .bb-env-teardown.sh after the main one's. Removing the environment removes every worktree and the branches bb made.

bb worktree pool folders <project-id> <folder>... makes the project's warm worktrees also branch those folders, with every setup finished; list no folders to stop. Folders are set per machine, because each machine's checkout has its own folder paths: pass --host <host-id> when the project has checkouts on more than one machine, and list that machine's paths (bb project folder list <project-id> --machine <host-id>). A warm worktree goes only to a new thread that branches exactly the same folders, so set the pool's folders to the set threads usually pick. Others build fresh worktrees; members with other folders are replaced. On handoff, a folder worktree behind its repository's default branch is fast-forwarded and its .bb-env-setup.sh runs again, then the main worktree's; folders that did not move are not set up again.

Warm worktrees are ordinary environments held by the Worktree plugin: bb environment list --held-by plugin:environment-git-worktree lists them, and bb thread spawn --environment <id> refuses them. A failed one is deleted and its error shows in status; refills then wait ten minutes. Deleting the project or removing the machine removes them like any other environment, and disabling or uninstalling the Worktree plugin releases them.

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. 5d ago Changed · +29 lines 0918f889a314
  2. 6d ago First seen · 38 lines · 33 tokens per session scan A 7123cf6dd0e8

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository get-bb/bb (6,182 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 940 once invoked, about $0.0001 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-11-24.

Related

worktree compared with skills from other repositories

worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktreeget-bb/bbSkill6.2ktodayMITA33Claude Code, Codex
configuring-grovebearlike/GroveSkill912d agoMITB92Claude Code
develop-inspection-featureexplyt/spring-pluginSkill1705d agoApache-2.0A103Claude Code, Codex
working-in-grovebearlike/GroveSkill912d agoMITA100Claude Code
orca-clisutchan/Agent-Skills-HubSkill36d agoMITA14Claude Code, Codex
conventional-commitJanDeDobbeleer/oh-my-poshSkill24k4d agoMITA26Claude Code, Codex
Dotfilesdanielmiessler/LifeOSSkill20k11d agoMITA125Claude Code, Codex