Mole Optimize Skill
Author: Anton Gulin · Tool: opencode-skill-creator · GitHub: @antongulin · Registry: skills.sh
Use this skill when you need to help a user improve macOS system performance using Mole's optimize command.
Overview
mo optimize performs system maintenance tasks: clearing caches that slow down the system, optimizing databases, repairing configs, and tuning services.
Command Reference
Basic Usage
mo optimize # Run full optimization (will prompt for sudo)
mo optimize --dry-run # Preview what would be optimized
mo optimize --whitelist # Manage protected optimization items
mo optimize --debug # Show detailed operation logs
mo optimize --help # Show help
Flags
| Flag | Description |
|---|---|
--dry-run |
Preview optimization actions without modifying files |
--whitelist |
Open interactive whitelist manager for optimization items |
--debug |
Show detailed operation logs |
--help |
Show help |
What It Does
The optimize command performs these operations:
- System health check — Collects memory, disk, uptime, and system metrics
- Diagnostics — Runs
health_jsongenerator to identify optimization opportunities - Cache optimization — Clears system and user caches that impact performance
- Database optimization — Optimizes system databases and indexes
- Configuration repair — Fixes damaged preference files and plists
- Service tuning — Refreshes background services and daemons
Workflow Patterns
Pattern 1: Quick System Health + Optimization
mo optimize
The tool will:
- Check system health (RAM, disk, uptime)
- Request sudo for system-level tasks
- Show optimization results
Pattern 2: Preview Before Optimizing
mo optimize --dry-run
Shows what actions would be taken without making any changes.
Pattern 3: Exclude Specific Items
mo optimize --whitelist
Opens the whitelist editor to protect specific optimization tasks from running.
Pattern 4: Check System Health Only
Use mo status for a live system health dashboard. The optimize command includes a health snapshot at the start but is focused on actionable optimizations.
Output Format
The command outputs a JSON-based diagnostics report that includes:
{
"memory_used_gb": 12.5,
"memory_total_gb": 16,
"disk_used_gb": 234,
"disk_total_gb": 500,
"disk_used_percent": 46.8,
"uptime_days": 12.3,
"optimizations": [
{
"action": "clear_dns_cache",
"name": "Clear DNS cache",
"description": "Flush DNS resolver cache",
"safe": true
}
]
}
Safety Guidance
- System optimization requires sudo — the tool handles this interactively
--dry-runis recommended before running optimizations- The whitelist protects specific optimization tasks from running
- All optimization actions are designed to be safe (caches regenerate, configs have backups)
- The
bccommand is required for calculations — suggestbrew install bcif missing - System health data requires
awk,sysctl, anddfcommands
Dependencies
bc— Required for numerical calculations. Install withbrew install bc
Exit Codes
0: Success (or dry-run complete)130: Interrupted (Ctrl+C)
Related Commands
mo status— Live system health dashboardmo clean— Free up disk space (complementary)mo analyze— Explore disk usage in detail