worktrees

worktrees is a skill for Claude Code, Codex from alvinunreal/oh-my-opencode-slim. It costs 23 tokens per session (1,487 once invoked), scanned A, original, MIT.

A workflow for using Git worktrees, which are separate working folders linked to one repository, as isolated coding lanes.

In plain words
What is it for?
Use it to plan worktree locations and branches, assign work to isolated lanes, check changes before merging, and clean up finished lanes.
Why use it?
It keeps parallel features, risky experiments, and review work separate so changes are easier to inspect and combine safely.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions OpenCode.

About the project

oh-my-opencode-slim is a plugin that coordinates multiple specialized AI agents inside OpenCode, assigning codebase exploration, documentation research, architecture review, design, and implementation to different agents. It is for developers who want agent teams to divide and reconcile software-development work while mixing models from different providers. The catalogue entries are the plugin’s bundled agents, skills, and instruction.

alvinunreal/oh-my-opencode-slim · 8,655 stars · on GitHub · ohmyopencodeslim.com

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/alvinunreal/oh-my-opencode-slim/worktrees
Any agent
npx skills add alvinunreal/oh-my-opencode-slim --skill worktrees
Clone the repo
git clone --depth 1 https://github.com/alvinunreal/oh-my-opencode-slim

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 worktrees

README.md
[![agentmods](https://agentmods.dev/badge/skills/alvinunreal/oh-my-opencode-slim/worktrees.svg)](https://agentmods.dev/skills/alvinunreal/oh-my-opencode-slim/worktrees)
Your own site
<a href="https://agentmods.dev/skills/alvinunreal/oh-my-opencode-slim/worktrees"><img src="https://agentmods.dev/badge/skills/alvinunreal/oh-my-opencode-slim/worktrees.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,487 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00023 $0.01487
Opus 5 $0.00012 $0.00744
Sonnet 5 $0.00005 $0.00297
Haiku 4.5 $0.00002 $0.00149

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

Security

Grade A, and why

worktrees 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 7d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • worktrees — 89% identical, 25 lines differ
src/skills/worktrees/SKILL.md · 174 lines

How it starts

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

Worktrees Orchestration Protocol

The worktrees skill provides an opinionated, safe orchestration protocol for managing Git worktrees as isolated coding lanes. Its value is giving the Orchestrator a consistent OMO workflow for parallel agents, risky experiments, integration review, and cleanup.

Core Contract

This is an orchestrator-only workflow. Other specialists such as @fixer or @designer can be assigned tasks inside a worktree lane, but the Orchestrator owns lane planning, branch/path selection, file ownership, delegation, diff validation, integration, and cleanup.

All worktrees reside under the default path:

.slim/worktrees/<slug>/

Do not create worktrees as sibling directories of the main repository.

State Tracking (.slim/worktrees.json)

Use the optional local metadata manifest .slim/worktrees.json to maintain structural tracking:

{
  "version": "1.0.0",
  "updatedAt": "2026-06-14T00:00:00.000Z",
  "lanes": [
    {
      "slug": "feature-auth-v2",
      "branch": "omos/feature-auth-v2",
      "path": ".slim/worktrees/feature-auth-v2",
      "base": "main",
      "purpose": "refactor authentication flow to use OAuth2",
      "owner": "orchestrator",
      "status": "active",
      "areas": ["src/auth", "src/config"],
      "createdAt": "2026-06-14T12:00:00.000Z"
    }
  ]
}

If .slim/worktrees.json does not exist, create it when initializing a lane, and keep it updated as lanes are transitioned, integrated, or pruned. Treat it as local workflow metadata by default; ask before making it part of a committed project convention.


Safety Guidelines

Before executing any Git mutation command, the Orchestrator must observe the following guards:

1. Pre-Flight Checklist

  • Confirm the current directory is inside a Git repository.
  • Check the current branch, base branch, and dirty/uncommitted state.
  • Inspect the output of git worktree list to avoid path or branch conflicts.
  • Ensure the branch name (e.g. omos/<slug> or custom project convention) does not already exist locally or on remote.
  • Ensure .slim/worktrees/ is ignored by Git before creating nested worktrees.

Read the full file on GitHub · 174 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. 7d ago First seen · 174 lines · 23 tokens per session scan A 09c9b694ff34

Subscribe to this mod's changes

worktrees is a skill published in the GitHub repository alvinunreal/oh-my-opencode-slim (8,655 stars, last pushed yesterday), licensed MIT. It adds 23 tokens to every session and 1,487 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories