Skip to content
HackmaassPublic

About

My gf needed help with clearing up her computer

Resources

Code of conduct

Contributing

Security policy

Stars

20 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Diskman

A lightweight Windows storage visualizer and cache cleaner, built entirely in native PowerShell and WPF.

Platform PowerShell Dependencies License

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

Quick Start

Run directly (no download)

Open PowerShell as Administrator (recommended for system-level caches) and run:

irm https://raw.githubusercontent.com/Hackmaass/Diskman/main/release/diskman.ps1 | iex

Important

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" }

Clone and run locally

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

Requirements

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.


Features

+-------------------------------------------------------------------------------------------------+
| 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...                                                   |
+-------------------------------------------------------------------------------------------------+

๐Ÿงน Storage Cleaner

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 Inspector

File-by-file review for any cleanable category, with paths, sizes, and modification timestamps. Open any file's folder in Explorer (explorer.exe /select,) or delete individual items selectively.

๐Ÿ“ฆ Large Files Hunter

Finds large files on C:\ using configurable thresholds (100 MB, 500 MB, 1 GB, 5 GB) and groups them into Installers, Disk Images, Archives, Media, AI Models/Weights, and VM Images. Send files to the Recycle Bin (recoverable) or delete them permanently.

๐Ÿ“Š Directory Explorer

A fast folder-size profiler that maps disk usage across top-level C:\ directories to surface unexpected space hogs.


Cleanable Categories

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)

Safety Architecture

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.

Architecture

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

Development & Testing

Run the test suite โ€” validates path safety barriers, servicing detection, module loading, AST syntax, and compilation:

powershell -ExecutionPolicy Bypass -File .\test_verify.ps1

Build 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.ps1

Note

Recompile after any change under src/. The one-line irm | iex install serves release/diskman.ps1 directly.


Contributing

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.

About

My gf needed help with clearing up her computer

Resources

Code of conduct

Contributing

Security policy

Stars

20 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages