mac-deep-clean

mac-deep-clean is a skill for Claude Code from randomittin/heimdall. It costs 91 tokens per session (2,945 once invoked), scanned D, original, MIT.

A macOS maintenance skill that investigates storage use and memory problems, then removes approved disposable files such as caches, build output, and selected old development files.

In plain words
What is it for?
Use it to measure reclaimable space, diagnose memory exhaustion, and perform confirmation-gated cleanup of development-machine clutter.
Why use it?
It helps when a Mac is low on disk space, has oversized System Data, or is slow because it is using swap memory.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; positional $N argument.

Part of the hmd plugin — 7 skills, 19 commands, 16 agents, 8 hooks, 1 MCP server shipped together

Good fit Use it to measure reclaimable space, diagnose memory exhaustion, and perform confirmation-gated cleanup of development-machine clutter.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/randomittin/heimdall/mac-deep-clean
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 randomittin/heimdall --skill mac-deep-clean
Clone the repo
git clone --depth 1 https://github.com/randomittin/heimdall

Made for: Claude Code.

Or install hmd, the plugin that ships this one along with the rest of its 7 skills, 19 commands, 16 agents, 8 hooks, 1 MCP server.

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 mac-deep-clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/randomittin/heimdall/mac-deep-clean/github.svg)](https://agentmods.dev/skills/randomittin/heimdall/mac-deep-clean)
Your own site
<a href="https://agentmods.dev/skills/randomittin/heimdall/mac-deep-clean"><img src="https://agentmods.dev/badge/skills/randomittin/heimdall/mac-deep-clean/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 mac-deep-clean

Your own site · 80×15
<a href="https://agentmods.dev/skills/randomittin/heimdall/mac-deep-clean"><img src="https://agentmods.dev/badge/skills/randomittin/heimdall/mac-deep-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,945 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. 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.00091 $0.02945
Opus 5.5 $0.00036 $0.01178
Sonnet 5.5 $0.00018 $0.00589
Haiku 4.5 $0.00009 $0.00295

Measured 7d ago against content hash 6059421301c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

mac-deep-clean scanned grade D with 3 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 7d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **`sudo -n true`** to test for cached sudo without prompting; if it fails, print the manual command instead of hanging.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find ~/.claude/projects -name '*.jsonl' -mtime +30 -print # list first; append -delete only after the user OKs the list

Recursive force deletehighDestructive command

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

- **Scope precisely.** `rm -rf` explicit paths only. Never `rm -rf` a parent when you mean a child. Verify exact version-dir names (Android SDK, NDK) before deleting "old" versions.
skills/mac-deep-clean/SKILL.md · 192 lines

How it starts

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

mac-deep-clean

Autonomous macOS storage + memory cleanup. Investigate first (read-only), present a tiered reclaimable map, delete only what's regenerable or user-approved. Destructive ops are irreversible — measure, confirm, then act.

Ships with Heimdall: invoke it as hmd:mac-deep-clean (a copy you installed by hand under ~/.claude/skills/mac-deep-clean/ is plain mac-deep-clean). hmd:system-health and heimdall-cleanup --deep notice the need and hand off here — they never delete anything outside Heimdall's own garbage; this skill is the confirm-gated executor.

Golden rules

  • Measure before deleting. Always du -sh / df -h before and after. Report reclaimed bytes.
  • Irreversible = confirm. Deleting repos/files with uncommitted work needs explicit user naming. Never infer consent from background-task notifications.
  • Scope precisely. rm -rf explicit paths only. Never rm -rf a parent when you mean a child. Verify exact version-dir names (Android SDK, NDK) before deleting "old" versions.
  • Caches regenerate; user data does not. Keep: iMessage db, browser profiles, Notes, VSCode, source .git, loose documents. Delete: caches, build output, node_modules, old SDK versions, dead worktrees.
  • Delegate investigation to parallel read-only agents. One agent per domain (repos / user Library / System Data). Spawn concurrently, run_in_background: true.

macOS gotchas

  • timeout does not exist on macOS. Use run_in_background: true or a background & + poll instead of timeout N cmd.
  • df -h / lies. / is the sealed read-only system snapshot (a small, fixed-size volume). Real data lives on /System/Volumes/Data. Use diskutil info / → "Container Free Space" for true free.
  • "System Data" bucket = swap + Preboot + caches + logs + diagnostics + purgeable. Not a folder — an aggregate.
  • ps aux RSS undercounts (shared/compressed pages). For real memory use top -l 1 -o mem and vm_stat. Numbers in vm_stat end in . — strip with sed 's/\.//' before math.
  • sudo -n true to test for cached sudo without prompting; if it fails, print the manual command instead of hanging.
  • pnpm store prune / go clean -cache can hang — prefer rm -rf ~/Library/Caches/{pnpm,go-build} directly.

Read the full file on GitHub · 192 lines

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. 7d ago First seen · 192 lines · 91 tokens per session scan D 6059421301c6

Subscribe to this mod's changes

mac-deep-clean is a skill published in the GitHub repository randomittin/heimdall (5 stars, last pushed 3d ago), licensed MIT. It adds 91 tokens to every session and 2,945 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it D with 3 findings (asks for root, reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-09.

Related

Other skills, from other repositories

atomic-debug

Hypothesis-driven debugging skill. Use when a bug, test failure, crash, or unexpected behavior is reported. Auto-trigger on error pastes or "broken/doesn't work/failing" language. Explicit invocation: /atomic-debug. Output: symptom statement → hypothesis table → cheapest test first → root cause. No symptom-patching.…

damusix/atomic-claude · 114 tokens

sipcode-regress

Check the user's own local Claude Code and Codex logs for regressions after an update (prompt-cache misses, 5-minute cache TTL, uncached context, hourly cache rebuilds, Codex usage limit draining faster per token) and pin each one to the version that introduced it, using the Sipcode CLI. Use when the user asks whether…

Anuj7411/sipcode · 105 tokens

vc:scout

Fast codebase scouting using shell search and optional parallel research agents. Use for file discovery, task context gathering, and quick scoped searches across directories.

opencue/cuecards · 34 tokens

vc:debug

Debug systematically with root-cause analysis before fixes. Use for bugs, test failures, unexpected behavior, performance issues, CI failures, or system investigation.

opencue/cuecards · 34 tokens

vc:chrome-devtools

Automate browsers with Puppeteer CLI scripts and persistent sessions. Use for screenshots, performance analysis, network monitoring, web scraping, form automation, JavaScript debugging.

opencue/cuecards · 38 tokens

vc:sequential-thinking

Apply step-by-step analysis for complex problems with revision capability. Use for multi-step reasoning, hypothesis verification, adaptive planning, problem decomposition, course correction.

opencue/cuecards · 36 tokens