spacevibe-deck: Skill for Claude Code

.claude/skills/clean-worktrees/SKILL.md

clean-worktrees is a skill for Claude Code from mxrsv/spacevibe-deck. It costs 75 tokens per session (1,273 once invoked), scanned A, original, MIT.

A workflow for finding local Git worktrees and branches that may be safe to remove. A worktree is another checkout of the same Git repository, often used to work on a separate branch.

In plain words
What is it for?
List stale worktrees and branches, compare them with the remote repository, and remove only the entries the owner approves.
Why use it?
It reports merge, dirty-file, and unpushed status before removal, and waits for the owner to confirm each deletion. This helps avoid deleting unfinished work or local-only commits.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

This is mxrsv/spacevibe-deck's own configuration. It tells Claude Code how to work on spacevibe-deck itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything spacevibe-deck configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mxrsv/spacevibe-deck. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mxrsv/spacevibe-deck/main/.claude/skills/clean-worktrees/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/mxrsv/spacevibe-deck

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 clean-worktrees

README.md
[![agentmods](https://agentmods.dev/badge/skills/mxrsv/spacevibe-deck/clean-worktrees/github.svg)](https://agentmods.dev/skills/mxrsv/spacevibe-deck/clean-worktrees)
Your own site
<a href="https://agentmods.dev/skills/mxrsv/spacevibe-deck/clean-worktrees"><img src="https://agentmods.dev/badge/skills/mxrsv/spacevibe-deck/clean-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 clean-worktrees

Your own site · 80×15
<a href="https://agentmods.dev/skills/mxrsv/spacevibe-deck/clean-worktrees"><img src="https://agentmods.dev/badge/skills/mxrsv/spacevibe-deck/clean-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,273 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.00075 $0.01273
Opus 5.5 $0.00030 $0.00509
Sonnet 5.5 $0.00015 $0.00255
Haiku 4.5 $0.00007 $0.00127

Measured 7d ago against content hash 8c1d2a354952, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

clean-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.

.claude/skills/clean-worktrees/SKILL.md · 79 lines

How it starts

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

Clean worktrees

AGENTS.md sets no cap on live worktrees; this skill clears the ones made by hand under ../spacevibe-deck-worktrees/. It reports first and removes only what the owner confirms, row by row. Run all git commands from the primary checkout and read plans there by absolute path.

Step 1: report only

Run git fetch --prune origin first so the origin/main and unpushed columns are not judged against stale remote-tracking refs. No other git write command in this step. For every worktree in git worktree list --porcelain, except the primary checkout, collect:

Column How
Path, branch or detached porcelain output
Last commit date git log -1 --format=%cs <head>
Merged git merge-base --is-ancestor <head> origin/main exits 0, or the tip equals the head.sha of a merged PR (command below). Squash and rebase merges leave the branch off origin/main, so the ancestor test alone misses them. Note "local main only" separately
Dirty the ignored-aware status below prints anything. Ignored files count: git worktree remove deletes them without --force, and .env* and docs/plans/ are ignored here
Unpushed git rev-list <head> --not --remotes is non-empty. A tip that equals a merged PR's head.sha has nothing unpushed
Detached, orphaned git branch -a --contains <head> is empty
Live process lsof -a -d cwd -Fn lines equal to n<path> or starting with n<path>/ (the slash keeps landing from matching landing-standout). Never lsof +D (slow)
Recently touched find <path> -mmin -1440 -not -path '*/node_modules/*' -not -path '*/.git/*' -print -quit prints a file. Agent sessions run from the primary checkout and edit worktrees by absolute path, so the process column cannot see them; this one can
Named by a plan grep -rl the path and the branch name in the primary checkout's docs/plans/
# Merged PR for a branch: prints "<number> <head.sha>"; compare with `git rev-parse <branch>`
gh api "repos/mxrsv/spacevibe-deck/pulls?state=closed&head=mxrsv:<branch>" \
  --jq '.[] | select(.merged_at) | "\(.number) \(.head.sha)"'
# Dirty, ignored files included; build output at any depth is dropped
git -C <path> status --porcelain --ignored \
  | grep -vE '^!! (.*/)?(node_modules|dist|dist-electron|dist-electron-app)/$'

Read the full file on GitHub · 79 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 Changed 8c1d2a354952
  2. 10d ago First seen · 79 lines · 75 tokens per session scan A 5a2620964ff6

Subscribe to this mod's changes

clean-worktrees is a skill published in the GitHub repository mxrsv/spacevibe-deck (41 stars, last pushed 3d ago), licensed MIT. It adds 75 tokens to every session and 1,273 once invoked, about $0.0003 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-18.