AutoClean
Event-driven background Temp folder and Recycle Bin cleaner with AI agent protection, oldest-first pruning, mouse shortcuts, and OLED toasts
Author: Ashix
Silent, event-driven background Temp folder and Recycle Bin cleaner running in a dedicated Windhawk Tool Mod process.

Action Triggers — Temp & Recycle Bin
| Icon |
Shortcut / Trigger |
Action |
| 🖱️ |
3x Left-Click (Desktop & Taskbar empty space) |
Clean Temp folders immediately and show OLED corner toast |
| 🖱️ |
Middle-Click (1x/2x/3x, Desktop & Taskbar empty space) |
Empty Recycle Bin immediately and show OLED corner toast |
| 🚀 |
Windows Login / Startup |
Clean Temp folders (and optionally Recycle Bin) automatically after login |
| 📦 |
Size Limit (KB/MB/GB/TB) |
Prune oldest items first or full sweep when Temp or Recycle Bin hits limit |
| 🔢 |
File Count Limit (X items) |
Prune oldest-deleted items or empty Recycle Bin at X items |
| ⏱️ |
Timer / Retention |
Clean Temp on a repeating schedule and expire Recycle Bin items older than your retention window |
| ⚠️ |
Low Disk Space Emergency |
Free Temp and oldest Recycle Bin items on the low-space drive when free space crosses below the floor |
How AutoClean Differs from Windows Storage Sense
Windows Storage Sense covers basic periodic Temp and Recycle Bin cleanup, whereas AutoClean adds:
- True Event-Driven Watching: Uses
ReadDirectoryChangesW for %TEMP% and SHChangeNotifyRegister on the Recycle Bin so idle CPU and disk usage stay at zero (secondary HDDs can spin down normally).
- AI Agent
%TEMP% Protection: Preserves local %TEMP% scratchpads and worktrees created by AI coding & desktop agents (Claude Code, Codex, Hermes, OpenClaw, Gemini CLI, OpenCode, Cursor, Windsurf, Goose, Aider, Copilot, MCP) by default.
- Instant Empty-Space Mouse Shortcuts: Triple left-click empty Desktop/Taskbar space to clean Temp, or middle-click empty space to empty the Recycle Bin, with UI Automation checks so taskbar buttons and desktop icons are never triggered.
- Granular Controls & Smart Deferral: Exact
KB/MB/GB/TB size caps, oldest-first pruning to a target percentage, wildcard exclusions, fullscreen/battery deferral, single-shot Dry-Run simulation, and borderless OLED corner toasts.
Safety Guards
- Temp Path Validation: Refuses to clean drive roots,
%windir%, %USERPROFILE%, or known user folders (Desktop, Documents, Downloads, Pictures, Music, Videos, AppData) if %TEMP% is misconfigured.
- Minimum Age Grace Periods: Honored on all Temp sweeps (default 24 hours / 1440 minutes) and Recycle Bin pruning (default 24 hours / 1440 minutes) so active installers, build tools, PyInstaller payloads, and recent deletions stay protected.
- Reparse-Point & Attribute Safety: Skips junctions/symlinks, respects Windows file locks, and restores Read-Only/Hidden/System attributes if a locked file cannot be deleted.
- Safe Recycle Bin Defaults: Automatic Recycle Bin size/count thresholds and startup cleaning are off by default; only 30-day age expiry is enabled out of the box.