home / skills / openclaw / skills / mole-mac-cleanup

mole-mac-cleanup skill

This skill helps you clean, optimize, and purge project artifacts on macOS, improving performance and disk health with an all-in-one toolkit.

npx playbooks add skill openclaw/skills --skill mole-mac-cleanup

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
3.8 KB
---
name: mole-mac-cleanup
description: Mac cleanup & optimization tool combining CleanMyMac, AppCleaner, DaisyDisk features. Deep cleaning, smart uninstaller, disk insights, and project artifact purge.
author: Benjamin Jesuiter <[email protected]>
metadata:
  clawdbot:
    emoji: "๐Ÿงน"
    os: ["darwin"]
    requires:
      bins: ["mo"]
    install:
      - id: brew
        kind: brew
        formula: mole
        bins: ["mo"]
        label: Install Mole via Homebrew
---

# Mole - Mac Cleanup & Optimization Tool

**Repo:** https://github.com/tw93/Mole
**Command:** `mo` (not `mole`!)
**Install:** `brew install mole`

> **Note for humans:** `mo` without params opens an interactive TUI mode. Not useful for agents, but you might wanna try it manually! ๐Ÿ˜‰

## What It Does

All-in-one toolkit combining CleanMyMac, AppCleaner, DaisyDisk, and iStat Menus:
- **Deep cleaning** โ€” removes caches, logs, browser leftovers
- **Smart uninstaller** โ€” removes apps + hidden remnants
- **Disk insights** โ€” visualizes usage, manages large files
- **Live monitoring** โ€” real-time system stats
- **Project artifact purge** โ€” cleans `node_modules`, `target`, `build`, etc.

---

## Non-Interactive Commands (Clawd-friendly)

### Preview / Dry Run (ALWAYS USE FIRST)
```bash
mo clean --dry-run              # Preview cleanup plan
mo clean --dry-run --debug      # Detailed preview with risk levels & file info
mo optimize --dry-run           # Preview optimization actions
mo optimize --dry-run --debug   # Detailed optimization preview
```

### Execute Cleanup
```bash
mo clean                        # Run deep cleanup (caches, logs, browser data, trash)
mo clean --debug                # Cleanup with detailed logs
```

### System Optimization
```bash
mo optimize                     # Rebuild caches, reset services, refresh Finder/Dock
mo optimize --debug             # With detailed operation logs
```

**What `mo optimize` does:**
- Rebuild system databases and clear caches
- Reset network services
- Refresh Finder and Dock
- Clean diagnostic and crash logs
- Remove swap files and restart dynamic pager
- Rebuild launch services and Spotlight index

### Whitelist Management
```bash
mo clean --whitelist            # Manage protected cache paths
mo optimize --whitelist         # Manage protected optimization rules
```

### Project Artifact Purge
```bash
mo purge                        # Clean old build artifacts (node_modules, target, venv, etc.)
mo purge --paths                # Configure which directories to scan
```

Config file: `~/.config/mole/purge_paths`

### Installer Cleanup
```bash
mo installer                    # Find/remove .dmg, .pkg, .zip installers
```

Scans: Downloads, Desktop, Homebrew caches, iCloud, Mail attachments

### Setup & Maintenance
```bash
mo touchid                      # Configure Touch ID for sudo
mo completion                   # Set up shell tab completion
mo update                       # Update Mole itself
mo remove                       # Uninstall Mole from system
mo --version                    # Show installed version
mo --help                       # Show help
```

---

## Typical Workflow

1. **Check what would be cleaned:**
   ```bash
   mo clean --dry-run --debug
   ```

2. **If looks good, run cleanup:**
   ```bash
   mo clean
   ```

3. **Optimize system (after cleanup):**
   ```bash
   mo optimize --dry-run
   mo optimize
   ```

4. **Clean dev project artifacts:**
   ```bash
   mo purge
   ```

---

## What Gets Cleaned (`mo clean`)

- User app cache
- Browser cache (Chrome, Safari, Firefox)
- Developer tools (Xcode, Node.js, npm)
- System logs and temp files
- App-specific cache (Spotify, Dropbox, Slack)
- Trash

## Notes

- **Terminal:** Best with Ghostty, Alacritty, kitty, WezTerm. iTerm2 has issues.
- **Safety:** Use `--dry-run` first. Built with strict protections.
- **Debug:** Add `--debug` for detailed logs.

Overview

This skill is a Mac cleanup and optimization tool that combines deep cleaning, smart uninstallation, disk insights, and project artifact purging. It offers dry-run previews, targeted removals, and system optimization routines to reclaim space and improve responsiveness. The command-line interface is optimized for agent workflows and automation.

How this skill works

The tool scans system and user locations for caches, logs, browser leftovers, installer files, and large project artifacts. It provides dry-run previews with risk levels and optional debug output, then executes safe removal and optimization steps like rebuilding caches, resetting services, and refreshing Finder/Dock. Whitelists and config files let you protect specific paths and tune purge targets.

When to use it

  • When disk space is low and you need a safe, comprehensive cleanup plan.
  • Before distribution builds or CI runs to remove stale project artifacts (node_modules, build targets).
  • When the system feels sluggish and you want to rebuild caches or reset services.
  • To remove installer files and downloads that quietly consume large storage.
  • As part of periodic maintenance or automation scripts for developer workstations.

Best practices

  • Always run a dry-run (mo clean --dry-run or mo optimize --dry-run) before executing changes.
  • Use --debug to inspect risk levels and file details when in doubt.
  • Maintain a whitelist for caches or project paths that must not be removed.
  • Run project artifact purge with configured paths to avoid deleting important sources.
  • Prefer modern terminals (Alacritty, kitty, WezTerm) for the best UI experience; avoid iTerm2 quirks.

Example use cases

  • Free up tens of gigabytes by cleaning browser caches, app caches, and old installers before a travel period.
  • Automate nightly workspace cleanup in CI agents to remove node_modules and temporary builds via mo purge.
  • Recover responsiveness by rebuilding launch services and Spotlight index after long uptime.
  • Bulk-remove .dmg/.pkg/.zip installers from Downloads and Homebrew caches to reclaim storage.
  • Safely trim developer tool leftovers (Xcode caches, npm caches) before packaging a release.

FAQ

Is it safe to run without reviewing actions?

No โ€” always preview with --dry-run and use --debug to review items before executing the cleanup.

Can I protect specific folders from purge?

Yes โ€” manage protected paths with the whitelist options and configure purge targets in ~/.config/mole/purge_paths.

Does it uninstall apps completely?

It performs a smart uninstall that removes the app plus common hidden remnants, but check dry-run output for uncommon locations.