disk-space-audit

Audit disk usage and reclaim space safely: inventory, verify, then delete.

disk-space-audit safely reclaims space: inventory first, check for uncommitted work, then delete. It doesn't judge which business files matter.

Office documentsagents 2CC0 downloadable Scan upstream repo ↗

Upstream:digitalitem · ★ 0 · last commit

What it is

An audit of disk usage on a developer machine that reclaims space safely; the hard part is not cleaning but deciding what may be deleted. For a full or nearly full disk, cleaning a workspace or Downloads, or hunting tens of gigabytes. It does not offer one-click cleanup, and no single signal is enough to justify a deletion.

Core workflow

StageContent
TriggerThe disk is full or nearly full; asked to clean workspace/Downloads/Documents; hunting what ate tens of gigabytes
InputThe target directory, plus a usage baseline recorded with df
StepsPhase 0 baseline → Phase 1 inventory (hidden directories included) → Phase 2 classify into five buckets and run the git safety audit → Phase 3 verify each candidate → Phase 4 execute in risk tiers, stopping to report between tiers
OutputThe df before/after delta, a classification and verification record per item, a tiered cleanup report
Boundarydu is never quoted as space freed; an incomplete check must be reported as uncertain; rewriting git history is a separate, riskier step

Getting started: Run df and note the used number first; after that, “freed N GB” means only that delta.

Traits

  • One hard rule: all five conditions must hold — no live dependency, no unpushed work, no irreplaceable data, reproducible, measured with df
  • The git audit goes per branch over refs/heads and names both wrong ways: checking only HEAD, and --all counting tags as unpushed
  • Worktrees get their own rules: the stash belongs to the host repo and cannot justify keeping one; removal goes through git worktree remove, then prune
  • Directory vs archive pairs are compared by name and MD5, handling the archive’s top-level prefix and CP437/GBK filenames

Who it is for and who it is not for

Good fitPoor fit
A full local disk where it is unclear what may goA permanent, unattended cleanup script
Clearing multi-GB CI leftovers and cachesData with no git and no second copy
Tidying orphaned worktrees and old checkoutsContainers or scratch disks where deletion costs nothing

How it differs

NeedUse
Decide whether a repo or direction is still worth investing incriteria-audit
See what is inside a PDF/document before deleting itappautomaton-document-skills-pdf
Write the cleanup notes clearly, without grammar slipsphuryn-pm-skills-pm-toolkit-grammar-check

Source-level risks

RiskSourceImpact
Deletion is irreversible, and a tool failure reads as “nothing found”SKILL.md “The one rule”Deleting a directory with unpushed commits or the only copy of data
git filter-branch rewrites history and cannot be undone without a remoteSKILL.md “Reclaiming space inside git history”Repository history destroyed beyond recovery
APFS atime, copy-on-write clones and hardlinks all distort directory sizesfrontmatter descriptionNeither the freed amount nor the directory total adds up

Example: input and output

Input

My Mac disk is full — find the 10 largest directories.

Output

Writes a list: path, size, whether safe to delete, and git unpushed-work checks.

Check: uncommitted work verified before deleting.

FAQ

Will it delete files automatically?

No — it inventories and recommends.

How do I avoid deleting unpushed work?

Run the git checks first.

Does it work on servers?

Yes, ideally off-peak.

CategoryOffice documents
Version0.1.0
Agent supportClaude Code, Generic (reads SKILL.md)
OSmacOS / Linux
Dependenciesbash、git、lsof
Environmentdisk read/write
Scriptspresent (reviewed here)
LicenseCC0
Sourcedigitalitem ↗
Verification✓ verified
Get itDownload zip
SHA256: 888e776e89805fe07a0377ba5f8c25ed9039750207da06dcc9c4fbd847b53667 · 0.0 MB

"Generic (agents that read SKILL.md)" means any agent that discovers and loads SKILL.md; support level (auto-discovery, manual config, script execution) varies by agent.

Install
unzip disk-space-audit-0.1.0.zip -d ~/.claude/skills/

Skills directory example: ~/.claude/skills/ for Claude Code; other agents use wherever SKILL.md is discovered.