Repository navigation
Description
Four low-severity findings, plus one skill-quality:check failure, from one audit of disk-hygiene 0.23.12 on Windows 11 Pro 10.0.26200, Claude Code 2.1.278, auto mode. Each can land on its own.
1. Recycling then emptying the bin per item doubles the prompts (F5)
Problem
After recycling approved paths, the Recycle Bin was emptied per item, because the skill forbids container-wide Clear-RecycleBin. Each per-item bin delete (InvokeVerb('delete'), flagged in destructive_guard.py lines 1356-1403) is its own hook ask. That turns N prompts into 2N. The os_autoclean advisory in the same session reported Storage Sense enabled with recommendation null. Recycle versus permanent delete was never offered as the approval choice.
Proposed fix
- Skill text: after a recycle, do not empty the bin. When
os_autocleanreports Storage Sense enabled, point at its retention instead. - When the operator wants the space back now, offer "recycle" or "permanent" as the approval choice.
reference/unsupported-platform-handoff.mdlines 119-125 already defines a permanent-delete approval named as irreversible. One gated operation per path instead of two.
Acceptance criteria
- The skill does not empty the Recycle Bin after a recycle unless the operator asked for the space back.
- The approval question offers "recycle" and "permanent" as distinct choices, with permanent named as irreversible.
- Choosing permanent produces one gated operation per path, not a recycle plus a bin delete.
2. Standing protected globs are target-relative, even in the user-global file (F7)
Problem
The operator asked to "not flag eSupport in the future". The only mechanism is additional_protected_path_globs in ~/.claude/disk-hygiene.json, and its globs match relative to the scan target. eSupport only matches when the target is C:\ with root-children selected. There is no absolute anchor and no way to record the operator's decision with a reason.
Root cause
hygiene.py lines 1570-1578 match relative against additional_protected_path_globs. The docstring at lines 654-659 states the limitation.
Note: a protected entry is still reported as protected, so protection does not stop it being flagged, which is what the operator asked for. #4008's operator-answers catalog is the right home for a "reviewed, keep, don't resurface" disposition.
Proposed fix
- Treat a pattern where
os.path.isabsis true as matched against the entry's resolved absolute path. Protection can only keep more, so this is strictly safe and needs no schema bump. - Accept
{"glob": ..., "reason": ...}objects alongside strings, so a decision carries its reason (disk-hygiene: persist a catalog of investigated entries — record shape, scope, investigation procedure, and operator answers #4008).
Acceptance criteria
- An absolute glob such as
C:/eSupportprotects that directory in a scan ofC:\root-children and in a scan of any other target that contains it. - Relative globs behave as today.
- A
{"glob", "reason"}object is accepted and its reason appears in the output for matched entries.
3. The session belt does not reach subagents (corroborates #3347 F9)
Problem
The audit subagent was dispatched from the session whose Bash lane was belt-denied, yet it ran gh, curl, and bash freely. Only the plugin-level engine gate fired. This confirms on Claude Code 2.1.278 that the belt is not inherited by subagents.
It is also a bypass surface: a fan-out worker subagent sees no PowerShell deletion ask from the belt, and the skill's "workers return evidence only" rule is prose, not enforced.
The hooks page (hooks.md lines 690-693, rung 1 curl, 329656 bytes, fetched 2026-09-19) describes skill-hook lifetime but says nothing about subagent reach. This is observed behavior, not documented behavior.
Proposed fix
- Document the non-inheritance in SKILL.md next to the fan-out worker brief.
- Enforce "workers return evidence only" in a hook that fires for subagents (for example the always-on plugin-level gate), not only in prose.
Acceptance criteria
- SKILL.md states that the belt does not apply inside subagents.
- A subagent dispatched during a clean run cannot run a PowerShell recycle or delete without a hook
askor deny.
4. SKILL.md understates the Bash-lane allowlist (F8)
Problem
SKILL.md lines 380-382 say only the literal-word engine shapes plus the probe pass the Bash lane. The guard also admits an absolute-path read-only supporting allowlist: [, basename, dirname, du, file, find, ls, pwd, stat, test (is_exact_readonly_supporting_command, destructive_guard.py lines 1216-1245). In engine-gate mode it answers those with ask rather than allow (line 2108). The denial text is the accurate copy.
Proposed fix
Name the allowlist in SKILL.md, or point to the denial text as the source.
Acceptance criteria
- SKILL.md lists the read-only supporting commands the Bash lane admits, or points to the one place that does.
- SKILL.md states that engine-gate mode answers them with
ask.
skill-quality:check
Problem
skill-quality:check (0.23.1) on the installed clean skill (cache copy of 0.23.12, Windows 11, Git Bash, markdownlint skipped) returned FAIL with 2 errors:
FAIL: script test failed: scripts/guard_launch_monitor.test.shFAIL: script test failed: scripts/hygiene.test.sh
Both fail with ValueError: Empty module name from unittest. The wrappers run "$PYTHON" -m unittest -v "$SCRIPT_DIR/test_<name>.py". Under Git Bash, $SCRIPT_DIR is an MSYS path (/c/Users/...). A native Windows Python does not see that as an existing file, so unittest treats it as a dotted module name and fails. The same suite run with a Windows-form path (cygpath -m) passes (test_guard_launch_monitor.py: 28 tests, OK). The tests are fine; the wrapper never starts them on this host.
Proposed fix
Convert the test path to Windows form before handing it to Python when cygpath is available (for example in scripts/test-wrapper-lib.sh), or cd "$SCRIPT_DIR" and pass the bare file name.
Acceptance criteria
-
bash scripts/hygiene.test.shandbash scripts/guard_launch_monitor.test.shrun their suites under Git Bash with a native Windows Python. -
skill-quality:checkoncleanreports no script-test FAIL on that host.
Corroborating evidence for existing issues (not new findings)
- disk-hygiene: give the session belt an escape hatch and re-scope its deny-by-default to its actual threat model #3856 / disk-hygiene:clean — ceremony does not scale to stakes: audit of a real --execute run (13 live findings) #3347 F9.3. The audit session never invoked
clean, yet the always-on engine gate denied a read-onlycd .../skills/clean/scripts && grep -n ... hygiene.py, calling it "this specific engine invocation". The Grep tool worked. In the main session, every non-engine Bash command stayed denied for the rest of the session after the skill loaded. Suggested doc note: run/disk-hygiene:cleanin a dedicated session and end it afterwards; say so in SKILL.md before invocation and in the README, not only in denial text. - perf(hooks): Windows process-creation tax makes the hook set unusable - 1,778 timeouts / 20.6 hours blocked over 9 days #3508 / Hook performance program: measure and cut every runtime-cost surface on the Windows host #3623, performance. The belt registers
Bash|PowerShellwith noiffilter, so every PowerShell call for the rest of the session pays a bash launch plus Python startup. hooks.json adds three engine-gate PowerShell entries with differentifpatterns; a command matching several launches the guard several times. The hooks page documents no deduplication for sync hooks (it mentions none only for async, hooks.md line 3767). Not measured.
Found by /plugin-quality:audit (run 20260919T170952Z).
Activity
kyle-sexton commentedon Sep 23, 2026
This was generated by AI during triage.
Human-gated. Open decision: whether to offer permanent-delete as an approval choice and enforce evidence-only via a subagent-reaching hook (items 1 & 3); items 2 (abs-glob match), 4 (doc allowlist), 5 (test-wrapper cygpath) are delegable on their own
Merge origin/main into cursor/4228-disk-hygiene-close-37e9
fix(disk-hygiene): close small-item audit with abs globs, wrappers, d…
fix(disk-hygiene): drop recycle-or-permanent handoff choice, merge main
fix(disk-hygiene): absolute protection globs, cygpath wrappers, allow…
kyle-sexton commentedon Sep 29, 2026
Second observation of item 3 ("belt does not reach subagents"), with a twist: reach was inconsistent within one session on disk-hygiene 0.28.14 / Windows 11.
git, arbitrary commands) while the parent session's Bash lane was belt-denied.So the item-3 wording "not inherited by subagents" is too strong. The observed behavior is nondeterministic, which is worse in both directions (unreliable protection, unreliable availability). Whoever takes #3856 item 4 ("establish subagent behavior empirically") should test more than one spawn shape (agent type, foreground/background, nested) and record which enforce the skill-frontmatter hook.
With an inconsistent belt, "workers return evidence only" cannot be relied on as prose.
Basis: the session evidence above;
skills/clean/SKILL.md:6-24(frontmatter hook). The exact spawn shapes that were blocked versus free were not recorded.🤖 Generated with Claude Code
https://claude.ai/code/session_01K3VkbjLqtYZ6JtsQaDKP4v
docs(disk-hygiene): restore README section, reconcile guard and gate …
docs(disk-hygiene): drop the "deliberate" label from the no-interpret…
fix(disk-hygiene): treat UNC protection globs as absolute and report …
chore(disk-hygiene): release 0.29.0
kyle-sexton commentedon Sep 29, 2026
This was generated by AI during fix work on the 2026-09-29 audit of the unattended Cursor run.
Status after #5336. The issue stays open,
needs-human.Complete.
SKILL.mdrecords that belt reach was inconsistent, per the second observation on this issue.Open owner decisions.
Stranded draft. The item-1 docs draft (recycle-or-permanent choice) exists only in closed PR #4884 (branch
cursor/4228-recycle-or-protect-docs-37e9). It was intentionally not carried into #4975 because the choice is the owner's. The supersede comments on #4884 and #4946 promised a close that never happened; #4975 says #4228 stays open, so it does.kyle-sexton commentedon Sep 29, 2026
Owner decision (2026-09-29): Decide with evidence. The owner accepted the recommendation and delegated gathering the evidence; the final call on permanent delete (item 1) and the subagent-reaching hook (item 3) stays with the owner because both touch the irreversible deletion lane.
Next: an agent gathers and posts (a) for item 3, an empirical test of belt reach across spawn shapes (agent type, foreground/background, nested) per #3856 item 4, and (b) for item 1, the #1116 security review findings and the closed PR #4884 draft (branch cursor/4228-recycle-or-protect-docs-37e9). It then stops. The issue keeps needs-human for the final decision.
docs(disk-hygiene): drop stale issue-status claims from records and c…
kyle-sexton commentedon Sep 30, 2026
This was generated by AI during triage.
Evidence for the two open owner decisions, gathered as the 2026-09-29 owner decision asked. No decision is made here: the final call on item 1 (permanent delete as an approval choice) and item 3 (a subagent-reaching hook) stays with the owner. This issue stays open with
needs-human.Item 3: does the session belt reach subagents
Setup: Claude Code 2.1.285, headless (
claude -p --permission-mode auto --model sonnet --output-format stream-json --include-hook-events), Linux (WSL2) x86_64, Bash lane only. disk-hygiene from the repo checkout, manifest 0.28.18 (user-scope install is 0.28.17). Each case ran/disk-hygiene:clean <target>(audit only) and its probes inside one process. Hook attribution comes from the denial-text prefix, or from the count ofPreToolUse:Bashhook responses per call (parent with skill loaded: 2; subagent: 1).echo belt-probe-parentecho,lsrun_in_backgroundecho,lsecho,lsechoin the inner agenthygiene.pyecho ... hygiene.pyecho x/echo x hygiene.py--resumeprocess BReading:
hooks/hooks.json) does reach subagents, but acts only on commands that reference the engine.echoandlsfrom a subagent are gated by nothing in disk-hygiene, so "workers return evidence only" is prose for every other command.--resume.Limits: Linux/WSL Bash lane only. No Windows host and no PowerShell lane, so the PowerShell deletion asks and the Windows path are untested and stay operator-only. No engine deletion command was run, so the engine gate's deny/ask text for a real engine invocation from a subagent was not exercised. Parent and subagents ran on Sonnet. Sample is small.
Basis: transcripts
.work/drain/4228-evidence/case*.jsonlandRESULTS.mdin the drain worktree/home/kyle/worktrees/ccp-drain-4228(gitignored, local to this machine); hook configplugins/disk-hygiene/hooks/hooks.json; belt text inplugins/disk-hygiene/skills/clean/SKILL.md:6-24; current documented stateSKILL.md:213-221(belt does not apply inside subagents, enforcement parked).Decision for the owner: whether to add a hook that fires for subagents. Evidence above: only a plugin-level hook reaches them, and it would gate commands beyond engine invocations, which is a new hook surface (
SKILL.md:219-221).Item 1: permanent delete as an approval choice
#1116 (Windows engine-execution lane). The owner affirmed the decline on 2026-07-23. The reversal trigger: if
handoff-verifyproves insufficient in practice (a post-#1109 near-miss recurrence), reopen as a design issue with full security review. Recorded by PR #1123 (e14f21e). Basis: #1116 comments;plugins/disk-hygiene/skills/clean/reference/safety-model.md:137-140("Windows and macOS execution stays declined by design ... A near-miss recurrence in the manual lane reopens this as a design question with full security review"). Nothing in this issue reports a near-miss, so the trigger has not been shown to fire.Closed PR #4884 (Cursor agent, closed 2026-09-28, branch
cursor/4228-recycle-or-protect-docs-37e9, 117-line diff, Refs #4228). It proposed:unsupported-platform-handoff.mdstep 2: recycle versus permanent is the approval choice; do not empty the bin after a recycle; permanent is a distinct irreversible approval, one gated operation per path.InvokeVerb('delete')on the bin after a recycle is the container-wide class; skip it.SKILL.mdconfirmation-gate table: the manual-handoff approval also names recycle or permanent.Not on main and not in open PR #5336: proposals 1 to 3 (grep of
origin/mainfor "do not empty" and "InvokeVerb" inSKILL.mdand the handoff doc finds nothing).Permanent-delete approval already defined.
plugins/disk-hygiene/skills/clean/reference/unsupported-platform-handoff.md:158-171: a path longer than 260 characters cannot reach the Recycle Bin, and the fallback is a\\?\permanent delete that "does not inherit the approval given for a reversible removal". The agent stops, names the path, and re-asks through the confirmation gate for permanent deletion of that exact path, "named as irreversible". It is recorded as permanent in the summary. This is the one gated operation per path that item 1 asks for, limited today to over-length paths. The issue cites lines 119-125; the text moved to 153-171. The container-wide ban that forces the current two-step (recycle, then per-item bin delete) is atunsupported-platform-handoff.md:172; the per-item bin delete is flagged indestructive_guard.py(_shell_application_recycle_bin_delete_reason, line 1652).SKILL.md:233already points at Storage Sense as the owner of deferred reclaim, in general and not tied to the recycle approval.Decision for the owner: whether to extend the existing permanent-delete approval from over-length paths to a general "recycle or permanent" choice, and whether to add "do not empty the bin after a recycle". Both touch the irreversible deletion lane, and the reversal trigger recorded for #1116 (a near-miss) has not been reported.
Basis for this section:
git show origin/mainat 7808ec0 for the files above;.work/drain/4228-evidence/pr4884.diffanditem1-summary.md(local, gitignored).Owner call
The final call on item 1 (permanent delete as an approval choice) and item 3 (a subagent-reaching hook) stays with the owner.
fix(disk-hygiene): repair audit findings in guards, scan ladder, docs…
kyle-sexton commentedon Sep 30, 2026
Owner decision (2026-09-30): Item 1 (Q1b): keep permanent delete confined to the existing over-length-path case (
plugins/disk-hygiene/skills/clean/reference/unsupported-platform-handoff.md:158-171). Do not add a general recycle-or-permanent approval choice. Land only the one docs sentence "do not empty the bin after a recycle", consistent with the container-wide ban atunsupported-platform-handoff.md:172. Reopen the general choice only on a reported near-miss, per the #1116 reversal trigger (safety-model.md:137-140), with full security review. Item 3 (Q2b): add no subagent-reaching hook. Keep the enforcement parked, leave theSKILL.md:205-221wording (belt does not reach subagents, workers return evidence only, parent owns all execution) and its recheck trigger on upstream change. Rationale: no near-miss or incident is reported, the plugin-level engine gate already reaches subagents for commands that invoke the engine, and the evidence is Linux/WSL Bash only, so a broad new hook on a security-class surface is unearned.Approved by the owner with all consensus recommendations on 2026-09-30 (three read-only researchers, majority or judge).
Next: an agent lands the one-line docs change in
unsupported-platform-handoff.mdin a PR (Closes #4228). The issue is labelledagent-readyandneeds-humanis removed.docs(disk-hygiene): state belt lifetime and subagent reach from a 2.1…
feat(disk-hygiene): policy overlay v2 with preselect rules, age thres…
feat(session-flow): add an opt-in tidy-work skill for .work (#5447)