os-control-worktree

os-control-worktree is a skill for Claude Code from richfrem/agent-plugins-skills. It costs 29 tokens per session (618 once invoked), scanned A, original, MIT.

A worktree manager for creating an isolated copy of a Git project for a task. A Git worktree lets you work on another branch in a separate directory while keeping the main checkout available.

In plain words
What is it for?
Use it to create task worktrees from the latest remote main branch, validate their location, and prepare them for controlled development and merging.
Why use it?
It checks the available worktree method, places fallback worktrees safely, and preserves the same approval and review rules. It also helps reconcile changes before merging.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the agent-agentic-os plugin — 14 skills, 2 agents, 3 hooks shipped together

Good fit Use it to create task worktrees from the latest remote main branch, validate their location, and prepare them for controlled development and merging.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/richfrem/agent-plugins-skills/os-control-worktree
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 richfrem/agent-plugins-skills --skill os-control-worktree
Clone the repo
git clone --depth 1 https://github.com/richfrem/agent-plugins-skills

Made for: Claude Code.

Or install agent-agentic-os, the plugin that ships this one along with the rest of its 14 skills, 2 agents, 3 hooks.

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 os-control-worktree

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/richfrem/agent-plugins-skills/os-control-worktree"><img src="https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/os-control-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 618 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.00029 $0.00618
Opus 5.5 $0.00012 $0.00247
Sonnet 5.5 $0.00006 $0.00124
Haiku 4.5 $0.00003 $0.00062

Measured yesterday against content hash dd5700aa7d4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

os-control-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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/capability_probe.py, scripts/worktree_manager.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/agent-agentic-os/skills/os-control-worktree/SKILL.md · 57 lines

How it starts

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

Worktree Manager

Selects confirmed native worktree facilities or the governed portable repository worktree fallback, validates placement, and reports cleanup guidance.

Contents

Critical Constraints

  1. Origin Base Invariant: Before creating any worktree, run git fetch origin main and base new branches on origin/main — never on local main.
  2. Path Confinement: Portable worktrees must reside strictly below <repo>/.worktrees/<task-id>.
  3. Governance Equivalence: Native worktree execution is an implementation facility, not a governance bypass. Both native and portable execution require identical approval, verification, and review gates.
  4. Reconciliation & Concurrency: Never assume pre-worktree dirty state or concurrent branches carry over automatically. APPROVED -> IN_WORKTREE requires deterministic reconciliation (main_worktree_reconciliation). Rebase onto fresh origin/main immediately before merging.

Quick start

Probe the active runtime to determine available worktree facilities:

python3 scripts/capability_probe.py

Workflow

  1. Probe Runtime: Run capability_probe.py and treat returned capability as authoritative. Never infer native support from model name or binary presence.
  2. Select Facility:
    • If native_worktree is true: follow returned activation guidance and retain task control-plane gates.
    • If portable fallback: generate execution plan via scripts/worktree_manager.py and delegate lifecycle management to issue-worktree-agent.
  3. Reconcile Base & State: Fetch origin/main and verify base commit. If migrating uncommitted edits, run deterministic reconciliation.
  4. Report & Activate: Report selected strategy, exact path, branch, activation guidance, and cleanup commands before mutating repository.

Verification

Read the full file on GitHub · 57 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 57 lines · 29 tokens per session scan A dd5700aa7d4e

Subscribe to this mod's changes

os-control-worktree is a skill published in the GitHub repository richfrem/agent-plugins-skills (7 stars, last pushed 2d ago), licensed MIT. It adds 29 tokens to every session and 618 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-10-16.

Related

Other skills, from other repositories

release

Cut and publish a full stable NAC release after main, release-PR, and publication CI pass. Use when a maintainer asks for a stable version bump, tag, or GitHub Release. Never use for release candidates; NAC RC releases are automated.

arcee-ai/nac · 53 tokens

triage

Triage a GitHub repository's open issues by finding exact duplicates, rejecting evidenceably off-base requests, requesting concrete clarification, applying only existing labels, and opening a linked root-cause issue when multiple reports share one underlying invariant failure. Use when a maintainer asks to triage…

arcee-ai/nac · 65 tokens

factory-handoff

Hand one exact agent-ready ticket to the central Factory runtime over the configured SSH forced-command boundary. Use when an operator asks to hand off an existing ticket or a prose request instead of implementing it in the current session.

watt-mind/factory · 47 tokens

gh-find-prs

Survey open Codewhale PRs and triage each for mergeability and disposition against the real landing branch.

Hmbown/CodeWhale · 27 tokens

release-revoke

Revoke or rollback a pi-agent-dashboard release: delete the GitHub Release, remove the git tag locally and on origin, deprecate the npm version (npm unpublish is blocked after 72h), and optionally revert the release commit. Use when the user says "revoke release", "rollback release", "delete release", "unpublish…

BlackBeltTechnology/pi-agent-dashboard · 85 tokens

ap-work-group-manager

Divide one accepted work group only when at least two useful workers can have non-overlapping ownership.

Spielewoy/autoprompt-skill · 24 tokens