Skip to content
markankamaransheogarat-sysPublic

About

🧹 Surgical Developer Disk Hygiene, Artifact Cleaner & Git Cache Vacuum in Rust: Free 10-100+ GB of target/, node_modules/ & .venv/ with Git recency awareness

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧹 dev-scrub

Surgical Developer Disk Hygiene, Artifact Cleaner & Git-Aware Cache Vacuum in Rust

Rust License Zero-Dependency Speed


⚑ The Problem: Invisible Disk Bloat

Every developer's machine silently runs out of gigabytes due to forgotten build artifacts across dozens of clones:

  • Rust: target/ directories (500 MB – 8 GB per workspace).
  • Node.js: node_modules/, .next/, .turbo/ (1 GB – 10 GB per monorepo).
  • Python: .venv/, __pycache__/, .mypy_cache/, .pytest_cache/.
  • Java / Gradle: .gradle/, build/.

Standard tools are inadequate:

  • ncdu / du are blind to developer semantics and take minutes traversing millions of internal git objects.
  • docker system prune does not touch project workspaces.
  • cargo-sweep only cleans Cargo.
  • npkill only cleans Node.

dev-scrub is a high-speed, multi-ecosystem CLI vacuum that inspects Git project recency, groups artifacts by toolchain, and safely reclaims 10–100+ GB of disk space without touching source code.


πŸ›οΈ Architecture & Pruning Pipeline

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                      dev-scrub scan [PATH]                   β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚         Parallel Work-Stealing Walker          β”‚
               β”‚  β€’ Skip .git internals (saves 90% of I/O)      β”‚
               β”‚  β€’ Detect: target, node_modules, .venv, etc.   β”‚
               β”‚  β€’ Subtree Pruning: Stop descending at roots   β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚           Git Activity Classifier              β”‚
               β”‚  β€’ Active   (< 7 days since last commit)       β”‚
               β”‚  β€’ Stale    (7 - 30 days)                      β”‚
               β”‚  β€’ DORMANT  (> 30 days ⚠️ -> Prime Target)     β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                     Safety Invariant Guard                   β”‚
 β”‚  β€’ Never delete /, /root, /home                              β”‚
 β”‚  β€’ Never delete src/, .git/, or source code (.rs, .py, .ts)  β”‚
 β”‚  β€’ Whitelist matching: only recognized artifact directories  β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
               [ Dry-Run Simulation or Force Vacuum ]

πŸ”¬ Core Capabilities

1. Subtree Pruning & Fast Traversal

Unlike generic disk analyzers that scan deep inside every sub-package, dev-scrub prunes directory traversal the instant an artifact root (target/, node_modules/) is recognized. It calculates directory weight without scanning child dependencies, achieving speeds of 100,000+ files per second.

2. Git Recency Awareness

Every detected artifact is matched with its parent project's Git commit log (.git/logs/HEAD). Projects are classified into:

  • Active (< 7d)
  • Stale (7–30d)
  • Dormant (> 30d): Highlights repositories you haven't touched in over a month so you can safely purge gigabytes without interrupting active workflows.

3. Strict Safety Invariants

  • Non-Destructive by Default: Running dev-scrub clean defaults to a non-destructive dry-run simulation unless --force is explicitly provided.
  • Root & Source Protection: Enforces canonical path verification to ensure system roots, home roots, and source trees (src/, .git/, .rs, .py, .js) can never be targeted.

πŸ’» CLI Output Example

$ dev-scrub scan /root/work

⚑ dev-scrub: Scanning '/root/work' for reclaimable developer artifacts...

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 🧹 DEV-SCRUB: DISK HYGIENE REPORT FOR /root/work                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ [RECLAIMABLE ARTIFACT BREAKDOWN]
  β€’ Node.js (node_modules/)  ->   14.69 GB across  20 project(s)
  β€’ Rust (target/)           ->  426.40 MB across   1 project(s)
  β€’ Python (.venv/cache)     ->    0.10 MB across  10 project(s)

πŸ” [HEAVIEST ARTIFACT DIRECTORIES]
  -----------------------------------------------------------------------------
  PROJECT              TYPE            SIZE       INACTIVITY   PATH
  -----------------------------------------------------------------------------
  kimi-code            Node.js (nod...   9.12 GB  1d ago       ...work/kimi-code/node_modules
  kimi-code            Node.js (nod...   2.07 GB  n/a          ...apps/kimi-code/node_modules
  vscode               Node.js (nod...  931.1 MB  n/a          ...de/apps/vscode/node_modules
  node-sdk             Node.js (nod...  682.9 MB  n/a          ...kages/node-sdk/node_modules
  acp-server           Node.js (nod...  542.3 MB  n/a          ...ges/acp-server/node_modules
  klient               Node.js (nod...  433.7 MB  n/a          ...ackages/klient/node_modules
  dev-scrub            Rust (target/)   426.4 MB  0d ago       /root/work/dev-scrub/target
  kap-server           Node.js (nod...  328.7 MB  n/a          ...ges/kap-server/node_modules

===============================================================================
πŸ“Š TOTAL RECLAIMABLE SPACE: 15.10 GB (15464.7 MB) across 31 directories
⚑ Scan duration: 15.93 s (scanned 1,520,636 files)
===============================================================================

πŸš€ Usage

1. Scan Workspace

dev-scrub scan /path/to/projects

2. Simulate Dry-Run Cleanup

dev-scrub clean /path/to/projects

3. Vacuum Dormant Artifacts (> 14 days inactive)

dev-scrub clean /path/to/projects --older-than 14 --force

4. Machine-Readable JSON Mode (for CI/CD or cron alerts)

dev-scrub scan /path/to/projects --json

πŸ“œ License

Licensed under either of:

About

🧹 Surgical Developer Disk Hygiene, Artifact Cleaner & Git Cache Vacuum in Rust: Free 10-100+ GB of target/, node_modules/ & .venv/ with Git recency awareness

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages