/disk-hygiene:audit [--max-depth <N>] [--sizes-only] [--policy <file>] <target-directory>from disk-hygiene
Scans a directory tree for orphaned, temp, stale-lock, and empty files, reporting evidence without modifying anything. Useful for disk hygiene audits.
Ships in disk-hygiene. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Arguments. [--max-depth <N>] [--sizes-only] [--policy <file>] <target-directory>. Full form: [--max-depth <N>] [--sizes-only] [--quiet] [--policy <file>] [--root-children [--root-child <name>]...] <target-directory>
Scan one directory tree and report what the snapshot shows. This skill runs the engine's scan
subcommand and nothing else, and it changes nothing in the target. A filename pattern is a
discovery hint, never proof that an entry is junk.
This skill carries no hooks of its own. Safety rests on the plugin-level engine-gate in
hooks/hooks.json, which checks every Bash or PowerShell call that names hygiene.py. Run
hygiene.py only through the Bash tool; the gate denies an engine call made through the PowerShell
tool. Run no engine subcommand other than scan, no shell command that writes, moves, or deletes
under the target, and no compound shell around an engine call. A subagent follows that contract
itself, from the worker brief in step 2.
Run the argument-free probe first, before any engine call:
"<hook-python>" "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/kill_switch_probe.py"
Take hook_python and data_root from its one-line JSON. Every engine call needs the absolute
<hook-python> and --data-root; a bare python3 is rejected. When hook_python is not yet
known, submit the probe once with bare python. The probe reports hook_python as the interpreter
it ran under, so that value is the guard's only if the guard's own interpreter ran it. The scan is
admitted only under the guard's interpreter: if it is denied for that reason, the denial names the
interpreter and ran nothing, so rerun the scan with the interpreter it names.
data_root is null: the install layout proved no data root and the guard denies every engine
call. Report the audit as not run, submit no engine call, and stop.MIN_PYTHON in
hygiene.py: stop with that declared prerequisite. An older
hook_python from a bare-python probe is not that finding; the scan's admission settles it.effective is false (audit-only): the scan still runs. State the configured value, and leave
out the removal handoff in step 4. On degraded: true, say the configured value could not be read.Pick a unique run directory under <data_root>/runs/; the snapshot lives there, never in the
target. With no target, ask the person who invoked you once. Reject an OS-managed root, a missing
directory, a symlink, or a Windows reparse point.
"<hook-python>" "${CLAUDE_PLUGIN_ROOT}/skills/clean/scripts/hygiene.py" scan \
--target "<target>" --output "<run-dir>/snapshot.json" \
--data-root "<data_root>" [--project-dir "<project-dir>"] \
[--policy "<policy.json>"] [--user-policy "<policy_file>"] \
[--max-depth <N>] [--sizes-only] [--quiet] \
[--root-children [--root-child <name>]...]
--project-dir is optional; pass it, as a literal absolute path, when the consumer project has
standing policy files. --user-policy takes the policy_file option's value,
${user_config.policy_file}, only when it reads as a path. Pass literal values only: the guard rejects shell expansion, so never pass
an environment-variable reference. What each flag does, including the large-target and volume-root rules, is in
scan-flags.md. For a home directory or another large target,
start with --max-depth 1, then scan the subtrees the evidence justifies. Never pass
--confirmed-large-scan on your own: an unbounded walk needs a person's answer.
For a subtree worker, the brief to paste into the spawn prompt is
fan-out-worker-brief.md. Before spawning, replace every
${...} token and <placeholder> in it with the literal absolute value you hold from the probe
(hook_python, data_root) or from step 2: a worker cannot expand ${...} tokens, and its data
root is the probe's data_root. A worker returns scan evidence only.
Report from the snapshot and the scan's stdout, and nothing the run did not observe.
children_rollup. walked: true rows carry exact totals; walked: false rows carry
null aggregates and unwalked_reasons, so report them as coverage gaps, never as small or clean.reclaimable_local_bytes, not logical_bytes. An entry whose size_qualifiers is
non-empty stays out of any reclaimable total; state its bytes and reasons separately.truncated_paths (a count under --quiet, the list in the snapshot) and every scan error
as coverage gaps. A large-target-confirmation-required or root-children-selection-required
status names the next step, not a failure.hinted_entries of entries, never "N findings". Quote
ranked_entries of entries beside it, and order the entries you list by review_rank
position, naming each entry's signals and group. Show an unranked entry as unranked, not in
a middle position. A rank orders review only and ranks nothing for deletion.os_autoclean recommendation as the engine
states it. A scan does not assess live handles or elevation, so it yields no locked,
needs-elevation, or unverified entries: say those were not assessed, never that there are none.protected_reasons,
size_qualifiers). A hint has no owner check behind it, so label the list hints for a person to
judge, not verdicts, and rank nothing for deletion. Empty directories stay visible.Removal is a separate /disk-hygiene:clean run. Close the report with the snapshot path
and that one line. Do not start a removal run and do not propose exact paths for one. When
effective was false, say instead that removal is disabled by the plugin's configuration.
/disk-hygiene:clean <target-directory>
Run when the findings warrant removal and the user wants it; it takes the same target, not this snapshot.
--bg default parked, headless bypassPermissions denied) ran on Claude Code 2.1.285.
Pointer: when checking how a mode treats a Bash call no hook adjudicates, fetch
Available modes and
PreToolUse decision control
live. As of: 2026-11-10. Recheck trigger: a Claude Code release changes how permission
modes treat Bash calls no hook adjudicates.--plugin-dir load the probe can report data_root as null even though the
plugin data directory exists. Stop as step 1 says; do not substitute a guessed path. Claim: the
guard derives data_root only from the <plugins>/cache/<marketplace>/<name> install layout or a
registered directory marketplace, so a checkout loaded inline reports null. Basis: the probe
recorded in #5590, run from a
checkout with neither, reported hook_python resolved and data_root: null on Claude Code
2.1.285 (Linux); the derivation rule is in
safety-model.md, "Local-directory marketplace installs".
As of: 2026-09-30. Recheck: the guard's data-root derivation changes, or a Claude Code
release documents a plugin data path for --plugin-dir loads.What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/cleanDisk hygieneAudit a directory tree for orphaned, temp, stale-lock, failed-write, partial-download, and empty leftovers; classify by tier; remove validated paths after explicit per-tier approval (read-only by default). Use when: 'audit this directory', 'what junk can I clean up', 'find temp or lock leftovers'. Not for repos: /repo-hygiene:clean, GC, OS roots./setupVerify disk-hygiene prerequisites, platform posture, kill switch, and old policy files; check (read-only) or apply (remediation/migration).npx claudepluginhub melodic-software/claude-code-plugins --plugin disk-hygieneOther plugins' skills for the same job