Your Mac Is Losing Gigabytes to AI Worktrees (Clean Storage and Protect Battery With Mole + AlDente)
On this page+
Check System Settings -> Storage on a developer's MacBook and you will usually find the same annoyance: 100+ GB stuck under "System Data" with zero breakdown of what is safe to delete.
If you run AI coding agents every day, there is an even faster leak sitting beside Xcode caches and Docker images: isolated worktrees.
Every time Codex, T3 Code, or a subagent spins up a fresh worktree branch, it ends up with its own node_modules, .next, .open-next, .venv, or .wrangler directory. On a 256 GB MacBook Air (~228 GB usable), twenty tasks a week can push disk usage past 90% before you notice. Meanwhile, leaving that same laptop plugged into your monitor all week holds the battery at 100% under heat while containers and builds compile.
I rely on two lightweight tools to stay ahead of both: Mole for terminal disk cleanup and diagnostics, and AlDente for desk charge limits.
Part 1: Find and Purge Hidden Gigabytes With Mole
Mole is an open-source macOS CLI cleaner and system monitor—fast, scriptable, and completely transparent about what it touches before deleting anything.
brew install moleYou can invoke it as mole or the shorter alias mo. Running mo alone opens the main menu, or you can run each tool directly.
Check Disk and Battery Pressure First (mo status)
Before guessing what needs cleaning, check mo status for a live view of disk usage, purgeable APFS space, swap pressure, and battery health/cycles:

If you want to pipe telemetry into a script or quick check, mo status --json prints the same snapshot as JSON.
Always Dry-Run System Caches First (mo clean)
Never let a cleanup tool delete caches blindly. Preview every category and byte total with --dry-run:
mo clean --dry-runIf you also want to inspect root-level system caches, authenticate sudo upfront with sudo -v && mo clean --dry-run.

Once the dry-run looks safe, run the sweep or add exceptions with --whitelist:
mo clean
mo clean --whitelistTarget AI Coding Worktrees With mo purge
mo purge is the command that reclaims the most space for developers. It scans configured workspace roots and removes stale build artifacts (node_modules, .next, dist, target, .venv) from dormant branches and repos without touching source code.
Configure ~/.config/mole/purge_paths interactively via mo purge --paths, or point it straight at your agent worktree folders:
~/.codex/worktrees
~/.t3/worktrees
~/projectsThen preview and clean dormant build artifacts cleanly:
mo purge --dry-run
mo purgeEvery Other mo Command Worth Keeping
| Command | Purpose | Safe preview / option |
|---|---|---|
mo clean | Clears user/system caches, old logs, crash reports | mo clean --dry-run |
mo purge | Deletes stale build artifacts across worktrees and repos | mo purge --dry-run |
mo analyze | Interactive TUI disk explorer (mo analyze /Volumes for drives) | Read-only |
mo uninstall | Removes apps along with leftover preferences and caches | mo uninstall --dry-run |
mo installer | Finds and removes leftover .dmg and .pkg installers | mo installer --dry-run |
mo slim | Strips unused Intel (x86_64) slices from Apple Silicon Universal binaries | mo slim --dry-run |
mo optimize | Refreshes system caches and background services | mo optimize --dry-run |
mo status | Live CPU, RAM/swap, APFS disk, and battery dashboard | mo status --json |
mo history | Reviews past Mole cleanup runs | mo history --json |
mo touchid | Enables Touch ID authentication for sudo prompts | mo touchid enable --dry-run |
(Enabling mo touchid is useful on its own—you can approve sudo in Ghostty with a fingerprint instead of retyping your password.)
Part 2: Cap Desk Charging at 80% With AlDente
Freeing SSD space solves sluggish builds, but keeping a MacBook plugged into a charger 90% of the week wears down battery cells just as steadily.
macOS's built-in Optimized Battery Charging tries to predict when you will unplug—so anyone working irregular hours or long overnight runs still ends up pinned at 100% while Docker, Next.js builds, and local agents generate sustained heat.

AlDente enforces deterministic limits straight in your menu bar:
- Set an 80% daily cap (or 70–80%): Once charged to your limit, external power runs the Mac directly without holding cells at 100% voltage.
- Enable Heat Protection: Pauses charging automatically whenever battery temperature climbs under heavy builds or container workloads.
- Top up to 100% on travel days: Click once to lift the cap before stepping away from your desk or heading to a flight.
- Run monthly calibration: Because staying capped at 80% for weeks can let macOS's percentage estimate drift, cycle cleanly once a month so battery reporting stays accurate.
Weekly Maintenance Routine
- Run
mo statusandmo clean --dry-runwhenever free disk drops below ~30 GB or builds start swapping heavily. - Run
mo purge --dry-runafter wrapping multi-PR agent sprints so old.t3/worktreesand.codex/worktreescheckouts do not hoard duplicatenode_modules. - Leave AlDente capped at
80%on desk days and pair your runs with Amphetamine, Raycast Coffee, orcaffeinateso tasks finish without mid-build sleep.
If you are refining the rest of your macOS environment, check out Every Developer Should Set Up Their Terminal Like This and 8 Mac Apps for Dev and AI Workflows.