worktrees

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 CodeCodex

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

Made for: Claude Code, Codex.

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,652 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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 $0.00124 $0.02652
Opus 5 $0.00062 $0.01326
Sonnet 5 $0.00025 $0.00530
Haiku 4.5 $0.00012 $0.00265

Measured 2d ago against content hash b092e8f9375e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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/agents/, .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. 2d 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 (36 stars, last pushed 2d ago), licensed Apache-2.0. It adds 124 tokens to every session and 2,652 once invoked, about $0.0006 per session on Opus 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

Other skills, from other repositories

data-visualization

Use for creating publication-quality charts and multi-panel analysis summaries. Triggers when tasks involve visualizing data, plotting results, creating charts, or producing visual reports from analysis output.

langchain-ai/deepagents · 40 tokens

cuml-machine-learning

Use for GPU-accelerated machine learning on tabular data using NVIDIA cuML. Triggers when tasks involve classification, regression, clustering, dimensionality reduction, or model training on datasets.

langchain-ai/deepagents · 43 tokens

blog-post

Writes and structures long-form blog posts, creates tutorial outlines, and optimizes content for SEO with cover image generation. Use when the user asks to write a blog post, article, how-to guide, tutorial, technical writeup, thought leadership piece, or long-form content.

langchain-ai/deepagents · 58 tokens

social-media

Drafts engaging social media posts, writes hooks, suggests hashtags, creates thread structures, and generates companion images. Use when the user asks to write a LinkedIn post, tweet, Twitter/X thread, social media caption, social post, or repurpose content for social platforms.

langchain-ai/deepagents · 58 tokens

remember

Review the current conversation and capture valuable knowledge — best practices, coding conventions, architecture decisions, workflows, and user feedback — into persistent memory (AGENTS.md) or reusable skills. Use when the user says: (1) remember this, (2) save what we learned, (3) update memory, (4) capture…

langchain-ai/deepagents · 71 tokens

textual-screenshot

Capture a Textual terminal UI as an SVG using its headless test harness. Use when asked to make, attach, or preview a screenshot of deepagents-code/dcode or another Textual app, visually verify a TUI state, or render a modal, screen, or widget without a desktop or browser.

langchain-ai/deepagents · 67 tokens