Win Clean
Use this skill when the user asks to understand or clean Windows disk space, especially C:. Start with a read-only storage analysis. Clean known low-risk caches in safe mode; discuss other user-directory candidates with the user before deleting them.
Goals
- Show before/after free and used space.
- Map the main C: consumers, including root files and top-level directories.
- Analyze
C:\Usersand the active user profile, including hidden folders andAppData. - Rank cleanup candidates by size, data type, and recency signals.
- Separate rebuildable caches from configuration, development environments, and personal data.
- Use an exact-target plan and user choice before removing non-trivial user data.
Safety Rules
- Validate every destructive target as an exact path before deletion. Never use a broad root, unresolved variable, or recursive wildcard as the deletion target.
- Do not delete from personal data folders by default:
Desktop,Documents,Pictures,Videos, andDownloads. Aggregate their sizes without listing filenames unless the user asks for that detail. - Do not delete app install trees by default:
C:\Program Files,C:\Program Files (x86), orC:\ProgramDataexcept a specifically identified cache subpath. - Never manually delete inside
C:\Windows\WinSxS. - Keep Codex runtime and cache untouched unless the user explicitly includes them.
- Treat
LastWriteTimeas supporting evidence only.LastAccessTimemay be disabled or unreliable, and an old timestamp does not prove that a directory is unused. Do not delete a directory solely because it has not changed recently. - Before changing app data, check whether the related process is running. Ask the user to close it or skip locked files; do not force-close an app with possible unsaved work.
- Prefer moving to a recoverable location when practical. If permanent deletion is authorized and used, report that it does not go to the Recycle Bin.
- For each delete operation, tolerate in-use files and report exact skipped paths.
Default Workflow (Safe Mode)
Baseline and distribution (read-only)
- Read free and used space for
C:. - Measure the main top-level directories:
C:\Users,C:\Windows,C:\Program Files,C:\Program Files (x86), andC:\ProgramData. - Measure large root files such as
pagefile.sys,hiberfil.sys, andswapfile.sys. - Explain that apparent
WinSxSsize can overstate reclaimable space because of hard links.
- Read free and used space for
User-profile analysis (read-only)
- Enumerate profiles under
C:\Usersand identify the active profile without assuming a fixed username. - Measure the active profile's hidden directories and normal directories separately.
- Break down
AppData\Local,AppData\Roaming, andAppData\LocalLow, then rank their largest immediate children. - For each likely candidate, report size, file count when useful, newest file time, and counts of files changed in the last 30/90/180/365 days. Use these as review signals, not proof of usage.
- Do not enumerate filenames from personal folders in the default report. Check running processes before proposing app-data deletion.
- Enumerate profiles under
Classify and discuss candidates
- Present a compact table with: path, size, category, recency signal, likely impact, and proposed action.
- Known rebuildable caches: user temp, Windows temp, Windows update download cache, Delivery Optimization cache, NVIDIA App update artifacts,
CrashDumps,*-updater, andnpm-cachewhen present. These may be cleaned in safe mode after the baseline. - Review before deletion: browser profiles, IDE system/cache directories, app caches, stale logs, and old version directories. Explain what will be rebuilt or lost.
- Protect by default: configuration and plugin directories, app binaries, developer toolchains such as Rust/Maven/NuGet/Gradle stores, project files, and personal data. Require the user's choice for these.
- If a candidate is old but has no reliable usage evidence, label it
needs reviewrather thanunused.
Plan and approval boundary
- After the user selects candidates, list the exact paths, estimated reclaimable space, expected side effects, and whether the operation is recoverable.
- Execute known low-risk cache cleanup without a second prompt in safe mode. For any other user-directory path, obtain explicit approval for that exact path or category immediately before deletion.
Execute and verify
- Clean approved targets, preferably their contents while retaining the parent directory when an application expects it.
- Run
Dism.exe /Online /Cleanup-Image /StartComponentCleanup. If it returns error 740 or is blocked by pending actions, report the condition and advise an elevated prompt or restart; do not retry destructively. - Re-read C: free/used space, rescan affected paths, and report recovered space, locked files, skipped items, and remaining major consumers.
Mode Switch
safe (default)
- Always perform the distribution and user-profile analysis first.
- Clean only the known rebuildable caches listed above automatically.
- Do not delete personal data, configuration, plugins, developer stores, or directories selected only by age.
- Do not change hibernation settings or purge Codex/developer caches unless the user explicitly asks for those targets.
aggressive (explicit user request only)
- Includes safe-mode analysis and cleanup.
- Still requires clear confirmation of each higher-impact category before execution.
- May include hibernation removal, developer-cache cleanup, stale logs, or stale directories when the user approves the exact targets and impact.
Optional Actions (Explicit Confirmation Required)
- Disable hibernation to remove
hiberfil.sys:powercfg /h off. This disables Hibernate and Fast Startup. - Clear developer caches such as
C:\Users\<user>\.m2\repository,C:\Users\<user>\.nuget\packages,C:\Users\<user>\.gradle\caches, Rust registry caches, npm/Yarn/uv caches, or IDE system directories. State whether the data will be redownloaded or rebuilt. - Remove old large logs while keeping active logs.
- Remove stale empty directories only after validating ownership, age, and that no installed app or project refers to them. Age alone is insufficient.
Output Format
Return a compact report with:
Before: free/used GBDistribution: largest C: directories and root filesUser profile: largest hidden/AppData and normal directoriesCandidates: category, evidence, estimated reclaim, and proposed actionActions: exact cleaned paths and notes on failures/in-use filesAfter: free/used GBRecovered: total GB gainedSkipped: protected, uncertain, or locked itemsNext: optional targets awaiting user choice
Notes
- Configuration, plugins, caches, logs, and local history may live in different
AppDatasubtrees; inspect the application-specific layout before classifying a path. - A directory's apparent size can differ from reclaimable space because of hard links, sparse files, junctions, or files held open by a process.
- Prefer repeatable, explainable cleanup over one-off deletion based on a timestamp alone.