C: Drive Purging Plan
Section titled “C: Drive Purging Plan”Context
Section titled “Context”- Drive: 240 GB SSD (C:)
- Goal: Maintain 50+ GB free for comfortable WSL development
- Baseline: Windows + apps require ~150-170 GB, leaving 70-90 GB working space
Immediate Actions (One-Time Cleanup)
Section titled “Immediate Actions (One-Time Cleanup)”High Priority - ~25 GB recoverable
Section titled “High Priority - ~25 GB recoverable”-
Delete WSL crash dumps (~21 GB)
Terminal window Remove-Item -Path "$env:TEMP\wsl-crashes" -Recurse -Force -
Empty Recycle Bin (~3.4 GB)
Terminal window Clear-RecycleBin -Force -
Clear User Temp folder (~2 GB when accumulated)
Terminal window Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
Medium Priority - ~15 GB recoverable
Section titled “Medium Priority - ~15 GB recoverable”-
Investigate .gemini folder (9.2 GB) - unusually large
Terminal window Get-ChildItem "C:\Users\Admin\.gemini" -Force | Select-Object Name, Length- Determine if safe to clear cache/temp data
-
Clear Chrome cache (up to 5 GB)
- Chrome → Settings → Privacy → Clear browsing data → Cached images/files
- Or:
chrome://settings/clearBrowserData
-
Remove Playwright browsers if not actively using (~2 GB each location)
- Windows:
Remove-Item -Path "$env:LOCALAPPDATA\ms-playwright" -Recurse -Force - WSL:
rm -rf ~/.cache/ms-playwright(run inside WSL)
- Windows:
Lower Priority - Review & Decide
Section titled “Lower Priority - Review & Decide”-
Consolidate AI IDE caches (~5 GB recoverable)
- Current: .vscode (2.2 GB), .windsurf (1.7 GB), .cursor (1.4 GB), .codeium (1.1 GB), .trae (1.1 GB)
- Keep primary IDE, consider removing unused ones
- Decision: Keep __________, remove __________
-
Review C:\xfer\bak (was 4.8 GB)
- Archive to another drive or delete if obsolete
-
Relocate kopia cache (6.3 GB) to D: drive if possible
Regular Maintenance (Monthly)
Section titled “Regular Maintenance (Monthly)”Automated Cleanup Script
Section titled “Automated Cleanup Script”Save as C:\Scripts\cleanup-c-drive.ps1:
# Monthly C: drive cleanupWrite-Host "Starting C: drive cleanup..."
# Clear WSL crash dumpsif (Test-Path "$env:TEMP\wsl-crashes") { $size = (Get-ChildItem "$env:TEMP\wsl-crashes" -Recurse | Measure-Object Length -Sum).Sum / 1GB Remove-Item -Path "$env:TEMP\wsl-crashes" -Recurse -Force Write-Host "Cleared WSL crashes: $([math]::Round($size, 2)) GB"}
# Clear Temp folder (files older than 7 days)Get-ChildItem -Path $env:TEMP -Recurse -Force -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-7) } | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
# Report free space$free = [math]::Round((Get-PSDrive C).Free / 1GB, 2)Write-Host "Free space: $free GB"Manual Monthly Tasks
Section titled “Manual Monthly Tasks”-
Run Windows Disk Cleanup with system files
Terminal window cleanmgr /d C /sageset:1 # Configure (first time)cleanmgr /d C /sagerun:1 # Run cleanup -
Compact WSL virtual disk (after cleaning inside WSL)
Terminal window wsl --shutdownwsl --manage Ubuntu-24.04 --set-sparse true -
Check free space target
Terminal window $free = [math]::Round((Get-PSDrive C).Free / 1GB, 2)if ($free -lt 30) { Write-Warning "Low disk space: $free GB" }
Preventive Measures
Section titled “Preventive Measures”WSL Configuration
Section titled “WSL Configuration”Add to %USERPROFILE%\.wslconfig:
[wsl2]# Disable crash dumps (optional - loses debugging ability)# crashReportFolder=
# Limit memory usagememory=8GB
# Limit swapswap=4GBDevelopment Practices
Section titled “Development Practices”- Use pnpm exclusively (already done ✓)
- Periodically clean node_modules in inactive projects
- Run
pnpm store pruneto clean unused packages - Inside WSL:
sudo apt autoremove && sudo apt clean
Space Budget Reference
Section titled “Space Budget Reference”| Component | Target Size | Notes |
|---|---|---|
| Windows 11 | ~40 GB | System files |
| Program Files | ~25 GB | Both directories |
| WSL | 15-20 GB | Keep compacted |
| User AppData | ~30 GB | After cleanup |
| Working space | 50+ GB | Target free space |
| Total | ~190 GB | Leaves ~50 GB buffer |
Quick Diagnostic Commands
Section titled “Quick Diagnostic Commands”# Check current free space[math]::Round((Get-PSDrive C).Free / 1GB, 2)
# Find largest folders in AppDataGet-ChildItem "$env:LOCALAPPDATA" -Directory | ForEach-Object { $size = (Get-ChildItem $_.FullName -Recurse -Force -EA 0 | Measure-Object Length -Sum).Sum [PSCustomObject]@{ Folder = $_.Name; SizeGB = [math]::Round($size/1GB, 2) }} | Sort-Object SizeGB -Descending | Select-Object -First 10
# Check WSL disk sizeGet-ChildItem "$env:LOCALAPPDATA\Packages\*Ubuntu*\LocalState\*.vhdx" | Select-Object Name, @{N='SizeGB';E={[math]::Round($_.Length/1GB, 2)}}