A lightweight Windows storage visualizer and cache cleaner, built entirely in native PowerShell and WPF.
Quick Start โข Features โข Cleanable Categories โข Safety Architecture โข Development โข Contributing
Diskman analyzes drive C:\ to identify and reclaim storage from application caches, GPU shaders, developer package stores, and system logs that standard Windows tools ignore. It runs with zero external runtimes, no background services, and no installer, and pairs deep file inspection with strict fail-closed safety guards.
| 36 cleanup targets |
0 external dependencies |
1 file standalone release script |
Fail-closed safety engine |
Open PowerShell as Administrator (recommended for system-level caches) and run:
irm https://raw.githubusercontent.com/Hackmaass/Diskman/main/release/diskman.ps1 | iexImportant
That command runs whatever is currently on main, and you are running it as Administrator. To run a reviewed copy instead, download the script, read it, then run it. The published SHA-256 only proves the download was not corrupted: it comes from the same branch as the script, so it is not proof the code is trustworthy. For that, pin a release tag in the URL and review that version.
$base = "https://raw.githubusercontent.com/Hackmaass/Diskman/main/release"
Invoke-WebRequest "$base/diskman.ps1" -OutFile diskman.ps1 -UseBasicParsing
$expected = ((Invoke-RestMethod "$base/diskman.ps1.sha256" -UseBasicParsing) -split '\s+')[0]
if ((Get-FileHash .\diskman.ps1 -Algorithm SHA256).Hash -ieq $expected) {
powershell -NoProfile -STA -ExecutionPolicy Bypass -File .\diskman.ps1
} else { Write-Error "Hash mismatch - do not run" }git clone https://github.com/Hackmaass/Diskman.git
cd Diskman
# Launch with automatic elevation prompt
.\run.bat
# Or run directly via PowerShell (STA mode required for WPF)
powershell -STA -ExecutionPolicy Bypass -File .\src\app.ps1| Component | Requirement |
|---|---|
| Operating system | Windows 10 (Build 1809+) or Windows 11 |
| PowerShell | Windows PowerShell 5.1 (built-in) or PowerShell 7+ |
| Privileges | Administrator is optional, but required to scan and clean system-level targets such as C:\Windows\Temp and CBS servicing logs |
Tip
Without Administrator rights, Diskman still scans and cleans every per-user target. System-level targets are simply skipped.
+-------------------------------------------------------------------------------------------------+
| DISKMAN | C: Drive Storage Cleaner & Junk Purger |
| C: Capacity: 476.2 GB Used: 312.4 GB Free: 163.8 GB [||||||||||||||.....] 65.6% Used |
+-------------------------------------------------------------------------------------------------+
| [ C: Drive Junk Cleaner ] [ File Inspector ] [ Large Files Hunter ] [ Directory Explorer ] |
| |
| Select Recommended | Select All | Clear All | Filter: All | System | Gaming | Dev | Apps |
| +----+----------------------------------+---------------+-----------+---------+-------------+ |
| | [X]| NVIDIA DirectX Shader Cache | Gaming & GPU | 3.42 GB | 1,420 | SAFE | |
| | [X]| Windows User Temp | System | 2.18 GB | 3,850 | SAFE | |
| | [ ]| NuGet Package Cache | Developer | 12.40 GB | 18,200 | OPTIONAL | |
| | [ ]| Windows Update Download Cache | System | 5.10 GB | 412 | ADVANCED | |
| +----+----------------------------------+---------------+-----------+---------+-------------+ |
| |
| Target Files & Data Safety & Protected Data Post-Cleanup Impact |
| Precompiled DirectX GPU Safe: Driver-compiled cache. Games recompile shaders on launch; |
| shader binaries in Saves, settings, and profiles may cause slight initial stutter. |
| %LOCALAPPDATA%\NVIDIA. are untouched. |
+-------------------------------------------------------------------------------------------------+
| Real-time PowerShell execution log console... |
+-------------------------------------------------------------------------------------------------+
|
Scans 36 storage categories across the operating system, developer tools, game launchers, and desktop applications. Shows file counts, disk usage, and a safety tier for each target. A three-pane inspection panel explains what will be removed, why it is safe, and what to expect afterwards. |
File-by-file review for any cleanable category, with paths, sizes, and modification timestamps. Open any file's folder in Explorer ( |
|
Finds large files on |
A fast folder-size profiler that maps disk usage across top-level |
Every target is assigned one of three safety tiers:
| Tier | Selected by default | Description |
|---|---|---|
| ๐ข Safe | โ | Disposable temp files, scratch buffers, and driver-generated caches that regenerate automatically. |
| ๐ก Optional | โ | Build artifacts and package stores. Safe to delete, but rebuilding or re-downloading costs bandwidth or CPU time. |
| ๐ด Advanced | โ | OS servicing caches. Purged only after verifying that Windows Update and CBS services are idle. |
๐ฅ๏ธ System โ 8 targets
| Target | Tier | Path / Description |
|---|---|---|
| Windows User Temp | ๐ข Safe | %LOCALAPPDATA%\Temp |
| Windows System Temp | ๐ข Safe | C:\Windows\Temp |
| Crash Dumps & Minidumps | ๐ข Safe | %LOCALAPPDATA%\CrashDumps |
| Windows Error Reports (WER) | ๐ข Safe | %LOCALAPPDATA%\Microsoft\Windows\WER |
| Windows CBS Servicing Logs | ๐ข Safe | C:\Windows\Logs\CBS |
| DISM Servicing Logs | ๐ข Safe | C:\Windows\Logs\DISM |
| Windows Update Download Cache | ๐ด Advanced | C:\Windows\SoftwareDistribution\Download |
| Delivery Optimization Chunks | ๐ด Advanced | C:\Windows\SoftwareDistribution\DeliveryOptimization |
๐ฎ Gaming & GPU โ 13 targets
| Target | Tier | Path / Description |
|---|---|---|
| NVIDIA DXCache | ๐ข Safe | NVIDIA DirectX shader cache |
| NVIDIA GLCache | ๐ข Safe | NVIDIA OpenGL/Vulkan shader cache |
| DirectX Shader Cache (D3DSCache) | ๐ข Safe | Global Direct3D shader cache |
| AMD Radeon Shader Cache | ๐ข Safe | %LOCALAPPDATA%\AMD\DxCache |
| Intel Graphics Shader Cache | ๐ข Safe | %LOCALAPPDATA%\Intel\ShaderCache |
| Steam Web & HTTP Cache | ๐ข Safe | Embedded Chromium assets (htmlcache) |
| Epic Games Launcher Cache | ๐ข Safe | Storefront assets and web views |
| EA Desktop / Origin Cache | ๐ข Safe | UI media and temporary store cache |
| Ubisoft Connect Cache | ๐ข Safe | Client cache and store artwork |
| Battle.net Agent Cache | ๐ข Safe | Patcher cache and staging metadata |
| Riot Client Logs | ๐ข Safe | Diagnostic session logs (League of Legends, Valorant) |
| Unreal Engine DDC | ๐ก Optional | Derived Data Cache (textures, compiled shaders) |
| Unity Package Cache | ๐ก Optional | Asset store downloads and package manager tarballs |
๐ ๏ธ Developer โ 6 targets
| Target | Tier | Path / Description |
|---|---|---|
| Python pip Cache | ๐ข Safe | Downloaded wheel binaries and tarballs |
| Node.js npm Cache | ๐ข Safe | %APPDATA%\npm-cache |
| Yarn Package Cache | ๐ข Safe | %LOCALAPPDATA%\Yarn\Cache |
| NuGet Package Cache | ๐ก Optional | Global package store (%USERPROFILE%\.nuget\packages) |
| Gradle Build Cache | ๐ก Optional | Dependency jars and wrapper zip archives |
| Rust Cargo Registry Cache | ๐ก Optional | Downloaded .crate archives |
๐ Apps & Web โ 8 targets
| Target | Tier | Path / Description |
|---|---|---|
| Google Chrome Cache | ๐ข Safe | Web assets only; credentials and cookies are protected |
| Microsoft Edge Cache | ๐ข Safe | Web assets only; credentials and cookies are protected |
| Brave Browser Cache | ๐ข Safe | Web assets only; wallets and keys are protected |
| Discord Media Cache | ๐ข Safe | Server emojis, avatars, and voice buffers |
| Spotify Track Storage | ๐ก Optional | Cached audio streams and offline track downloads |
| VS Code Cache | ๐ข Safe | V8 code cache and webview buffers |
| Adobe Media Cache | ๐ข Safe | Premiere / After Effects peak and conformed audio files |
| Telegram Desktop Cache | ๐ก Optional | Media cache (all media remains available in the cloud) |
๐๏ธ Recycle Bin โ 1 target
| Target | Tier | Path / Description |
|---|---|---|
| Windows Recycle Bin | ๐ก Optional | Permanently empties the Recycle Bin on drive C:\ (never pre-selected) |
Diskman uses a strict fail-closed safety model, implemented in Test-PathSafety and Test-WindowsServicingActive.
Important
Any path resolution failure, permission exception, or unhandled check causes the safety engine to reject the target (Safe = $false). When in doubt, Diskman does nothing.
| Guard | What it does |
|---|---|
| Protected system boundaries | Absolute deny-lists block targeting or descending into WinSxS, servicing (Packages, Sessions), System32 (including catroot, catroot2, wbem\Repository, config), Boot, EFI, and System Volume Information. |
| Reparse point & junction isolation | Junctions and symbolic links are detected via [System.IO.FileAttributes]::ReparsePoint. Scans and deletions never traverse them, eliminating recursive deletion into linked directories. |
| Servicing state verification | Before touching SoftwareDistribution\Download or Delivery Optimization, Diskman checks for active BITS transfer jobs, pending reboots (CBS\RebootPending, CBS\RebootInProgress, CBS\PackagesPending, WindowsUpdate\RebootRequired, PostRebootReporting), PendingFileRenameOperations, and UpdateExeVolatile. If servicing is active or cannot be verified, cleanup is skipped. Services are never stopped or inspected by name. |
| User profile & credential protection | Bulk cleanup never enters Documents, Desktop, Downloads, Pictures, Music, Videos, or any OneDrive* folder. Browser credential and history stores (Login Data, Cookies, Web Data, Local State) are always blocked. |
| Linked folders are never followed | A cleanup target that is itself a junction or symlink (for example a cache you moved to another drive) is skipped, and nested links are removed as links without touching what they point to. |
| Single-file gate (Large Files Hunter) | The Hunter may list and act on files in Downloads, Videos, Documents and similar folders, because you choose each file. It never offers files under Windows, Program Files, ProgramData, AppData (installed apps, WSL distros, Docker and VM disks live there), hidden tool folders such as .vscode (except the .ollama, .cache and .lmstudio AI model stores), game libraries (steamapps, SteamLibrary, Epic Games, XboxGames), VM folders, or OneDrive*. Use Send to Recycle Bin (recoverable) unless you are sure; Permanent Delete cannot be undone. |
| Honest numbers | Space freed is measured after deletion (what was there minus what remains), never estimated. Files in use are skipped and reported in the log. |
Diskman is built entirely on components that ship with Windows:
| Layer | Technology |
|---|---|
| Logic | Native PowerShell (5.1 / 7+) |
| Interface | Windows Presentation Foundation (WPF) with XAML |
| Packaging | Self-contained single-file compiler (Compile.ps1) |
Diskman/
โโโ src/
โ โโโ modules/
โ โ โโโ 00-Utils.ps1 # Path safety engine, servicing detection, size formatters
โ โ โโโ Get-DriveMetrics.ps1 # Real-time C: drive capacity and metrics
โ โ โโโ Invoke-SmartCleanup.ps1 # Target definitions, scanner, and cleanup routines
โ โ โโโ Invoke-ShellActions.ps1 # Explorer integration and Recycle Bin operations
โ โ โโโ Find-LargeFiles.ps1 # Large file search and classification
โ โ โโโ Start-FolderScan.ps1 # Directory tree profiler
โ โโโ xaml/
โ โ โโโ MainWindow.xaml # WPF UI layout and styling
โ โโโ app.ps1 # Application bootstrapper and UI controller
โโโ release/
โ โโโ diskman.ps1 # Compiled standalone distribution
โโโ Compile.ps1 # Release compiler (inlines modules and XAML)
โโโ test_verify.ps1 # Verification suite (AST, safety checks, unit tests)
โโโ run.bat # Launcher with auto-elevation
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ SECURITY.md # Security and vulnerability policy
โโโ LICENSE # MIT License
Run the test suite โ validates path safety barriers, servicing detection, module loading, AST syntax, and compilation:
powershell -ExecutionPolicy Bypass -File .\test_verify.ps1Build the standalone release โ inlines every module in src/modules/, embeds MainWindow.xaml, appends the controller from src/app.ps1, and writes release/diskman.ps1:
powershell -ExecutionPolicy Bypass -File .\Compile.ps1Note
Recompile after any change under src/. The one-line irm | iex install serves release/diskman.ps1 directly.
Contributions are welcome. Adding a new cache target only requires a target definition block in Get-CleanableTargets inside src/modules/Invoke-SmartCleanup.ps1.
See CONTRIBUTING.md for the target schema, testing requirements, and coding conventions. Security issues should be reported as described in SECURITY.md.
Released under the MIT License.