Borrowing it
Nothing to install: this file belongs to bredmond1019/claude-sdk-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/bredmond1019/claude-sdk-rs/main/.claude/commands/clean-worktree.mdgit clone --depth 1 https://github.com/bredmond1019/claude-sdk-rsWrote 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.
[](https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/clean-worktree)<a href="https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/clean-worktree"><img src="https://agentmods.dev/badge/commands/bredmond1019/claude-sdk-rs/clean-worktree/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.
<a href="https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/clean-worktree"><img src="https://agentmods.dev/badge/commands/bredmond1019/claude-sdk-rs/clean-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.03483 |
| Opus 5.5 | $0.00000 | $0.01393 |
| Sonnet 5.5 | $0.00000 | $0.00697 |
| Haiku 4.5 | $0.00000 | $0.00348 |
Grade A, and why
clean-worktree 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 11d 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.
How it starts
The opening of the file, as written. The whole thing — 245 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean Worktree — Merge a completed SDLC worktree branch into main and remove it.
Variables
$ARGUMENTS — one of:
<spec-slug>→ worktree name:<spec-slug><spec-slug> 3→ worktree name:<spec-slug>-task3<spec-slug>-task8→ literal worktree name (already lowercased, single token)<spec-slug>-task8-2→ literal worktree name with suffix (from sdlc-task auto-increment)
The literal single-token form is output by /sdlc-task when it creates a suffixed worktree
(e.g. -2, -3). Pass it exactly as printed.
Instructions
-
If
$ARGUMENTSis not provided, stop and print usage:Usage: /clean-worktree <spec-slug> [task-N] /clean-worktree <literal-worktree-name> Examples: /clean-worktree <spec-slug> /clean-worktree <spec-slug> 3 /clean-worktree <spec-slug>-task8 /clean-worktree <spec-slug>-task8-2 -
Parse arguments:
- If
$ARGUMENTSis a single token with no spaces that is already lowercase and contains only letters, digits, dots, and hyphens → treat it as the literalworktreeNamedirectly. (Spec slugs carry a phase-dotted prefix, e.g.<spec-slug>-task8.) - Otherwise, apply the same transform as
/init-worktree: lowercasespecSlug, append-task<taskNum>if a second token is a number. DeriveworktreeName. - Always:
worktreePath = trees/<worktreeName> - Extract
taskNumfromworktreeNamefor use in the task log step:- Pattern:
<spec-slug>-task<N>or<spec-slug>-task<N>-<suffix> - Extract
taskNumas the integer after the last-taskin the name. logFile = planning/<spec-slug-placeholder>/sdlc/reports/task<taskNum>-log.md- Note: the actual
specSlug(with original casing) is read from the log file itself (**Spec:** <spec-slug>) rather than derived from the lowercased branch name. Use the branch name only to locate the approximate path; then read the log's**Spec:**field and use that value as the authoritative spec slug for all status.md path lookups.
- Pattern:
- If
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.
- 11d ago First seen · 245 lines · 0 tokens per session scan A f1b6292371a7
clean-worktree is a command published in the GitHub repository bredmond1019/claude-sdk-rs (23 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,483 tokens. 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-26.
clean-worktree compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| clean-worktreebredmond1019/claude-sdk-rs | Command | 23 | 1mo ago | Apache-2.0 | A | 0 | Claude Code |
| red-teammohitagw15856/pm-claude-skills | Command | 1.5k | yesterday | MIT | B | 23 | Claude Code |
| instinct-importmycelium-hq/ai-brain-starter | Command | 50 | yesterday | MIT | A | 16 | Claude Code |
| acos-checkpointfrankxai/agentic-creator-os | Command | 12 | yesterday | Apache-2.0 | A | 0 | Claude Code |
| approve-proposedMozurok/fhorja.dev | Command | 10 | 28d ago | MIT | A | 107 | Claude Code |
| hygiene-statusMSApps-Mobile/claude-plugins | Command | 10 | today | MIT | A | 19 | Claude Code |
| release-flowcoo1white/cool-workflow | Command | 2 | 2d ago | BSD-2-Clause | A | 20 | Claude Code |