Skip to content
Back to skills

Disk Magician

ASecurity

Use when diagnosing disk capacity or growth and when previewing repository-gated cache, temp, or worktree cleanup.

  • 6 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 26, 2026
testingbashsqlrailsgit

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add jleechanorg/jleechan-skills --skill disk-magician --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Disk Magician?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Disk Magician
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jleechanorg-disk-magician/badge)](https://www.skillsdirectory.com/skills/jleechanorg-disk-magician)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: disk-magician
description: Use when diagnosing disk capacity or growth and when previewing repository-gated cache, temp, or worktree cleanup.
---

# Disk Magician — Claude Skill

This skill teaches Claude how to use `disk_magician` to audit disk space, identify growth regressions, and perform cleanups.

## Measurement rule

All Disk Magician measurements, reports, cleanup previews, and candidate scans follow `../disk-root-cause/SKILL.md` § Mandatory 100 MiB directory descent. A large directory total or prefix bucket locates where to investigate; it cannot stand in for child measurements, leaf age, or reclaim eligibility. Candidate size filters such as `DISK_MAGICIAN_SCRATCH_MIN_KB` only prioritize already traversed candidates; they never limit descent.

## Skill Integration & Commands

* **Which procedure**: a quick capacity check runs the zero-`du` triage in `../disk-audit/SKILL.md`. A reclaimable-amount estimate, root-cause investigation, or cleanup-target decision runs the full forensic procedure in `../disk-root-cause/SKILL.md`. Do not stop at a quick check when the request needs attribution. On the quick path, escalate when precomputed data is missing or its owner reports it stale or incomplete; follow the probe result rather than a fixed interval.
* **Default forensic diagnosis (attribution only)**: For a root-cause, floor, growth, or reclaim-estimate request, follow `../disk-root-cause/SKILL.md` after the quick probes. Run the full three-lane `diskm audit` unless a current report proves complete 100 MiB leaf coverage for every requested path and period; directory-aggregate snapshots do not prove this coverage. Use resolved portions, name unfinished paths, and do not estimate reclaim from incomplete paths.
* **Cleanup previews**: Use the canonical preview interfaces before choosing a cleanup target:
  ```bash
  diskm clean --dry-run
  diskm clean-all --dry-run
  diskm worktree-hygiene
  ```
  `worktree-hygiene` is report-only by default. For a narrower preview, use the selected `diskm` cleanup command with its documented dry-run mode.

  Never report the cleanup stack exhausted while free space remains below target. If a run reports `0 B` reclaimed, inspect the per-target skip reasons (such as `kept:lease-busy`, `kept:recent-activity`, or `kept:admin-unknown` when emitted) and the current lock holder before concluding there are no eligible targets.

## Safety Constraints & Guardrails
- **Recency:** Follow each canonical cleanup command's current per-tool mtime, activity, lease, owner, and Git safety rules. Do not add a 14-day floor or override an owner's rule.
- **Action gates:** A live request or existing standing authorization covers the same action, targets, and outcome across its steps. Complete that work with the canonical `diskm` command and satisfy its documented gates. Flags such as `WORKTREE_APPROVED=1` activate a command gate; they do not grant authority. Ask before expanding to new actions or targets not covered by the request.
- **Never-delete list:** Never delete, quarantine, truncate, or prune `~/.codex/sessions`, `~/.codex/sessions_archive/`, `~/.codex/state*.sqlite`, `~/.codex/log`, or `~/.claude/projects` by any command. The normal cleanup path is not an exception. Read-only metadata measurement may follow the 100 MiB descent rule without reading file contents.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.