Agent skill

Disk Cleanup

by glebis in glebis/claude-skills

Scan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space.

MITAuto-check: notes

Install Disk Cleanup

skills CLI
$ npx skills add glebis/claude-skills --skill disk-cleanup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install glebis/claude-skills disk-cleanup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/glebis/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/disk-cleanup .claude/skills/disk-cleanup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
disk-cleanup
GitHub stars
389
Token cost
~1.8k tokens
SKILL.md length
779 words
Files
10 (incl. scripts)
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Scan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space.

  • Works in 4 steps: Run python3 scripts/survey.py --json.… → Auto-path: for a plain "clean up safe… → Escalate to the user ONLY for (these are… → …
  • The users request on macOS involves: freeing disk space
  • SKILL.md covers The two scripts, Safety model (enforced in…, Agent workflow and Maintaining the registry, plus 2 more sections
  • Runs Python scripts from its folder; calls python3, docker and npm

What it does

Disk Cleanup is an agent skill from glebis/claude-skills. Scan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space. Deterministic — a config registry (targets.json) plus two scripts (survey.py read-only, clean.py executor) do all the measuring and deleting; the agent only relays a compressed summary and makes the few human-judgment calls. IMPORTANT — use this skill whenever the user's request on macOS involves: freeing disk space, cleaning/clearing caches, "disk is full", "clean up my Mac", "free up space", "what's eating my…

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including scripts (for example `.claude-plugin/plugin.json`, `config.json` and `config.local.example.json`).

It works with macOS. The repository describes itself as: Collection of Claude Code skills for enhanced AI workflows. The licence is MIT.

When your agent uses it

  • The users request on macOS involves: freeing disk space
  • Cleaning/clearing caches
  • Clean up my Mac
  • Whats eating my disk

Example prompts

  • “disk is full”
  • “clean up my Mac”
  • “free up space”
  • “/disk-cleanup”

Requirements

  • Python 3
  • Docker

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Run python3 scripts/survey.py --json. Relay the compressed summary: disk free,
  2. Auto-path: for a plain "clean up safe stuff", show the safe total and run
  3. Escalate to the user ONLY for (these are genuine judgment calls the scripts deliberately
  4. Run clean.py with the resolved selection. Relay the result (freed_human, disk before→after).

What it can do on your machine

Read from SKILL.md and the folder at commit 7524dff. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • docker
    • npm
    • xcrun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use docker and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Disk Cleanup loads about 1.8k tokens when it runs. Until then it costs about 171 tokens; SKILL.md has 779 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~171
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:56
    deletes, sudo for system caches) — never invoke it from the agent. **Never shell out to `mo`

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from glebis/claude-skills at commit 7524dff, republished under its MIT licence (© glebis). 779 words, ~1,835 tokens.

Download SKILL.mdSave it as .claude/skills/disk-cleanup/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
disk-cleanup
description
Scan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space. Deterministic — a config registry (targets.json) plus two scripts (survey.py read-only, clean.py executor) do all the measuring and deleting; the agent only relays a compressed summary and makes the few human-judgment calls. IMPORTANT — use this skill whenever the user's request on macOS involves: freeing disk space, cleaning/clearing caches, "disk is full", "clean up my Mac", "free up space", "what's eating my disk", "running low on disk", needing space for an install, or any low-storage complaint. Covers the whole workflow survey → choose → clean → empty Trash.

Disk Cleanup

Deterministic by design. All target knowledge lives in targets.json; all measuring and deleting lives in scripts/survey.py (read-only) and scripts/clean.py (executor, dry-run by default). They run headless with zero dependencies (stdlib only) — a user can run them in a terminal without any agent. The agent's job is small: run the scripts, relay the compressed output, and decide the handful of things that need human judgment.

The two scripts

bash
python3 scripts/survey.py            # read-only: sizes, risk, flags, uncategorized. Touches nothing.
python3 scripts/survey.py --json     # same, machine-readable (preferred for the agent)

python3 scripts/clean.py --preset safe              # DRY-RUN plan (default — nothing deleted)
python3 scripts/clean.py --preset safe --go         # execute (safe risk only)
python3 scripts/clean.py --preset full --allow-medium --go --empty-trash   # safe+medium, then empty Trash
python3 scripts/clean.py --ids cargo-registry-cache,go-mod-cache --go       # specific targets
python3 scripts/clean.py --preset safe --skip ollama-models --go            # exclude one

trash is used for all file removal (never rm); freed space sits in Trash until emptied (--empty-trash, or the user empties it). Sizes are du estimates — approximate on APFS.

Safety model (enforced in code, not prose)

  • Risk gating: safe runs automatically; medium needs --allow-medium; never is refused even if named by id. advisory targets only print guidance, never execute.
  • Preflight on every trashed path: canonical realpath → must resolve under an allowed_roots entry → must not be a symlink → never $HOME or /. Anything failing is skipped and reported, not deleted.
  • Dry-run by default: clean.py prints the plan and touches nothing unless --go.

Agent workflow

  1. Run python3 scripts/survey.py --json. Relay the compressed summary: disk free, safe/medium recoverable totals, any flags (e.g. crash-loop), and the top targets. Do not dump the whole JSON.
  2. Auto-path: for a plain "clean up safe stuff", show the safe total and run clean.py --preset safe --go (offer --empty-trash). Safe targets are regenerable.
  3. Escalate to the user ONLY for (these are genuine judgment calls the scripts deliberately refuse to auto-decide):
    • medium targets (ML models, device support, project node_modules) — confirm before --allow-medium. ML-model targets (ollama-models, huggingface-models) carry a last_used_days field (newest file atime under the target, aggregate across all models in that store — not per-model) as a "how stale is this" signal; surface it before suggesting deletion.
    • uncategorized discoveries — unknown dirs >100 MB; ask or investigate before adding.
    • advisory notes — surface them (Telegram cache, simulators via simctl, uv/tools, Chrome whole-dir, Xcode Archives, mo clean deep-clean); never act on them automatically. For mole-deep-clean: suggest the user run mo clean themselves (interactive TUI, permanent deletes, sudo for system caches) — never invoke it from the agent. Never shell out to mo at all (not even --dry-run): it's TUI-only and blocks waiting for a real terminal even in dry-run mode — confirmed hanging under a piped subprocess, stdin=DEVNULL, and even a script(1)-allocated pty. A mole flag in survey.py's output only reads the mtime of mole's own leftover ~/.config/mole/clean-list.txt (last-run recency), never invokes it.
    • surgical Docker / simulator decisions (see below).
  4. Run clean.py with the resolved selection. Relay the result (freed_human, disk before→after).
Show full SKILL.md (361 more words)Show less

Maintaining the registry

Add or correct targets by editing targets.json — no code change needed. Each target: {id, category, risk, method, paths|find, regenerates, priority, note}. Methods:

  • trash — trash literal paths (globs allowed).
  • find-trash — exact-name dir sweep with a min_mb floor (crash dumps, project node_modules).
  • command — run a CLI (npm cache clean…); set scope_path so freed bytes can be measured.
  • simctl — xcrun simctl delete unavailable (removes only sims for uninstalled runtimes; safe).
  • downloads-scan — config-driven (config.json → downloads_scan): files older than age_days whose name doesn't match exclude_patterns. The dry-run lists every file by name for review.
  • advisory — never executes; only prints guidance.

Keep installed software at risk: never (learned the hard way: uv/tools, uv/python, ~/.rustup/toolchains, ~/.bun, ~/.deno are NOT caches). Every non-advisory target's paths must resolve under allowed_roots or preflight will (correctly) refuse them.

Customization & setup (per-machine, never committed)

config.json ships generic, public-safe defaults. Anything personal — names, family names, a non-English tax/legal/financial vocabulary — or machine-specific goes in config.local.json (gitignored). load_config() deep-merges it over config.json: lists are unioned (local terms only add protection to the Downloads exclude list), scalars override. See config.local.example.json for the shape.

Setup mode — when the user first uses the skill, asks to personalize it, or has sensitive files in ~/Downloads, offer to build config.local.json by asking (one short batch):

  1. Names/keywords in Downloads filenames that must never be swept (own name, family names).
  2. Their language's tax/legal/financial terms (e.g. German steuer, rechnung, vertrag).
  3. Their projects directory (for the node_modules sweep) and any extra app caches. Then write config.local.json (copy config.local.example.json and fill it in). Confirm what was saved. Never commit it.

Per-machine paths in targets.json (allowed_roots, the node-modules-projects find root ~/ai_projects) are examples — adjust them to the user's layout. Targets whose paths don't exist on this machine simply measure 0 and are skipped.

Still agent-driven (only what genuinely can't be deterministic)

  • Docker only — surgical and stateful: survey with docker images / docker ps -as / docker system df -v, let the user pick per-name (docker rm/rmi/volume rm/builder prune), or blunt docker system prune -a -f. A named volume removed = data gone; confirm by name. (Everything else — simulators via the simctl method, Downloads via downloads-scan, crash dumps, all caches — now runs through the scripts.)

© glebis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (scripts) in skills/disk-cleanup of glebis/claude-skills.

  • SKILL.md
  • .claude-plugin/plugin.json
  • .gitignore
  • config.json
  • config.local.example.json
  • scripts/clean.py
  • scripts/lib.py
  • scripts/survey.py
  • scripts/tests/test_safety.py
  • targets.json

Open the folder on GitHubat commit 7524dff

Compare with similar skills

Disk Cleanup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Disk Cleanup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Disk Cleanup this skillglebis/claude-skills389—~1.8kAutomated safety check: NotesMIT
Site ArchitectureAvdLee/RocketSimApp80311 repos~3.3kAutomated safety check: PassCustom licence
Engine Whats Newflutter/flutter179k—~978Automated safety check: PassBSD-3-Clause
macOS Spm App PackagingDimillian/Skills4k5 repos~1.2kAutomated safety check: PassMIT
Openclaw Live Updateropenclaw/openclaw392k—~3.7kAutomated safety check: PassMIT
Orca iOS Simulator Controlstablyai/orca87k1 repos~584Automated safety check: PassApache-2.0

Similar skills

  • Site Architecture

    AvdLee/RocketSimApp

    When the user wants to plan, map, or restructure their website's page hierarchy, navigation, URL structure, or internal linking.

    803 GitHub starsUsed in 11 repos~3.3k tokens
    Marketing & SEOAuto-check passed
  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    179k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • macOS Spm App Packaging

    Dimillian/Skills

    Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.

    4k GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • Openclaw Live Updater

    openclaw/openclaw

    Maintain the canonical live OpenClaw main checkout, macOS LaunchAgent-managed Gateway, local macOS app, exact-head main CI, and recurring full release validation.

    392k GitHub stars~3.7k tokensUpdated today
    DevOps & CloudAuto-check passed
  • iOS Simulator control from inside Orca, with the live device view in Orca's emulator pane. Use when driving a booted Apple Simulator on macOS: taps, gestures…

    87k GitHub starsUsed in 1 repo~584 tokens
    MobileAuto-check passed
  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed

More from glebis/claude-skills

All 91 skills in this repo
  • Runs a human-first workflow for labeling PII spans in a transcript, then scores inter-annotator agreement and drafts an adjudicated gold set.

    389 GitHub stars~1.3k tokensUpdated 12 days ago
    Auto-check passed
  • Automates a dedicated, logged-in Chrome instance per profile without ever closing the user's own open tabs or browser windows.

    389 GitHub stars~973 tokensUpdated 12 days ago
    Auto-check passed
  • Deep Research

    glebis/claude-skills

    This skill should be used when conducting comprehensive research on any topic using the OpenAI Deep Research API.

    389 GitHub stars~2.6k tokensUpdated 12 days ago
    Auto-check: notes
  • Elimination Research

    glebis/claude-skills

    This skill should be used for elimination-style research where the user wants to choose from a shortlist of products, tools, services, vendors, or other options using explicit criteria, numeric…

    389 GitHub stars~1.6k tokensUpdated 12 days ago
    Auto-check passed
  • Narrated HTML Presentations

    glebis/claude-skills

    Generates a self-contained HTML presentation with article and slides modes, ElevenLabs voiceover narration and optional GPT Image 2 illustrations.

    389 GitHub stars~2.3k tokensUpdated 12 days ago
    Auto-check: notes
  • Writes fictional but realistic coaching or therapy session transcripts for evals, demos and few-shot examples, in several modalities and export formats.

    389 GitHub stars~2.9k tokensUpdated 12 days ago
    Auto-check passed

Works with

Questions about Disk Cleanup

What does Disk Cleanup do?

Scan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space. Disk Cleanup is an agent skill from glebis/claude-skills. Scan and clean macOS caches, package-manager data, crash dumps, and app caches to reclaim disk space.

When should I use Disk Cleanup?

Disk Cleanup fits situations like: the users request on macOS involves: freeing disk space; cleaning/clearing caches; clean up my Mac; whats eating my disk.

How do I install Disk Cleanup in Claude Code?

Run `npx skills add glebis/claude-skills --skill disk-cleanup -a claude-code`. Or copy the skill folder (skills/disk-cleanup in glebis/claude-skills) into .claude/skills/disk-cleanup in your project. Claude Code loads it when a task matches its description.

How do I install Disk Cleanup in Codex?

Run `npx skills add glebis/claude-skills --skill disk-cleanup -a codex`. Or copy the skill folder (skills/disk-cleanup in glebis/claude-skills) into .agents/skills/disk-cleanup in your project. Codex loads it when a task matches its description.

Can I use Disk Cleanup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add glebis/claude-skills --skill disk-cleanup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/disk-cleanup, .gemini/skills/disk-cleanup, .github/skills/disk-cleanup and .opencode/skills/disk-cleanup in your project.

What does Disk Cleanup need to run?

Going by SKILL.md and its folder, Disk Cleanup needs Python for the scripts in its folder and the command-line tools its instructions call (python3, docker, npm and xcrun). Our summary lists: Python 3; Docker.

Does Disk Cleanup access the network?

SKILL.md contains no URLs. Its commands use docker and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Disk Cleanup safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Disk Cleanup use?

Disk Cleanup is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Disk Cleanup use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Disk Cleanup?

Skills that share tags, products or a category with Disk Cleanup: Site Architecture (AvdLee/RocketSimApp, 803 stars), Engine Whats New (flutter/flutter, 179k stars), macOS Spm App Packaging (Dimillian/Skills, 4k stars) and Openclaw Live Updater (openclaw/openclaw, 392k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Disk Cleanup?

glebis (a GitHub user) maintains it in glebis/claude-skills, which has 389 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on September 26, 2026.

Source: glebis/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.