Claude Code Templates is a command-line tool and catalogue for configuring Anthropic’s Claude Code with agents, commands, settings, hooks, integrations, skills, and project templates. Developers use it to browse and install reusable components for their coding workflows. The catalogue includes many of these Claude Code components.
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.
git clone --depth 1 https://github.com/davila7/claude-code-templatesWrote 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/davila7/claude-code-templates/worktree-cleanup)<a href="https://agentmods.dev/commands/davila7/claude-code-templates/worktree-cleanup"><img src="https://agentmods.dev/badge/commands/davila7/claude-code-templates/worktree-cleanup/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/davila7/claude-code-templates/worktree-cleanup"><img src="https://agentmods.dev/badge/commands/davila7/claude-code-templates/worktree-cleanup.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.00008 | $0.01033 |
| Opus 5.5 | $0.00003 | $0.00413 |
| Sonnet 5.5 | $0.00002 | $0.00207 |
| Haiku 4.5 | $0.00001 | $0.00103 |
Grade A, and why
worktree-cleanup 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 3mo 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 — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Worktree Cleanup
Remove worktrees and branches that have been merged: $ARGUMENTS
Instructions
You are in the main repository (not a worktree). Clean up finished worktrees.
Branch Patterns
This project uses the following branch prefixes for worktrees:
claude/*— Claude Code auto-created worktreesclaude-daniel/*— User-created worktreesreview/*— Component review worktrees
All three prefixes must be checked in every step below.
Step 1: Validate Environment
- Verify this is the main working tree (first entry in
git worktree list) - If inside a worktree, warn: "Run
/worktree-cleanupfrom the main repo, not from a worktree." - Fetch latest from origin:
git fetch origin --prune - Get the main branch name (main or master)
Step 2: Parse Arguments
Parse $ARGUMENTS for options:
--all— clean up ALL merged worktrees and branches--branch <prefix>/<name>— clean up a specific worktree/branch--dry-run— show what would be cleaned up without doing anything--force-all— remove ALL worktrees regardless of merge status (asks confirmation per worktree)- No arguments — list worktrees and ask which to clean up
Step 3: Identify Worktrees
- List all worktrees:
git worktree list - List all matching branches:
git branch --list 'claude/*' 'claude-daniel/*' 'review/*' - For each matching branch, check if it's been merged into main:
git branch --merged origin/<main-branch> | grep -E '^\s+(claude/|claude-daniel/|review/)' - Also check remote branches:
git branch -r --merged origin/<main-branch> | grep -E 'origin/(claude/|claude-daniel/|review/)' - For squash-merged branches (not detected by
--merged), check if the branch diff is empty against main:
If the diff is empty or very small (only whitespace), consider it merged.# A branch is effectively merged if its changes already exist in main git diff origin/main...<branch> --stat
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.
- 3mo ago First seen · 125 lines · 8 tokens per session scan A 78f0ba528fcc
worktree-cleanup is a command published in the GitHub repository davila7/claude-code-templates (34,829 stars, last pushed today), licensed MIT. It adds 8 tokens to every session and 1,033 once invoked, about $0.0000 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-08-30.
worktree-cleanup compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| worktree-cleanupdavila7/claude-code-templates | Command | 35k | today | MIT | A | 8 | Claude Code |
| ccc-forkKevinZai/commander | Command | 6 | today | MIT | A | 46 | Claude Code |
| ccc-multi-repoKevinZai/commander | Command | 6 | today | MIT | A | 48 | Claude Code |
| ccc-parallelKevinZai/commander | Command | 6 | today | MIT | A | 36 | Claude Code |
| ccc-aoKevinZai/commander | Command | 6 | today | MIT | A | 35 | Claude Code |
| ccc-prKevinZai/commander | Command | 6 | today | MIT | A | 34 | Claude Code |
| ccc-verifyKevinZai/commander | Command | 6 | today | MIT | A | 62 | Claude Code |