name: vm-cleanup description: This skill should be used when the user asks to "clean up", "free disk space", "clean the VM", "liberer de la memoire", "nettoyer", or when disk usage exceeds 80%. Also trigger proactively after heavy build/test sessions that generate large artifacts. allowed-tools: Bash, Read, Glob
VM Cleanup Skill
Clean up disk space on the development VM by removing build artifacts, caches, stale containers, and temporary files related to the VarunaPoC project. Designed for the self-hosted runner environment.
When to Trigger
- User explicitly asks for cleanup
- Disk usage on
/exceeds 80% (check withdf -h /) - After heavy Docker build sessions
- After running E2E test suites (Playwright generates large artifacts)
- After multiple
cargo buildcycles (target dirs grow fast)
Cleanup Procedure
Phase 1: Assess
Run the diagnostic script to see current disk state before taking action:
bash .claude/skills/vm-cleanup/scripts/disk-report.sh
Present the report to the user. Only proceed with cleanup if disk usage warrants it or if the user explicitly requested it.
Phase 2: Safe Cleanup (always safe to run)
These operations never break anything:
- Python caches:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null - Pytest/Ruff caches:
rm -rf .pytest_cache .ruff_cache - Temp files:
rm -f /tmp/security-scan-log.txt /tmp/pr*-logs.txt - Old logs:
find /var/log -name "*.gz" -o -name "*.old" -o -name "*.[0-9]" | xargs rm -f 2>/dev/null - Pip cache:
rm -rf /root/.cache/pip - npm cache:
npm cache clean --force 2>/dev/null - Playwright artifacts:
rm -rf frontend/test-results frontend/e2e/test-results frontend/e2e/playwright-report - Build outputs:
rm -rf frontend/dist
Phase 3: Medium Impact (ask user first)
These free significant space but may require rebuild time:
- Docker prune:
docker system prune -f(removes stopped containers, dangling images) - Cargo target clean:
cd native/quiche-cloudflare && cargo clean(can be several GB) - Node modules:
rm -rf frontend/node_modules(requiresnpm cito restore)
Phase 4: High Impact (always ask user first)
These free the most space but have significant rebuild cost:
- Docker full prune:
docker system prune -a -f --volumes(removes ALL unused images/volumes) - Python venvs:
rm -rf backend/venv backend/.venv(requirespip install -r requirements.txt) - Rust toolchain cache:
rm -rf /root/.cargo/registry/cache(re-downloads on next build)
Post-Cleanup
After cleanup, run the diagnostic script again to confirm space was freed:
bash .claude/skills/vm-cleanup/scripts/disk-report.sh
Report the before/after comparison to the user.
Important Notes
- Never delete
Slides/directory (60+ GB of medical imaging data) - Never delete
.claude/tracked files (project memory/config) - Never delete
backend/data/(SQLite databases, uploaded files) - The
backend/venvandbackend/.venvare gitignored and can always be recreated - Docker images can always be rebuilt from Dockerfiles