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/gf-labs/claude-toolbox/cleanupgit clone --depth 1 https://github.com/gf-labs/claude-toolboxWrote 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/gf-labs/claude-toolbox/cleanup)<a href="https://agentmods.dev/commands/gf-labs/claude-toolbox/cleanup"><img src="https://agentmods.dev/badge/commands/gf-labs/claude-toolbox/cleanup.svg" alt="Measured on agentmods" 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.05945 |
| Opus 5 | $0.00000 | $0.02972 |
| Sonnet 5 | $0.00000 | $0.01189 |
| Haiku 4.5 | $0.00000 | $0.00594 |
Grade D, and why
cleanup scanned grade D with 2 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 5d 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- `~/.claude.json` or `~/.claude/settings.json` Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf "$PROJ/[proj]/[session-id]/" How it starts
The opening of the file, as written. The whole thing — 635 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Arguments
$ARGUMENTS
Parse from arguments:
- Positional pattern (any word not starting with
--) — activates Filter Mode (see below). Matches against session title, first user message, and last-prompt content. Case-insensitive substring match. --days N— age threshold for OLD sessions (default: 30)--dry-run— run all phases and produce reports, but skip actual deletion
Filter Mode
When a positional pattern is provided (e.g. /cleanup "delete-me" or /cleanup 4794c719), skip the normal scan phases and run this targeted flow instead.
Step F1 — Find matching sessions:
python3 -c "
import json, os, sys, shutil
from pathlib import Path
sys.path.insert(0, os.environ.get('CLAUDE_TOOLBOX_ROOT', '') + '/scripts')
from _projects import iter_session_dirs
pattern = 'PATTERN_PLACEHOLDER'.lower()
fh_dir = Path.home() / '.claude' / 'file-history'
debug_dir = Path.home() / '.claude' / 'debug'
senv_dir = Path.home() / '.claude' / 'session-env'
results = []
try:
_dirs = iter_session_dirs()
except Exception:
_dirs = iter_session_dirs(scope=('global', None, Path.cwd()))
for _key, proj in _dirs:
for f in sorted(proj.glob('*.jsonl')):
try:
custom_title = ''
first_user = ''
last_prompt = ''
for line in f.read_text(errors='replace').splitlines():
if not line.strip(): continue
obj = json.loads(line)
t = obj.get('type', '')
if t == 'custom-title':
custom_title = obj.get('customTitle', '') # always take latest
if t == 'last-prompt' and not last_prompt:
last_prompt = obj.get('lastPrompt', '')[:80]
if t == 'user' and not first_user:
msg = obj.get('message', {})
if isinstance(msg, dict):
content = msg.get('content', '')
if isinstance(content, list):
for c in content:
if isinstance(c, dict) and c.get('type') == 'text':
first_user = c.get('text', '')[:80]
break
elif isinstance(content, str):
first_user = content[:80]
searchable = (custom_title + ' ' + first_user + ' ' + last_prompt).lower()
if pattern in searchable:
sid = f.stem
size_k = f.stat().st_size // 1024
fh_path = fh_dir / sid
fh_size = sum(ff.stat().st_size for ff in fh_path.rglob('*') if ff.is_file()) // 1024 if fh_path.exists() else 0
dbg_path = debug_dir / (sid + '.txt')
dbg_size = dbg_path.stat().st_size // 1024 if dbg_path.exists() else 0
senv_path = senv_dir / sid
senv_size = sum(ff.stat().st_size for ff in senv_path.rglob('*') if ff.is_file()) // 1024 if senv_path.exists() else 0
proj_dir = proj / sid
dir_size = sum(ff.stat().st_size for ff in proj_dir.rglob('*') if ff.is_file()) // 1024 if proj_dir.exists() else 0
total_k = size_k + fh_size + dbg_size + senv_size + dir_size
print(f'MATCH|{proj.name}|{sid}|{size_k}K|{fh_size}K|{dbg_size}K|{senv_size}K|{dir_size}K|{total_k}K|{custom_title or first_user[:50]!r}')
except Exception as e:
pass
"
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.
- 5d ago First seen · 635 lines · 0 tokens per session scan D 92dc41de4834
cleanup is a command published in the GitHub repository gf-labs/claude-toolbox (2 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,945 tokens. A static security scan graded it D with 2 findings (reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
octo-budget-mode
Switch Octopus model routing to the configured budget tier.
resume
Resume a previous session. Reads recent session logs, open tasks, and last decisions — gives Claude full context without re-explaining the project.
context-stats
Show context window usage, active tier, and system stats.
explore
Fast codebase exploration with Antigravity's agy CLI (Gemini 3.7 Flash, read-only). EXPERIMENTAL.
result
Show the stored final output for a finished multi-CLI job in this repository.
notebook-status
Check the progress of a /agy:notebook sweep (for long document sets run with --background). Reports % complete, done/pending/failed counts, elapsed time and a rough ETA, and which documents are still pending — so you can resume. Read-only, no agy.