Problem
_POWERSHELL_OUTPUT_REDIRECT matches the > in 2>&1 and prompts with "disk-hygiene flagged shell output redirection (may overwrite a file)." A stream merge has no file target and cannot overwrite anything.
skills/clean/scripts/destructive_guard.py:971:
_POWERSHELL_OUTPUT_REDIRECT = re.compile(r"(?<![<>])>(?![=>])")
For 2>&1 the > is preceded by 2 (the lookbehind only excludes < and >) and followed by & (the lookahead only excludes = and >), so it matches. destructive_guard.py:1027 then returns the mutation verdict.
Reproduction
Any PowerShell command capturing stderr while the clean skill's belt is armed:
bash plugins/disk-hygiene/skills/clean/scripts/hygiene.test.sh 2>&1 | Select-Object -Last 8
Prompts. Nothing in it writes a file — it runs the plugin's own test suite and reads the tail.
Why it matters more than a single stray prompt
2>&1 is the standard way to capture combined output in PowerShell, so this fires on a large share of ordinary diagnostic commands. Combined with #2591 (the belt stays armed for the rest of the session, not only while cleanup is the active work), an operator who ran /disk-hygiene:clean once gets prompted on routine 2>&1 commands for the remainder of that session.
The operational damage is not the individual prompt — it is approval-fatigue habituation. In the session that produced this report the operator described "just hitting approve, approve, approve", and genuine deletion prompts were approved unnoticed in that stream (see the correction posted on #2595). A guard that cries wolf on 2>&1 measurably degrades the guard's real signal.
Suggested fix
Exclude the stream-merge form. In PowerShell >& is only ever a stream merge (2>&1, 1>&2, *>&1) and never designates a file:
_POWERSHELL_OUTPUT_REDIRECT = re.compile(r"(?<![<>])>(?![=>&])")
2>file still matches and still prompts, correctly.
Test coverage to add
skills/clean/scripts/test_hygiene.py — assert that 2>&1, 1>&2 and *>&1 produce no mutation verdict, and that 2>out.txt still does.
Environment
disk-hygiene 0.17.9, Windows 11 26200, PowerShell 7, marketplace install melodic-software.
Found during a /plugin-quality:audit pass over a real /disk-hygiene:clean run. Evidence packet retained locally at plugin-quality-melodic-software/evidence/2399d619-.../disk-hygiene-clean/20260814T182356Z/.
Problem
_POWERSHELL_OUTPUT_REDIRECTmatches the>in2>&1and prompts with "disk-hygiene flagged shell output redirection (may overwrite a file)." A stream merge has no file target and cannot overwrite anything.skills/clean/scripts/destructive_guard.py:971:For
2>&1the>is preceded by2(the lookbehind only excludes<and>) and followed by&(the lookahead only excludes=and>), so it matches.destructive_guard.py:1027then returns the mutation verdict.Reproduction
Any PowerShell command capturing stderr while the
cleanskill's belt is armed:Prompts. Nothing in it writes a file — it runs the plugin's own test suite and reads the tail.
Why it matters more than a single stray prompt
2>&1is the standard way to capture combined output in PowerShell, so this fires on a large share of ordinary diagnostic commands. Combined with #2591 (the belt stays armed for the rest of the session, not only while cleanup is the active work), an operator who ran/disk-hygiene:cleanonce gets prompted on routine2>&1commands for the remainder of that session.The operational damage is not the individual prompt — it is approval-fatigue habituation. In the session that produced this report the operator described "just hitting approve, approve, approve", and genuine deletion prompts were approved unnoticed in that stream (see the correction posted on #2595). A guard that cries wolf on
2>&1measurably degrades the guard's real signal.Suggested fix
Exclude the stream-merge form. In PowerShell
>&is only ever a stream merge (2>&1,1>&2,*>&1) and never designates a file:2>filestill matches and still prompts, correctly.Test coverage to add
skills/clean/scripts/test_hygiene.py— assert that2>&1,1>&2and*>&1produce no mutation verdict, and that2>out.txtstill does.Environment
disk-hygiene 0.17.9, Windows 11 26200, PowerShell 7, marketplace install
melodic-software.Found during a
/plugin-quality:auditpass over a real/disk-hygiene:cleanrun. Evidence packet retained locally atplugin-quality-melodic-software/evidence/2399d619-.../disk-hygiene-clean/20260814T182356Z/.