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.
npx agentmods add commands/florianbruniaux/claude-code-plugins/git-worktree-cleangit clone --depth 1 https://github.com/FlorianBruniaux/claude-code-pluginsWhat 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 | $0.00019 | $0.01800 |
| Opus 5 | $0.00010 | $0.00900 |
| Sonnet 5 | $0.00004 | $0.00360 |
| Haiku 4.5 | $0.00002 | $0.00180 |
Grade A, and why
git-worktree-clean 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 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.
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 — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Worktree Clean
Batch cleanup of stale git worktrees. Safely removes merged branches, reports disk usage, and handles unmerged branches interactively.
Core principle: Auto-clean merged worktrees, interactive review for unmerged, always report what was reclaimed.
Part of: Worktree Lifecycle Suite | /git-worktree | /git-worktree-status | /git-worktree-remove
Process
- List All Worktrees:
git worktree list - Classify Each: merged vs unmerged vs protected
- Calculate Disk Usage: Per-worktree size
- Auto Mode: Remove all merged worktrees (safe)
- Interactive Mode: Review unmerged worktrees one by one
- Database Cleanup Reminder: List DB branches to clean
- Report: Summary of actions taken and space reclaimed
Flags
| Flag | Effect |
|---|---|
--dry-run |
Preview what would be cleaned, no changes |
--all |
Include unmerged worktrees (interactive confirmation each) |
--force |
Remove all worktrees without confirmation (dangerous) |
Worktree Discovery
# Get main branch name
MAIN_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
MAIN_BRANCH=${MAIN_BRANCH:-main}
# Protected branches (never auto-clean)
PROTECTED="main master develop staging production"
# List all worktrees (skip main working tree)
git worktree list --porcelain | while read line; do
# Parse worktree path and branch
# Skip the main worktree (first entry)
done
Classification
for WORKTREE in $WORKTREES; do
BRANCH=$(git -C "$WORKTREE" rev-parse --abbrev-ref HEAD)
# Skip protected
if echo "$PROTECTED" | grep -qw "$BRANCH"; then
echo "PROTECTED: $BRANCH (skipped)"
continue
fi
# Check merge status
if git merge-base --is-ancestor "$BRANCH" "$MAIN_BRANCH" 2>/dev/null; then
echo "MERGED: $BRANCH → safe to remove"
MERGED_LIST="$MERGED_LIST $WORKTREE"
else
echo "UNMERGED: $BRANCH → requires review"
UNMERGED_LIST="$UNMERGED_LIST $WORKTREE"
fi
done
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.
- 2d ago First seen · 241 lines · 19 tokens per session scan A 6f071354c52a
git-worktree-clean is a command published in the GitHub repository FlorianBruniaux/claude-code-plugins (40 stars, last pushed 2mo ago), licensed MIT. It adds 19 tokens to every session and 1,800 once invoked, about $0.0001 per session on Opus 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-08-30.
Other commands, from other repositories
content-generate
Social media content generation command. Produces ready-to-use posts, captions, visual briefs, and hashtags for the given platform and type.
api-doc
API documentation generation. Scans route definitions and produces structured API docs.
aso
App Store Optimization command. iOS app listing analysis via the iTunes API, keyword optimization, and competitor comparison.
changelog
Automatic changelog generation. Produces a structured changelog from commit history.
coach
Coaching analysis command. Performs data-driven work-pattern analysis and offers personal improvement suggestions.
competitive-intel
Competitive analysis command. Analyzes the market, competitors, and opportunities with a comprehensive competitive-intelligence framework.