Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/disk-hygiene/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "disk-hygiene",
"version": "0.9.0",
"version": "0.9.1",
"description": "Context-aware disk hygiene for arbitrary directory trees: inventories orphaned and temporary artifacts, classifies evidence into review tiers, and offers exact-path cleanup only after a fresh safety preview and explicit per-tier approval. The target is read-only by default; OS-managed paths, links and mount points, VCS-tracked content, changed entries, and live-handle uncertainty fail closed.",
"author": {
"name": "Melodic Software",
Expand Down
14 changes: 14 additions & 0 deletions plugins/disk-hygiene/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
All notable changes to the `disk-hygiene` plugin are documented here. Format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this plugin uses semantic versioning.

## [0.9.1]

### Changed

- **The PowerShell lane's documented coverage now names what it does not flag (#386).**
`reference/safety-model.md` and the clean skill's PowerShell gotcha described the lane as gating
"known deletion spellings" without stating that destructive non-deletion spellings — `Move-Item`,
`Rename-Item`, overwriting writers (`Set-Content`/`Out-File`/`>`/`New-Item -Force`), and
`Format-Volume`/`Clear-Disk` — reach the tool with no guard verdict, audit-only mode included. The
gap is now disclosed where the security model is stated, naming the consumer's permission policy as
its only backstop — the manual handoff's per-path approval covers the paths selected for removal, so
it does not reach what these spellings collaterally destroy. Docs only; the guard's behavior is
unchanged and closing the gap is tracked in #387.

## [0.9.0]

### Fixed
Expand Down
9 changes: 5 additions & 4 deletions plugins/disk-hygiene/skills/clean/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ unless bounded with `--max-depth` or confirmed with `--confirmed-large-scan`.
value could not be read. The guard now enforces this independently: it resolves the same
`disk_hygiene_enabled` toggle by reading it straight from your user `settings.json` (the read is
shared with this probe, and the settings file is located from the tamper-resistant
`${CLAUDE_PLUGIN_ROOT}` — not the environment), so in audit-only mode it denies every mutation lane
outright — the Bash engine `apply` and the PowerShell deletion belt alike. Running the probe still
`${CLAUDE_PLUGIN_ROOT}` — not the environment), so in audit-only mode it denies both mutation lanes
it gates outright — the Bash engine `apply` and the PowerShell deletion belt alike. Running the probe still
matters so you can state the configured value accurately and stop before proposing work the guard
would deny; the guard is the backstop, not the sole enforcer. The hook runs in shell-free exec form and reports its absolute Python
interpreter and the authorized `--data-root` value in denial guidance. Use that exact interpreter
Expand Down Expand Up @@ -336,8 +336,9 @@ sparse files, hard links, compression, and delayed allocation affect it.
(`CLAUDE_TOOL_NAME` does not exist).
- The PowerShell lane is the inverse tradeoff: it stays open for read-only support work (git, gh,
metadata probes) and instead hard-denies engine invocations and turns known deletion spellings
into a final human permission prompt. It is a raised bar, not a fail-closed lane; the engine's
own containment and the Bash lane remain the deletion authority.
into a final human permission prompt. It is a raised bar, not a fail-closed lane — move, rename,
overwrite, and volume-format spellings are not flagged at all (`reference/safety-model.md`); the
engine's own containment and the Bash lane remain the deletion authority.
- The guard rejects `~` anywhere in a Bash command as a shell-expansion character, which includes
Windows 8.3 short names (`SOMEUS~1`). Always pass long-form paths; the guard's own disclosures
are already long-form.
17 changes: 15 additions & 2 deletions plugins/disk-hygiene/skills/clean/reference/safety-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ switch. When the guard sees execution enabled they are downgraded to a final hum
when it sees a configured `false` (audit-only mode) they are denied outright, so the kill switch would
block deletions on the PowerShell lane too and not only the Bash engine apply.

Because this lane enumerates spellings instead of denying unknown commands, its coverage is
knowingly partial: the flagged set is deletion- and recycle-shaped (plus `robocopy` mirror/purge/move
and .NET `Delete`), so destructive **non-deletion** spellings — `Move-Item`/`mv`, `Rename-Item`,
overwriting writers (`Set-Content`, `Out-File`, `>`, `New-Item -Force`), and volume operations
(`Format-Volume`, `Clear-Disk`) — reach the tool with no guard verdict at all, in audit-only mode
included. The only thing standing between them and the filesystem is the consumer's own permission
policy, never this guard: the manual handoff's per-path approval covers the paths selected for
removal, so it does not reach what such a command collaterally destroys — a `Move-Item -Force`
destination, a truncated `Out-File` target, or an entire volume.

TODO(#387): extend the flagged set to those spellings.

**Kill-switch enforcement (since 0.9.0): both surfaces resolve it by reading user settings.** The guard
registers on two surfaces — the **plugin-level engine gate** (`hooks/hooks.json`, exec form,
`--mode engine-gate`) and the **skill-scoped belt** (the clean skill's frontmatter hook) — and both
Expand All @@ -168,8 +180,9 @@ engine invocation **whether or not the clean skill is active**; it defers (no ou
does not reference the engine, so it does **not** see PowerShell deletion spellings. Those are enforced by
the **skill-scoped belt** (`powershell_decision`) — denied outright in audit-only — only **while the clean
skill is active**. An absent, unreadable, or ambiguous read fails **closed to enabled**: the guard stays
active and forces a human prompt before every mutation, so an unreadable toggle never silently disables
the guard.
active and forces a human prompt before every mutation **it sees** — every Bash engine `apply`, and on
PowerShell only the flagged spellings above — so an unreadable toggle never silently disables the
guard.

This replaces the earlier delivery, where the gate carried a bare `${user_config.disk_hygiene_enabled}`
argument. Because the declared userConfig `default` is not implemented upstream
Expand Down