mole-mac-cleaner

Deep clean and optimize your Mac using the Mole CLI tool

22 stars

Best use case

mole-mac-cleaner is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Deep clean and optimize your Mac using the Mole CLI tool

Teams using mole-mac-cleaner should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/mole-mac-cleaner/SKILL.md --create-dirs "https://raw.githubusercontent.com/Aradotso/trending-skills/main/skills/mole-mac-cleaner/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/mole-mac-cleaner/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How mole-mac-cleaner Compares

Feature / Agentmole-mac-cleanerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Deep clean and optimize your Mac using the Mole CLI tool

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Mole Mac Cleaner

> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.

Mole (`mo`) is an all-in-one macOS maintenance CLI that combines deep cleaning, smart app uninstallation, disk analysis, system optimization, live monitoring, and project artifact purging into a single binary.

## Installation

```bash
# Via Homebrew (recommended)
brew install mole

# Via install script (supports version pinning)
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash

# Specific version
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash -s 1.17.0

# Latest main branch (nightly)
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash -s latest
```

## Core Commands

```bash
mo                    # Interactive menu (arrow keys or vim h/j/k/l)
mo clean              # Deep system cache + browser + dev tool cleanup
mo uninstall          # Remove apps plus all hidden remnants
mo optimize           # Rebuild caches, reset network, refresh Finder/Dock
mo analyze            # Visual disk space explorer
mo status             # Live real-time system health dashboard
mo purge              # Remove project build artifacts (node_modules, target, dist)
mo installer          # Find and remove installer .dmg/.pkg files

mo touchid            # Configure Touch ID for sudo
mo completion         # Set up shell tab completion
mo update             # Update Mole
mo update --nightly   # Update to latest unreleased build (script install only)
mo remove             # Uninstall Mole itself
mo --help
mo --version
```

## Safe Preview Before Deleting

Always dry-run destructive commands first:

```bash
mo clean --dry-run
mo uninstall --dry-run
mo purge --dry-run

# Combine with debug for detailed output
mo clean --dry-run --debug
mo optimize --dry-run --debug
```

## Key Command Details

### `mo clean` — Deep Cleanup

Cleans user app caches, browser caches (Chrome, Safari, Firefox), developer tool caches (Xcode, Node.js, npm), system logs, temp files, app-specific caches (Spotify, Dropbox, Slack), and Trash.

```bash
mo clean                  # Interactive cleanup
mo clean --dry-run        # Preview what would be removed
mo clean --whitelist      # Manage protected caches (exclude from cleanup)
```

Whitelist config lives at `~/.config/mole/`. Edit it to protect paths you want to keep.

### `mo uninstall` — Smart App Removal

Finds apps, shows size and last-used date, then removes the app bundle plus all related files:
- Application Support, Caches, Preferences
- Logs, WebKit storage, Cookies
- Extensions, Plugins, Launch Daemons

```bash
mo uninstall              # Interactive multi-select list
mo uninstall --dry-run    # Preview removals
```

### `mo optimize` — System Refresh

```bash
mo optimize               # Run all optimizations
mo optimize --dry-run     # Preview
mo optimize --whitelist   # Exclude specific optimizations
```

Optimizations include:
- 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

### `mo analyze` — Disk Explorer

```bash
mo analyze                # Analyze home directory (skips /Volumes by default)
mo analyze ~/Downloads    # Analyze specific path
mo analyze /Volumes       # Include external drives explicitly

# Machine-readable output for scripting
mo analyze --json ~/Documents
```

**JSON output example:**
```json
{
  "path": "/Users/you/Documents",
  "entries": [
    { "name": "Library", "path": "...", "size": 80939438080, "is_dir": true }
  ],
  "total_size": 168393441280,
  "total_files": 42187
}
```

**Navigator shortcuts inside `mo analyze`:**
| Key | Action |
|-----|--------|
| `↑↓` or `j/k` | Navigate list |
| `←→` or `h/l` | Go back / Enter directory |
| `O` | Open in Finder |
| `F` | Reveal in Finder |
| `⌫` | Move to Trash (via Finder, safer than direct delete) |
| `L` | Show large files |
| `Q` | Quit |

### `mo status` — Live Dashboard

```bash
mo status                 # Real-time CPU, GPU, memory, disk, network, processes
mo status --json          # JSON output for scripting
mo status | jq '.health_score'   # Auto-detects pipe → outputs JSON
```

**JSON output example:**
```json
{
  "host": "MacBook-Pro",
  "health_score": 92,
  "cpu": { "usage": 45.2, "logical_cpu": 8 },
  "memory": { "total": 25769803776, "used": 15049334784, "used_percent": 58.4 },
  "disks": [],
  "uptime": "3d 12h 45m"
}
```

Shortcuts inside `mo status`: `k` toggles the cat mascot, `q` quits.

### `mo purge` — Project Artifact Cleanup

Scans for `node_modules`, `target`, `build`, `dist`, `venv`, and similar directories. Projects newer than 7 days are unselected by default.

```bash
mo purge                  # Interactive multi-select
mo purge --dry-run        # Preview
mo purge --paths          # Configure custom scan directories
```

**Configure custom scan paths** (`~/.config/mole/purge_paths`):
```
~/Documents/MyProjects
~/Work/ClientA
~/Work/ClientB
```

When this file exists, Mole uses only those paths. Otherwise it defaults to `~/Projects`, `~/GitHub`, `~/dev`.

> Install `fd` for faster scanning: `brew install fd`

### `mo installer` — Installer File Cleanup

```bash
mo installer              # Find .dmg/.pkg files in Downloads, Desktop, Homebrew cache, iCloud, Mail
mo installer --dry-run    # Preview removals
```

## Configuration Files

All config lives in `~/.config/mole/`:

| File | Purpose |
|------|---------|
| `purge_paths` | Custom directories for `mo purge` to scan |
| `operations.log` | Log of all file operations |

**Disable operation logging:**
```bash
export MO_NO_OPLOG=1
mo clean
```

## Shell Tab Completion

```bash
mo completion             # Interactive setup for bash/zsh/fish
```

## Touch ID for sudo

```bash
mo touchid                # Enable Touch ID authentication for sudo commands
mo touchid enable --dry-run
```

## Scripting & Automation Patterns

### Check disk health in a script

```bash
#!/bin/bash
health=$(mo status --json | jq -r '.health_score')
if [ "$health" -lt 70 ]; then
  echo "Health score low: $health — running cleanup"
  mo clean --dry-run  # swap to `mo clean` when ready
fi
```

### Get largest directories as JSON and process with jq

```bash
mo analyze --json ~/Downloads | jq '.entries | sort_by(-.size) | .[0:5] | .[] | {name, size_gb: (.size / 1073741824 | . * 100 | round / 100)}'
```

### Automated project purge in CI teardown

```bash
#!/bin/bash
# Non-interactive purge of build artifacts after CI
MO_NO_OPLOG=1 mo purge --dry-run   # always preview first in scripts
```

### Raycast / Alfred quick launchers

```bash
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
# Then bind `mo clean`, `mo status`, `mo analyze` as script commands in Raycast
```

## Safety Boundaries

- `mo analyze` moves files to Trash via Finder (recoverable) instead of direct deletion — prefer it for ad hoc cleanup
- `clean`, `uninstall`, `purge`, `installer`, and `remove` are **permanently destructive** — always `--dry-run` first
- Mole validates paths and enforces protected-directory rules; it skips or refuses high-risk operations
- Operation log: `~/.config/mole/operations.log` — disable with `MO_NO_OPLOG=1`
- Review [SECURITY.md](https://github.com/tw93/Mole/blob/main/SECURITY.md) and [SECURITY_AUDIT.md](https://github.com/tw93/Mole/blob/main/SECURITY_AUDIT.md) before using in automated pipelines

## Troubleshooting

| Problem | Solution |
|---------|----------|
| `mo: command not found` | Run `brew install mole` or re-run install script; check `$PATH` |
| Purge scan is slow | Install `fd`: `brew install fd` |
| External drives not appearing in analyze | Run `mo analyze /Volumes` explicitly |
| Want to protect a cache from being cleaned | Run `mo clean --whitelist` to add it |
| Need to exclude an optimization step | Run `mo optimize --whitelist` |
| Script getting interactive prompts | Use `--dry-run` flag; check for `MO_NO_OPLOG=1` env var |
| Nightly update not working | Nightly updates (`--nightly`) only work with script install, not Homebrew |

## Update & Remove

```bash
mo update                 # Update to latest stable
mo update --nightly       # Update to latest main (script install only)
mo remove                 # Uninstall Mole completely
mo remove --dry-run       # Preview what remove would delete
```

Related Skills

puremac-macos-cleaner

22
from Aradotso/trending-skills

Free open-source macOS cleaner built with SwiftUI — CleanMyMac alternative with zero telemetry, scheduled auto-cleaning, and Xcode/Homebrew/system cache cleanup.

```markdown

22
from Aradotso/trending-skills

---

zeroboot-vm-sandbox

22
from Aradotso/trending-skills

Sub-millisecond VM sandboxes for AI agents using copy-on-write KVM forking via Zeroboot

yourvpndead-vpn-detection

22
from Aradotso/trending-skills

Android app that detects VPN/proxy servers (VLESS/xray/sing-box) via local SOCKS5 vulnerability, exposing exit IPs and server configs without root

xata-postgres-platform

22
from Aradotso/trending-skills

Expert skill for Xata open-source cloud-native Postgres platform with copy-on-write branching, scale-to-zero, and Kubernetes deployment

x-mentor-skill-nuwa

22
from Aradotso/trending-skills

AI-powered X (Twitter) content strategy skill that distills methodologies from 6 top creators + open-source algorithm data into actionable writing, growth, and monetization guidance.

wx-favorites-report

22
from Aradotso/trending-skills

End-to-end pipeline to extract, decrypt, and visualize WeChat Mac favorites from encrypted SQLite DB into an interactive HTML report.

wterm-web-terminal

22
from Aradotso/trending-skills

Web terminal emulator with Zig/WASM core, DOM rendering, and React/vanilla JS bindings

worldmonitor-intelligence-dashboard

22
from Aradotso/trending-skills

Real-time global intelligence dashboard with AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking

witr-process-inspector

22
from Aradotso/trending-skills

CLI and TUI tool that explains why processes, services, and ports are running by tracing causality chains across supervisors, containers, and shells.

wildworld-dataset

22
from Aradotso/trending-skills

WildWorld large-scale action-conditioned world modeling dataset with 108M+ frames from a photorealistic ARPG game, featuring per-frame annotations, 450+ actions, and explicit state information for generative world modeling research.

whatcable-macos-usb-inspector

22
from Aradotso/trending-skills

macOS menu bar app that identifies USB-C cable capabilities and charging diagnostics using IOKit