Description
plugins/disk-hygiene v0.20.21. Split out of the audit umbrella. F13, medium-high. Cheapest high-value fix in that report: a message change, no behavior change.
Problem
The plugin has two Bash-denying surfaces with opposite scopes:
- The always-on engine gate — registered in
hooks/hooks.jsononPreToolUsematcherBash|PowerShellwith no invocation predicate. Active in every session whether or not/disk-hygiene:cleanwas ever invoked. - The session belt — the skill's frontmatter hooks, registered when the skill is invoked and staying registered for the rest of the session (
disk-hygiene:clean: frontmatter Bash belt is session-lifetime, not skill-scoped (+6 findings from a post-use audit) #2618).
They emit identical denial text. A user who has never invoked the skill triggers the always-on gate and is told their Bash lane is restricted to the skill's scan/preview/handoff-verify/apply shapes — describing a lockout they did not opt into, in the words of a different guard.
Evidence
This misled the audit itself. A Bash denial was initially attributed to the session belt and written up as such. A two-cell control isolated it to the always-on gate, and the finding was withdrawn (F9.1/F9.2). If an audit reading the plugin's own source got this wrong from the message text, an ordinary user has no chance.
The withdrawal also corrected a related claim: the belt does not reach subagents. That non-inheritance is undocumented and build-specific, so it should not be documented as a recovery lane without that caveat.
Suggested fix
Branch the denial message on resolve_mode() so each guard explains itself:
- Always-on gate: say that this specific engine invocation is what is gated, that the rest of the Bash lane is unaffected, and that the skill need not have been invoked for this to fire.
- Session belt: say that
/disk-hygiene:cleanwas invoked in this session, that the belt persists until the session ends, and name the recovery lanes — including that a subagent does not inherit it, caveated as undocumented.
No behavior change, no scope change. The two guards keep doing exactly what they do; they stop claiming to be each other.
Related
Umbrella: #3347. F9.3/F9.4 in that issue cover the belt's missing escape hatch and its over-broad scope, which are separate and larger.
🤖 Generated with Claude Code
Activity
claude commentedon Sep 5, 2026
Generated by Claude Code
claude commentedon Sep 5, 2026
This was generated by AI during triage.
Triage: verified → briefed (delegable)
Lane: autonomous triage, instance
vm-triage-202609050304. Claimed via the tracker seam.Verification — the finding still reproduces, and it reproduced on this triage session
The issue was filed against
disk-hygienev0.20.21; currentmainships v0.21.7. The finding survives the version gap.Re-checked against the current source:
hooks/hooks.jsonstill registers the engine gate onPreToolUsefor bothBashandPowerShell, with--mode engine-gate.destructive_guard.pybranches on mode in only four places (resolve_mode()call sites at L2007, L2046, L2084, and the_MODE_ENGINE_GATEcomparison at L2084 selectingaskvsallow). None of them branches the denial text._bash_denial_guidance(authority)(L2116), which is keyed onauthority, not onresolve_mode(). That is the mechanism behind the finding: one message body serves both guards.First-hand reproduction, this session. This triage session never invoked
/disk-hygiene:clean. A routine read-only inspection command that merely named the engine file was denied by the always-on engine gate with the belt's wording:That is exactly F13: a session that never opted in is told its Bash lane is restricted, in the session belt's words. The audit's own misattribution (F9.1/F9.2, withdrawn) is reproduced here by an independent reader.
Classification
work-class: scoped(already applied, and correct — message text only, no behavior change).priority: mediumretained. The reporter's medium-high maps to the repo's medium band; the surviving reproduction argues for the top of that band, not above it.Brief (executable from this comment alone)
Goal. The always-on engine gate and the session belt stop claiming to be each other. No behavior change, no scope change.
Change. In
plugins/disk-hygiene/skills/clean/scripts/destructive_guard.py, branch the denial guidance onresolve_mode()in addition toauthority._bash_denial_guidance()currently takes onlyauthority; give it the mode (or call it from a mode-aware wrapper) and emit two distinct bodies:engine-gatemode — say that this specific engine invocation is what was gated; that the rest of the Bash lane is unaffected; and that/disk-hygiene:cleanneed not have been invoked for this to fire.beltmode — say that/disk-hygiene:cleanwas invoked in this session; that the belt persists until the session ends; and name the recovery lanes.One caveat that must ride along. When the belt message names recovery lanes, the "a subagent does not inherit the belt" lane must be marked as undocumented and build-specific. The audit withdrew the opposite claim (belt does reach subagents) after a two-cell control; stating the non-inheritance as a supported recovery route without that caveat would re-introduce a withdrawn claim as documentation.
Acceptance criteria.
engine-gatemode and a denial raised inbeltmode produce textually distinct reasons, each naming its own trigger condition.engine-gatetext does not assert that the Bash lane in general is restricted.belttext names the subagent non-inheritance lane with the undocumented/build-specific caveat attached.skills/clean/scripts/test_hygiene.pyassert the two texts differ and that each contains its own trigger phrase (the file already hasresolve_modecoverage around L7037 and L7618 to extend).reasonstring. Existing decision assertions stay green.Out of scope (tracked separately in the #3347 umbrella). F9.3 / F9.4 — the belt's missing escape hatch and its over-broad Bash scope. Those are behavior changes; this is not.
Verification command
Python in this repo lints through the pinned wrapper:
scripts/run-ruff.sh check plugins/disk-hygiene. Select suites withscripts/affected-tests.sh --run.Raw marker cleared;
agent-ready+status: readyapplied. Lease released on completion of this triage.Generated by Claude Code
feat(disk-hygiene): add scan --quiet to drop the duplicated children_…
perf(disk-hygiene): if-gate the PowerShell engine gate on the engine'…
fix(disk-hygiene): name the failing token and flag-order rule in the …