# Scan Hidden Dirs Before Cleanup

> scan-hidden-dirs-before-cleanup

- Skill: `claudiawong522/scan-hidden-dirs-before-cleanup` (Agent Skill)
- Install (CLI): `npx skillmds@latest add claudiawong522/scan-hidden-dirs-before-cleanup`
- Raw SKILL.md: https://api.skillmd.com/api/skills/claudiawong522/scan-hidden-dirs-before-cleanup/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: claudiawong522 (https://skillmd.com/u/claudiawong522)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/claudiawong522/scan-hidden-dirs-before-cleanup

---

# scan-hidden-dirs-before-cleanup

Systematically identify and recover space from hidden directories before aggressive disk cleanup.

# Scan Hidden Directories Before Cleanup

When your disk is running critically low on space, hidden directories often contain the largest recoverable amounts of data. Before deleting important files, scan these locations first.

## Why This Matters

Hidden directories like `.git`, `.cache`, `node_modules`, and service workers can consume gigabytes of space but are easy to overlook. Identifying them first lets you make informed decisions about what to delete.

## Steps

1. **Scan hidden directories for size**
   - Run: `du -sh ~/.*` to see hidden directories in your home folder
   - Run: `du -sh ~/Library/Caches/*` to check cache directories (Mac)
   - Run: `find ~ -name "node_modules" -type d -exec du -sh {} \;` to find large dependency folders

2. **Check development artifacts**
   - Look for `.git` directories in projects: `find ~ -name ".git" -type d -exec du -sh {} \;`
   - Check build directories: `.next`, `.build`, `dist`, `build`
   - Scan for service worker caches in browser folders

3. **Prioritize by size**
   - Sort results by space usage
   - Target the largest directories first for maximum impact

4. **Clean strategically**
   - Delete caches and build artifacts (usually safe to regenerate)
   - Archive old `.git` histories if needed
   - Remove unused `node_modules` from abandoned projects

## Tips

- Use `ncdu` (NCurses Disk Usage) for an interactive directory browser
- Always verify what you're deleting before running `rm -rf`
- Consider archiving instead of deleting valuable development history
- Hidden files start with `.` and are hidden by default in most file explorers

