🧹 Clean System Cache — Cross-Platform Developer, Designer & Browser Cache Cleaner
Aliases: clean-cache | purge-cache | cache-cleaner | disk-cleanup
Safely reclaim tens of gigabytes of disk space by purging only unreferenced, dangling, and disposable caches produced by installed developer, designer, and web browser toolchains across Windows, Linux, and macOS.
Requires zero external runtimes (no Python, no Node, no dependencies):
- Linux & macOS: Pure Bash / POSIX (
scripts/clean-cache.sh)
- Windows: Native Command Prompt batch script (
scripts/clean-cache.cmd)
When to Use
Trigger Conditions
Execute this skill when:
- Low Disk Space Warnings: Disk capacity drops below comfortable working thresholds due to accumulated build layers, package archives, or scratch media files.
- Dangling Build Layers: Docker BuildKit layers, Xcode DerivedData, Android build-cache, or Go/Cargo build artifacts consume tens of gigabytes without active references.
- Bloated Web Browser Caches: Google Chrome, Mozilla Firefox, Zen, Brave, or Microsoft Edge disk caches grow to multiple gigabytes of stale HTTP responses.
- Stale Designer Scratch Files: Adobe Premiere, After Effects, Audition (
.cfa / .pek audio peak caches), or Figma desktop app caches lock up storage.
- Dormant
node_modules Directories: Old, abandoned repository folders hog dozens of gigabytes across user project directories.
Anti-Triggers
Do NOT use this skill for:
- Wiping active project code, git histories, or working repository files.
- Cleaning browser cookies, logins, saved passwords, bookmarks, or user profiles (the skill strictly protects them).
- Purging virtual environments (
.venv) or active Docker containers and volumes.
- Deleting global binary installations (
~/.cargo/bin, ~/.nvm, etc.).
Quick Reference
11-Point Cache Architecture Matrix
┌─────────────────────────┬────────────────────────────────────────────────────────┐
│ Suite / Category │ Targeted Cache Layers (Disposable Only) │
├─────────────────────────┼────────────────────────────────────────────────────────┤
│ 1. Package Managers │ uv, npm (_npx, _logs), bun, pip, pnpm store, cargo, go │
│ 2. Language Ecosystems │ dotnet (NuGet locals), composer, gradle, brew cleanup │
│ 3. Mobile & Apple │ Xcode DerivedData (macOS), Android build-cache │
│ 4. IDE Workspace Caches │ VS Code & Cursor stale workspaceStorage audits │
│ 5. Testing Frameworks │ Cypress browser binary download cache │
│ 6. Containers │ Docker BuildKit layers (prune -f), Podman build-cache │
│ 7. Creative Media │ Adobe Media Cache (.cfa, .pek), Photoshop temp files │
│ 8. Design Applications │ Figma desktop asset cache, Blender shader/preview cache│
│ 9. App Frameworks │ Electron prebuilt binary download caches │
│ 10. Web Browsers │ Chrome, Firefox, Zen, Brave, Edge, Vivaldi, Safari │
│ 11. Project Audits │ Dormant node_modules scanner across project trees │
└─────────────────────────┴────────────────────────────────────────────────────────┘
Safety & Running Session Protection Contracts
| Protected Area |
Skill Invariant |
| Active Browser Sessions & Live Tabs |
PROTECTED. Process detection checks if any browser is running (pgrep / tasklist). Active sessions are skipped in execution mode so running tabs and websockets are never disrupted. |
| Browser Cookies, Passwords & History |
NEVER TOUCHED. Purges purely disposable HTTP cache (Cache_Data, cache2/entries). User profiles, cookies, logins, and bookmarks remain 100% intact. |
| Project Repositories & Source Code |
NEVER TOUCHED. Does not alter active git working directories or files. |
Virtual Environments (.venv) |
PRESERVED. Cleans package download wheels only; never touches virtual environments. |
| Active Containers & Volumes |
PRESERVED. Prunes dangling build layers only; active containers, images, and volumes are untouched. |
| Installed Global Binaries |
PRESERVED. Binaries in ~/.cargo/bin, ~/.nvm, %APPDATA%, etc. are never touched. |
Procedure
Phase 1: Pre-Flight Inspection (Dry Run)
Before modifying disk contents, run an inspection to calculate reclaimable space across all installed tools:
Phase 2: Targeted or Selective Purging
If you want to target specific subsystems (e.g. only web browsers or package managers):
- Web Browsers Only:
clean-system-cache/scripts/clean-cache.sh --tool browser
- Specific Tools:
clean-system-cache/scripts/clean-cache.sh --tool uv,npm,firefox,zen,docker,adobe
Phase 3: Comprehensive Cache Execution
Execute full cleanup across all installed tools. Any tool not present on the system is dynamically and silently skipped:
Phase 4: Dormant node_modules Audit
Scan project directories for abandoned node_modules folders consuming massive disk space:
Pitfalls
- Never Clean Caches of Actively Running Browsers: Attempting to purge active browser files can crash open tabs or corrupt SQLite index databases. The script automatically guards against this by checking running processes.
- Never Touch Profile Directories: Cookies, sessions, bookmarks, and passwords live in
~/.mozilla, ~/.config, %APPDATA%, and ~/Library/Application Support/. Never delete these directories.
- Never Assume Python or External Interpreters: Developer machines may have corrupted Python or node runtimes; cache cleaners must run on native shell (
bash on POSIX, cmd on Windows).
- Never Prune Active Docker Images or Named Volumes: Only prune dangling build layers (
docker builder prune -f), never containers or database volumes.
Verification
Before marking cleanup complete, verify:
clean-cache.sh --dry-run or clean-cache.cmd /dry-run executes without errors.
- Only disposable cache directories were targeted.
- Active browser sessions were protected and skipped if running.
- User cookies, credentials, and repository code remain 100% intact.
- Disk free space increased as reported by
df -h or dir.
1---2name: clean-system-cache3description: Cross-platform developer, designer, and browser cache cleaner for Windows, Linux, and macOS. Safely purges only unreferenced, dangling, and disposable caches from package managers (uv, npm, bun, pip, pnpm, yarn, cargo, go, dotnet, composer, gradle, brew), IDEs and compilers (xcode, android, vscode, cursor, cypress), containers (docker, podman), creative suites (adobe media cache, photoshop temp, figma, blender, electron), and web browsers (chrome, chromium, brave, edge, firefox, zen, vivaldi, safari). Enforces active running session protection and strict cache-only isolation with zero external runtimes (pure Bash on POSIX, native CMD on Windows).4license: MIT5---67# 🧹 Clean System Cache — Cross-Platform Developer, Designer & Browser Cache Cleaner89> **Aliases**: `clean-cache` | `purge-cache` | `cache-cleaner` | `disk-cleanup`1011Safely reclaim tens of gigabytes of disk space by purging **only unreferenced, dangling, and disposable caches** produced by installed developer, designer, and web browser toolchains across **Windows, Linux, and macOS**.1213Requires **zero external runtimes** (no Python, no Node, no dependencies):14- **Linux & macOS**: Pure Bash / POSIX (`scripts/clean-cache.sh`)15- **Windows**: Native Command Prompt batch script (`scripts/clean-cache.cmd`)1617---1819## When to Use2021### Trigger Conditions22Execute this skill when:231. **Low Disk Space Warnings**: Disk capacity drops below comfortable working thresholds due to accumulated build layers, package archives, or scratch media files.242. **Dangling Build Layers**: Docker BuildKit layers, Xcode DerivedData, Android build-cache, or Go/Cargo build artifacts consume tens of gigabytes without active references.253. **Bloated Web Browser Caches**: Google Chrome, Mozilla Firefox, Zen, Brave, or Microsoft Edge disk caches grow to multiple gigabytes of stale HTTP responses.264. **Stale Designer Scratch Files**: Adobe Premiere, After Effects, Audition (`.cfa` / `.pek` audio peak caches), or Figma desktop app caches lock up storage.275. **Dormant `node_modules` Directories**: Old, abandoned repository folders hog dozens of gigabytes across user project directories.2829### Anti-Triggers30Do **NOT** use this skill for:31- Wiping active project code, git histories, or working repository files.32- Cleaning browser cookies, logins, saved passwords, bookmarks, or user profiles (the skill strictly protects them).33- Purging virtual environments (`.venv`) or active Docker containers and volumes.34- Deleting global binary installations (`~/.cargo/bin`, `~/.nvm`, etc.).3536---3738## Quick Reference3940### 11-Point Cache Architecture Matrix4142```43┌─────────────────────────┬────────────────────────────────────────────────────────┐44│ Suite / Category │ Targeted Cache Layers (Disposable Only) │45├─────────────────────────┼────────────────────────────────────────────────────────┤46│ 1. Package Managers │ uv, npm (_npx, _logs), bun, pip, pnpm store, cargo, go │47│ 2. Language Ecosystems │ dotnet (NuGet locals), composer, gradle, brew cleanup │48│ 3. Mobile & Apple │ Xcode DerivedData (macOS), Android build-cache │49│ 4. IDE Workspace Caches │ VS Code & Cursor stale workspaceStorage audits │50│ 5. Testing Frameworks │ Cypress browser binary download cache │51│ 6. Containers │ Docker BuildKit layers (prune -f), Podman build-cache │52│ 7. Creative Media │ Adobe Media Cache (.cfa, .pek), Photoshop temp files │53│ 8. Design Applications │ Figma desktop asset cache, Blender shader/preview cache│54│ 9. App Frameworks │ Electron prebuilt binary download caches │55│ 10. Web Browsers │ Chrome, Firefox, Zen, Brave, Edge, Vivaldi, Safari │56│ 11. Project Audits │ Dormant node_modules scanner across project trees │57└─────────────────────────┴────────────────────────────────────────────────────────┘58```5960### Safety & Running Session Protection Contracts6162| Protected Area | Skill Invariant |63| :--- | :--- |64| **Active Browser Sessions & Live Tabs** | **PROTECTED.** Process detection checks if any browser is running (`pgrep` / `tasklist`). Active sessions are skipped in execution mode so running tabs and websockets are never disrupted. |65| **Browser Cookies, Passwords & History** | **NEVER TOUCHED.** Purges purely disposable HTTP cache (`Cache_Data`, `cache2/entries`). User profiles, cookies, logins, and bookmarks remain 100% intact. |66| **Project Repositories & Source Code** | **NEVER TOUCHED.** Does not alter active git working directories or files. |67| **Virtual Environments (`.venv`)** | **PRESERVED.** Cleans package download wheels only; never touches virtual environments. |68| **Active Containers & Volumes** | **PRESERVED.** Prunes dangling build layers only; active containers, images, and volumes are untouched. |69| **Installed Global Binaries** | **PRESERVED.** Binaries in `~/.cargo/bin`, `~/.nvm`, `%APPDATA%`, etc. are never touched. |7071---7273## Procedure7475### Phase 1: Pre-Flight Inspection (Dry Run)76Before modifying disk contents, run an inspection to calculate reclaimable space across all installed tools:7778- **Linux & macOS**:79 ```bash80 clean-system-cache/scripts/clean-cache.sh --dry-run81 ```82- **Windows CMD**:83 ```cmd84 clean-system-cache\scripts\clean-cache.cmd /dry-run85 ```8687### Phase 2: Targeted or Selective Purging88If you want to target specific subsystems (e.g. only web browsers or package managers):8990- **Web Browsers Only**:91 ```bash92 clean-system-cache/scripts/clean-cache.sh --tool browser93 ```94- **Specific Tools**:95 ```bash96 clean-system-cache/scripts/clean-cache.sh --tool uv,npm,firefox,zen,docker,adobe97 ```9899### Phase 3: Comprehensive Cache Execution100Execute full cleanup across all installed tools. Any tool not present on the system is dynamically and silently skipped:101102- **Linux & macOS**:103 ```bash104 clean-system-cache/scripts/clean-cache.sh105 ```106- **Windows CMD**:107 ```cmd108 clean-system-cache\scripts\clean-cache.cmd109 ```110111### Phase 4: Dormant `node_modules` Audit112Scan project directories for abandoned node_modules folders consuming massive disk space:113114- **Linux & macOS**:115 ```bash116 clean-system-cache/scripts/clean-cache.sh --scan-node-modules ~/Projects117 ```118- **Windows CMD**:119 ```cmd120 clean-system-cache\scripts\clean-cache.cmd /scan-node-modules C:\Projects121 ```122123---124125## Pitfalls126127- **Never Clean Caches of Actively Running Browsers**: Attempting to purge active browser files can crash open tabs or corrupt SQLite index databases. The script automatically guards against this by checking running processes.128- **Never Touch Profile Directories**: Cookies, sessions, bookmarks, and passwords live in `~/.mozilla`, `~/.config`, `%APPDATA%`, and `~/Library/Application Support/`. Never delete these directories.129- **Never Assume Python or External Interpreters**: Developer machines may have corrupted Python or node runtimes; cache cleaners must run on native shell (`bash` on POSIX, `cmd` on Windows).130- **Never Prune Active Docker Images or Named Volumes**: Only prune dangling build layers (`docker builder prune -f`), never containers or database volumes.131132---133134## Verification135136Before marking cleanup complete, verify:1371. `clean-cache.sh --dry-run` or `clean-cache.cmd /dry-run` executes without errors.1382. Only disposable cache directories were targeted.1393. Active browser sessions were protected and skipped if running.1404. User cookies, credentials, and repository code remain 100% intact.1415. Disk free space increased as reported by `df -h` or `dir`.