Skip to content

Repository files navigation

DiskTriage

A simple CLI tool to reclaim space on your Windows C: drive safely.

It checks SSD health, tracks down bloat (dev tools, AI models, package caches, game stores), and helps you either delete it or move it to another drive — with an interactive terminal menu and built-in safety checks.

Built after a full boot SSD (2.7% free space) caused 1.5-second disk read freezes and triggered a Windows 0x1E_C0000006 (nt!HvpGetCellPaged) blue screen.


Quick Start

git clone https://github.com/ricardoborges/DiskTriage.git
cd DiskTriage

# Install dependencies and the `disktriage` CLI
pip install -e .

Run it:

disktriage

Tip: Run PowerShell as Administrator to see physical SSD read/write latency counters via Get-StorageReliabilityCounter.


What It Does

  1. System Health: Checks free space across drives, SSD latency, pagefile location, and recent Windows BSOD bugchecks (last 90 days).
  2. Cache Catalog: Scans 50+ known dev and gaming caches (pip, npm, cargo, docker, huggingface, pyenv, gradle, steam, etc.).
  3. Smart Discovery: Finds large unexpected folders in your user profile and AppData.
  4. Actionable Fixes:
    • Delete: Safely wipe disposable, rebuildable caches.
    • Move + Env Var: Move folder to another drive (e.g. D:) and update user environment variable in registry (HKCU\Environment).
    • Move + NTFS Junction: Move folder and create an NTFS directory junction (mklink /J), keeping full tracking and 1-click rollback.
    • Scan Persistence: Remembers scan results so you don't have to wait for rescans every time you launch.

Tip

Relocate Package Caches & Auto-Update Environment Variables:
You can easily move bulky package caches (such as pip, npm, cargo, or huggingface) from your system drive to a secondary drive (like D:) to free up gigabytes on C:. When using the Move + Env Var option, DiskTriage safely transfers the directory and automatically updates the corresponding Windows user environment variable (HKCU\Environment) with the new path—ensuring your development tools keep working seamlessly without manual configuration.


CLI Options

disktriage                  # Interactive menu (arrow keys + Enter)
disktriage --health         # Health check only (space, latency, BSODs)
disktriage --scan --drive D # Auto-scan and suggest D: as target drive
disktriage --min-gb 1.0     # Only show items larger than 1 GB
disktriage --lang pt-BR     # Force Portuguese (Brasil)
disktriage --lang en-US     # Force English (US)
disktriage --rollback       # Manage operations & 1-click rollback (Undo)

Multi-Language Support (i18n)

DiskTriage supports English (US) (default) and Português (Brasil) with automatic OS language detection.

  • On launch, DiskTriage automatically detects your Windows display language/locale.
  • You can switch languages at any time from the Main Menu (Option 9) or override it via --lang en-US or --lang pt-BR.

Safety First

  • Explicit confirmation: You must type the item name to delete; no accidental single-key deletes.
  • Protected paths: WinSxS, System32, Windows\Installer, and Program Files are strictly blocked.
  • Destination Pre-Flight Probes: Validates target write/delete permissions, path nesting sanity, NTFS compatibility for junctions, and calculates free space with a safety buffer before copying a single byte.
  • Unified Rollback Journal: All relocations (Move + Env Var and Move + Junction) are tracked in an operations journal, allowing deterministic 1-click undo.
  • Safe file moves: Multi-threaded robocopy with verification. Source files are only removed after the copy verifies successfully.
  • No symlink loops: Never recursively follows junctions or symlinks.

License

GPL-3.0

About

A simple CLI tool to reclaim space on your Windows C: drive safely

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages