agents-in-a-box: Skill for Claude Code

.claude/skills/disk-space-cleaner/SKILL.md

disk-space-cleaner is a skill for Claude Code from stevengonsalvez/agents-in-a-box. It costs 143 tokens per session (3,056 once invoked), scanned C, original, MIT.

A disk-cleanup tool that finds and removes rebuildable dependency and build folders such as node_modules, target, .next, dist, and build. It starts with a dry run and protects recent work and locked Git worktrees.

In plain words
What is it for?
Finding large disk consumers, previewing removable files, deleting old rebuildable artifacts, and optionally cleaning Cargo or Docker data.
Why use it?
It frees storage without deleting source code, while reducing the risk of disrupting active projects or sessions.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

This is stevengonsalvez/agents-in-a-box's own configuration. It tells Claude Code how to work on agents-in-a-box 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 agents-in-a-box configures →

Reuse

Borrowing it

Nothing to install: this file belongs to stevengonsalvez/agents-in-a-box. 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/stevengonsalvez/agents-in-a-box/main/.claude/skills/disk-space-cleaner/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/stevengonsalvez/agents-in-a-box

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 disk-space-cleaner

README.md
[![agentmods](https://agentmods.dev/badge/skills/stevengonsalvez/agents-in-a-box/disk-space-cleaner/github.svg)](https://agentmods.dev/skills/stevengonsalvez/agents-in-a-box/disk-space-cleaner)
Your own site
<a href="https://agentmods.dev/skills/stevengonsalvez/agents-in-a-box/disk-space-cleaner"><img src="https://agentmods.dev/badge/skills/stevengonsalvez/agents-in-a-box/disk-space-cleaner/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 disk-space-cleaner

Your own site · 80×15
<a href="https://agentmods.dev/skills/stevengonsalvez/agents-in-a-box/disk-space-cleaner"><img src="https://agentmods.dev/badge/skills/stevengonsalvez/agents-in-a-box/disk-space-cleaner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 143 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,056 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00143 $0.03056
Opus 5 $0.00072 $0.01528
Sonnet 5 $0.00029 $0.00611
Haiku 4.5 $0.00014 $0.00306

Measured 6d ago against content hash 079c3263e281, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

disk-space-cleaner scanned grade C with 1 finding 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/clean.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

tree counts as a failure: `rm -rf` can remove part of a directory and then
.claude/skills/disk-space-cleaner/SKILL.md · 241 lines

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.

disk-space-cleaner

Free disk by deleting only regenerable build and dependency directories. Never touches source, never removes a worktree.

The three rules

1. Only the build directory, never its parent. Clearing a worktree's target/ must leave the worktree itself, with all its source and any uncommitted work, exactly where it was. The script asserts this before the rm: the candidate must still be a directory, must live under its scan root, and its basename must be one of the target names. A check that runs after the deletion cannot prevent anything.

2. Decide by liveness, not by age. A target/ rebuilt an hour ago by a session that has since finished is safe to clear. One untouched for a month can belong to a session running right now. mtime cannot tell those apart, so it is not used as a safety signal at all.

An age gate looks prudent and is actively misleading: on a busy machine every large build directory is recently touched, so an age-gated sweep skips exactly the directories worth reclaiming while offering no protection to the ones in use.

3. Fail closed. A signal that could not be collected is not the same as a signal that came back empty. If ps, tmux, lsof or git is missing or unreadable, --apply refuses and reports held (liveness incomplete) rather than deleting blind. This is re-evaluated after every re-read, not decided once at startup: a ps that succeeds before the sizing pass and fails during it must stop the run, not ride the verdict it had before. An installed tool that exits with an error counts as unreadable; only the exit status that genuinely means "nothing found" is treated as an empty answer. --ignore-live overrides, deliberately and loudly.

Step 1: see where the space went

df -h /System/Volumes/Data                       # macOS data volume
du -xh -d 1 "$HOME" 2>/dev/null | sort -rh | head -20
du -sh ~/.agents-in-a-box/worktrees/by-name/*/*/target 2>/dev/null | sort -rh | head

Read the full file on GitHub · 241 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago Changed · +107 lines · +17 tokens per session scan A → C 079c3263e281
  2. 7d ago Changed · +38 lines · -2 tokens per session scan D → A d20ef1dde74c
  3. 11d ago First seen · 96 lines · 128 tokens per session scan D 459b764a49d5

Subscribe to this mod's changes

disk-space-cleaner is a skill published in the GitHub repository stevengonsalvez/agents-in-a-box (23 stars, last pushed today), licensed MIT. It adds 143 tokens to every session and 3,056 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.