worktrees

worktrees is a skill for Claude Code from mifunedev/openharness. It costs 124 tokens per session (2,646 once invoked), scanned B, original, Apache-2.0.

A Git worktree manager for keeping multiple working copies of a repository in separate folders. It also covers project clones stored under a projects directory.

In plain words
What is it for?
Use it to create, list, remove, clean, audit, or isolate Git worktrees, and to clone projects into the expected folder structure.
Why use it?
It helps prevent changes in one checkout from being confused with changes in another. It also provides rules for reviewing, preserving, cleaning up, and removing old worktrees safely.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument; mentions AGENTS.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash .oh/scripts/git-maintenance.sh worktree-remove "$WORKTREES_ROOT/$BRANCH".

Good fit Use it to create, list, remove, clean, audit, or isolate Git worktrees, and to clone projects into the expected folder structure.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/mifunedev/openharness
agentmods
npx agentmods add skills/mifunedev/openharness/worktrees

Made for: Claude Code.

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/mifunedev/openharness/worktrees/github.svg)](https://agentmods.dev/skills/mifunedev/openharness/worktrees)
Your own site
<a href="https://agentmods.dev/skills/mifunedev/openharness/worktrees"><img src="https://agentmods.dev/badge/skills/mifunedev/openharness/worktrees/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 worktrees

Your own site · 80×15
<a href="https://agentmods.dev/skills/mifunedev/openharness/worktrees"><img src="https://agentmods.dev/badge/skills/mifunedev/openharness/worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,646 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 204
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00124 $0.02646
Opus 5.5 $0.00050 $0.01058
Sonnet 5.5 $0.00025 $0.00529
Haiku 4.5 $0.00012 $0.00265

Measured 2mo ago against content hash 1332c073e1b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

worktrees scanned grade B with 1 finding 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 2mo 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.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

work must not be removed with `rm -rf`.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.oh/skills/worktrees/SKILL.md · 265 lines

How it starts

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

Worktrees

Manage .worktrees/ and projects/. Full policy: /git § Worktrees.

A repository's worktrees live at that repository's own root, in .worktrees/. The harness is the first instance of that rule; a project clone under projects/ follows it too, in projects/<owner>/<repo>/.worktrees/.

CHANGE ROUTING — TRACK VS RESET

~/harness and $PROJECTS_ROOT/<owner>/<repo> are different Git boundaries. The parent harness ignores the latter; a project clone's files are never changes to the harness. Classify changes before committing, resetting, or removing anything. A dirty checkout is not disposable merely because it lives under .worktrees/.

~/harness — harness control plane

Track/preserve deliberate, durable harness changes, including:

  • .oh/skills/, .oh/hooks/, .oh/scripts/, .devcontainer/, .github/, docs, templates, and supported configuration defaults.
  • .worktrees/AGENTS.md, projects/AGENTS.md, and other lifecycle documentation.
  • Curated wiki entries and the wiki index when intentionally promoted. The wiki corpus is ignored by default; use git add -f only for reviewed entries. Never promote corpus/raw/ snapshots by accident.
  • A handoff only when it is deliberately shared, scrubbed of secrets, and meant to be durable in this harness checkout or its private operator fork.

Reset/remove only known local, generated, or abandoned state, such as:

  • worktree contents, task progress, memory/log state, plans/spec scratch, screenshots, build output, dependencies, local env/auth files, and caches covered by .gitignore;
  • an explicit operator-local setting or a tracked edit that was reviewed and rejected.

Do not reset a tracked source/config/doc change just because it is unstaged, and do not delete an untracked file before inspecting it. For root state, inspect both index and worktree changes:

git -C ~/harness status --short --untracked-files=all
git -C ~/harness diff --name-status
git -C ~/harness diff --cached --name-status

Read the full file on GitHub · 265 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. 2mo ago Changed 1332c073e1b9
  2. 3mo ago First seen · 265 lines · 124 tokens per session scan B b092e8f9375e

Subscribe to this mod's changes

worktrees is a skill published in the GitHub repository mifunedev/openharness (37 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 124 tokens to every session and 2,646 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

worktrees compared with skills from other repositories

worktrees next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktreesmifunedev/openharnessSkill372mo agoApache-2.0B124Claude Code
safetylangchain-ai/deepagentsSkill32ktodayMITA48Claude Code, Codex
data-visualizationlangchain-ai/deepagentsSkill32ktodayMITA40Claude Code, Codex
cuml-machine-learninglangchain-ai/deepagentsSkill32ktodayMITA43Claude Code, Codex
blog-postlangchain-ai/deepagentsSkill32ktodayMITA58Claude Code, Codex
rememberlangchain-ai/deepagentsSkill32ktodayMITA71Claude Code, Codex
cudf-analyticslangchain-ai/deepagentsSkill32ktodayMITA51Claude Code, Codex