worktree-destruction-safety

worktree-destruction-safety is a skill for Claude Code from fmflurry/settings-opencode. It costs 39 tokens per session (2,867 once invoked), scanned C, original, MIT.

A safety procedure for deleting, moving, pruning, or removing a Git worktree, which is a separate checkout of the same repository. It treats removal as a potentially destructive data operation.

In plain words
What is it for?
Use it before destroying or moving a worktree, including through Git commands, agent tools, or direct filesystem deletion.
Why use it?
It helps prevent deleting uncommitted work that exists only in that worktree, including during automated cleanup. It also accounts for removal operations that may continue after a command returns.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it before destroying or moving a worktree, including through Git commands, agent tools, or direct filesystem deletion.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fmflurry/settings-opencode/worktree-destruction-safety
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 fmflurry/settings-opencode --skill worktree-destruction-safety
Clone the repo
git clone --depth 1 https://github.com/fmflurry/settings-opencode

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 worktree-destruction-safety

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/fmflurry/settings-opencode/worktree-destruction-safety"><img src="https://agentmods.dev/badge/skills/fmflurry/settings-opencode/worktree-destruction-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,867 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00039 $0.02867
Opus 5.5 $0.00016 $0.01147
Sonnet 5.5 $0.00008 $0.00573
Haiku 4.5 $0.00004 $0.00287

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

Security

Grade C, and why

worktree-destruction-safety scanned grade C 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 1mo 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 deletehighDestructive command

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

A worktree directory is the **only copy** of any uncommitted work inside it. Removing one is a destructive data operation, not bookkeeping — treat it with the same caution as `rm -rf`, never like `git branch -d`.
.claude/skills/worktree-destruction-safety/SKILL.md · 151 lines

How it starts

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

Worktree Destruction Safety (mandatory)

why-not-tooled: whether a checkout is safe to destroy depends on live git state, not a static analyzer.

A worktree directory is the only copy of any uncommitted work inside it. Removing one is a destructive data operation, not bookkeeping — treat it with the same caution as rm -rf, never like git branch -d.

Boundary with worktree-switching: that rule (where configured) governs entering, creating, and switching between worktrees. This rule governs their destruction — git worktree remove, git worktree prune, git worktree move, orca worktree rm, or any raw filesystem delete of a worktree directory. Read both; they do not overlap.

Why this exists

Two incidents shaped this rule. A raw git worktree remove --force + git worktree prune run outside Orca's pipeline destroyed a worktree with no trash step, so the content was not recoverable. Later, orca worktree rm returned before the removal finished ("removing": true). Orca always runs git worktree remove --force internally, whatever CLI flags are passed. During that background removal, the repo's main checkout received reset --hard and pull, which destroyed an uncommitted tracked edit and an untracked file. The actor is unknown. The old checks inspected only the worktree being removed, not the other checkouts of the repo.

Orca-managed detection (read-only, portable)

A repo is Orca-managed when either is true:

  • it appears in orca repo list
  • the target path is enumerated by orca worktree list --json

If the orca CLI is not installed or not on PATH, the Orca routing below does not apply — say so explicitly. The mandatory pre-removal checks further down apply regardless of Orca's presence; they are plain git and are always in scope.

Mandatory: route worktree lifecycle through Orca when Orca-managed

Inside an Orca-managed repo, creation goes through orca worktree create .... Removal goes through agent-harness worktree-rm (below), which routes to Orca itself.

Read the full file on GitHub · 151 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. 1mo ago Changed · +9 lines 02e9e1450565
  2. 1mo ago First seen · 142 lines · 39 tokens per session scan C 8bb792d3cdd4

Subscribe to this mod's changes

worktree-destruction-safety is a skill published in the GitHub repository fmflurry/settings-opencode (170 stars, last pushed 25d ago), licensed MIT. It adds 39 tokens to every session and 2,867 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-19.

Related

worktree-destruction-safety compared with skills from other repositories

worktree-destruction-safety next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktree-destruction-safetyfmflurry/settings-opencodeSkill17025d agoMITC39Claude Code
merge-batchdiegosouzapw/OmniRouteSkill91kyesterdayMITA46Claude Code
prowler-commitprowler-cloud/prowlerSkill15k3d agoApache-2.0A44Claude Code, Codex
gh-auth-isolationgithub/gh-awSkill5.7ktodayMITA20Claude Code, Codex
comet-githubrpamis/cometSkill3.3kyesterdayMITA72Claude Code, Codex
github-skillzeenie-ai/OpenCompanySkill1.1k4d agoMITA51Claude Code
codex-autoresearchleo-lilinxiao/codex-autoresearchSkill3.3k12d agoMITA39Codex