Skip to content

fix(disk-hygiene): the clean skill's PowerShell belt is gone after --resume, so a manual-lane delete runs unprompted #9853

Closed

Description

@kyle-sexton

Problem

The /disk-hygiene:clean skill-frontmatter belt is the only gate on PowerShell deletion spellings in the Windows manual lane. The always-on engine gate defers on any command that does not name the engine. plugins/disk-hygiene/skills/clean/reference/safety-model.md (the paragraph on the kill switch's two surfaces) says the belt is registered "for the rest of the session after the skill is invoked" and that "only the session's end clears it".

A live probe on Windows shows the belt is not registered after claude -p --resume <id>, which starts a new process on the same session id.

Evidence (melo-desk-001, native Windows, Claude Code 2.1.309, disk-hygiene 0.43.21, headless --permission-mode auto, CLAUDE_CODE_USE_POWERSHELL_TOOL=1)

  • One process (two sequential stream-json messages): the PowerShell [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile(<path>, 'OnlyErrorDialogs', 'SendToRecycleBin') call logged belt ask, rule powershell-deletion-spelling, and landed in permission_denials. The file survived.
  • Turn 1 scan, then --resume turn 2 with the same approval: the same call logged no belt decision (engine-gate entries only) and no denial. The file was recycled.
  • A second, independent run: turn 1's PowerShell engine call logged both a belt and an engine-gate deny. After two --resume turns, turn 3's PowerShell engine call logged an engine-gate deny only, with no belt entry.

Only headless claude -p --resume was probed. Interactive claude --resume, --continue and /clear were not.

Full table: the #5609 comment of 2026-10-24.

Open question for the owner

Which gate should cover PowerShell deletions in the manual lane once the process that invoked the skill has ended?

  • A. Widen the always-on PowerShell hook's if patterns in hooks.json to cover the deletion spellings, at a cost to unrelated sessions.
  • B. Have a SessionStart resume hook re-arm the belt when the transcript shows /disk-hygiene:clean was invoked.
  • C. Document the limit and have the skill require the delete in the same process as the approval.

Also correct the safety-model claim whichever option is chosen.

Done when

  • The chosen gate is live, with a test, or the limit is documented.
  • safety-model.md states the belt's lifetime as observed, with a verification record.

Activity

  1. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 24, 2026
  2. github-actions commented on Oct 24, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Decision recorded.

    Decision: D. A resume notice comes from the existing SessionStart entry. On source: resume, when the per-session clean-invoked marker exists, it tells the model to stop all deletes and overwrites until the user re-types /disk-hygiene:clean. That re-registers the skill-frontmatter belt. The stale "Not probed: Windows PowerShell" claims in safety-model.md and unsupported-platform-handoff.md get fixed in the same change.

    [quote truncated; the full decision is at the link]

    #9853 (comment)

    I understood the report as follows. The clean skill's PowerShell belt is not registered after claude -p --resume, so a manual-lane delete can run without a prompt. The recorded decision picks option D: a resume notice plus corrected safety-model claims. It settles the open question, so I'm asking nothing further. The decision comment names #10091 as the implementation.

    Automated triage, applied by the lanes App.

  3. kyle-sexton commented on Oct 25, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    This was generated by AI. The owner answered this issue as Q111 in the HITL Backlog session on 2026-10-25, replying "go w/ recommendations" to the full option set below. The ledger records it at .work/backlog-to-zero/interview-checklist.md (Q111).

    Decision: D. A resume notice comes from the existing SessionStart entry. On source: resume, when the per-session clean-invoked marker exists, it tells the model to stop all deletes and overwrites until the user re-types /disk-hygiene:clean. That re-registers the skill-frontmatter belt. The stale "Not probed: Windows PowerShell" claims in safety-model.md and unsupported-platform-handoff.md get fixed in the same change.

    Options the owner was shown:

    • A: widen the always-on if patterns. Every session gets an ask on each Remove-Item, Set-Content or >.
    • B: an always-on Bash and PowerShell gate in belt mode, gated on a per-session marker. It enforces, but node, bash and python start on every shell call in every session.
    • C: document the limit only.
    • D: C plus the resume notice. Recommended and chosen.

    Why B can't be a SessionStart re-arm: SessionStart output can carry only additionalContext, initialUserMessage, sessionTitle, watchPaths and reloadSkills, and none of these registers a hook (hooks: SessionStart decision control). A plugin's settings.json cannot ship permissions.ask rules (plugins reference). Enforcement after a resume therefore needs B's always-on per-call gate. The owner chose D over it.

    Implementation: #10091.

  4. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    priority: mediumReal value, no hard deadline; normal backlog flow.
    and removed
    status: needs-decisionAwaiting a human or maintainer judgment call.
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 25, 2026
  5. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    admission-deferredReady for the issue lane; work-unblock admits it when queued work is under the queued cap
    on Oct 25, 2026
  6. melodic-automation-lanes commented on Oct 25, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane yet: open pull request #10091 is for it.

  7. kyle-sexton commented on Oct 26, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI.

    Carrying the rest of #5609 here, so one change owns the verification record in plugins/disk-hygiene/skills/clean/reference/safety-model.md. The owner answered this issue's design question as Q111 on 2026-10-25: option D, "go w/ recommendations" (fix the stale safety-model and handoff claims, plus a resume notice from the existing SessionStart hook keyed on a session_id marker). #5609's four-part record for hook ask is already on main (safety-model.md:711-736); two pieces of it are stale and belong in this fix:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    admission-deferredReady for the issue lane; work-unblock admits it when queued work is under the queued cappriority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions