disk-cleanup

disk-cleanup is a skill for Claude Code, Codex from moonlight-lupin/agent-skills. It costs 27 tokens per session (1,753 once invoked), scanned C, original, MIT.

A guided cleanup routine for reclaiming storage on a Linux virtual machine (VM). It checks disk usage, finds large files and folders, separates safe removals from actions needing approval, and verifies the result.

In plain words
What is it for?
Use it to inspect all mounted disks, locate large caches, logs, project data, and temporary files, clean approved items, and compare available space before and after.
Why use it?
It helps when a VM is running out of space or reports no space left, including cases where deleted files are still held open by a process. It also reduces the risk of deleting system data accidentally.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to inspect all mounted disks, locate large caches, logs, project data, and temporary files, clean approved items, and compare available space before and after.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/moonlight-lupin/agent-skills/disk-cleanup
Install

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.

Any agent
npx skills add moonlight-lupin/agent-skills --skill disk-cleanup
Clone the repo
git clone --depth 1 https://github.com/moonlight-lupin/agent-skills

Made for: Claude Code, Codex.

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-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/disk-cleanup/github.svg)](https://agentmods.dev/skills/moonlight-lupin/agent-skills/disk-cleanup)
Your own site
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/disk-cleanup"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/disk-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.

agentmods 80×15 button for disk-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/disk-cleanup"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/disk-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,753 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.00027 $0.01753
Opus 5 $0.00014 $0.00877
Sonnet 5 $0.00005 $0.00351
Haiku 4.5 $0.00003 $0.00175

Measured 4d ago against content hash ff33abc6c88e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

disk-cleanup 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 4d 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.

Recursive force deletehighDestructive command

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

| Browser automation caches | `rm -rf ~/.cache/puppeteer ~/.cache/ms-playwright` | ~650M; re-downloads if needed |
devops/disk-cleanup/SKILL.md · 142 lines

How it starts

The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Disk Cleanup

Reclaim disk space on a Linux VM. The skill runs a triage — survey every space consumer, split targets into safe vs ask, execute the approved set, then verify the delta.

When to Use

  • User says "disk cleanup", "free up space", "clean up the VM"
  • Disk usage above 80%
  • After large builds, git operations, or Docker image accumulation

Procedure

1. Baseline

df -h

Done: used and available numbers recorded for all mounts for the before/after comparison.

2. Survey

Requires root for apt, journalctl, and /var/log operations. Non-root users can survey but cannot clean system paths.

Build a ranked list of every consumer over ~50M. Survey all mounts, not just /.

# All mounts (not just /)
df -h
df -i                           # inode exhaustion — "No space left on device" with free blocks

# Deleted-but-open files (canonical "df says full, du says empty" case)
lsof +L1 2>/dev/null | head -20

# Hermes data + user caches + tmp (stay on one filesystem, don't cross mounts)
du -xsh ~/.hermes/*/ 2>/dev/null | sort -rh | head -20
du -xsh ~/.hermes/projects/*/ 2>/dev/null | sort -rh | head -20
du -xsh ~/.cache/*/ 2>/dev/null | sort -rh | head -15
du -xsh /tmp/* 2>/dev/null | sort -rh | head -15

# Memory store (if Mnemosyne is installed)
du -xsh ~/.hermes/mnemosyne/data/* 2>/dev/null | sort -rh

# Session checkpoints (if present)
du -xsh ~/.hermes/checkpoints/store/ 2>/dev/null

# Docker
docker system df                # shows build cache separately from images
docker images --format "{{.Size}}\t{{.Repository}}:{{.Tag}}" | sort -rh | head -25
docker ps -a --filter "status=exited" --format "{{.Image}}" | sort -u

# System
du -xsh /var/cache/apt /var/log ~/.cache/pip ~/.cache/uv 2>/dev/null
journalctl --disk-usage
find /var/log \( -name "*.gz" -o -name "*.1" -o -name "*.old" \) 2>/dev/null

# Bloated git repos (orphaned tmp_pack files from interrupted operations)
find ~/.hermes/projects -name ".git" -type d -exec sh -c 'du -sh "$1" 2>/dev/null' _ {} \; | sort -rh | head -10

Read the full file on GitHub · 142 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. 4d ago Changed ff33abc6c88e
  2. 10d ago First seen · 142 lines · 27 tokens per session scan C ee8878369d8f

Subscribe to this mod's changes

disk-cleanup is a skill published in the GitHub repository moonlight-lupin/agent-skills (60 stars, last pushed 3d ago), licensed MIT. It adds 27 tokens to every session and 1,753 once invoked, about $0.0001 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.