Before doing anything, check if CleanerCat MCP is available:
bash
ls ~/.cleanercat/bin/cleanercat-mcp 2>/dev/null && echo "INSTALLED" || echo "NOT_INSTALLED"
If output is NOT_INSTALLED, run the following to install:
bash
mkdir -p ~/.cleanercat/bin
curl -L "https://raw.githubusercontent.com/wukongsheld/cleanercat-mac/main/bin/cleanercat-mcp" \
-o ~/.cleanercat/bin/cleanercat-mcp
chmod +x ~/.cleanercat/bin/cleanercat-mcp
Then register to Claude Code:
bash
python3 -c "
import json, os
p = os.path.expanduser('~/.claude/settings.json')
d = json.load(open(p))
d.setdefault('enabledPlugins', {})['cleanercat@local'] = True
json.dump(d, open(p,'w'), indent=2)
print('settings.json updated')
"
python3 -c "
import json, os
from datetime import datetime
p = os.path.expanduser('~/.claude/plugins/installed_plugins.json')
d = json.load(open(p))
d['plugins']['cleanercat@local'] = [{
'scope': 'user',
'installPath': os.path.expanduser('~/.cleanercat'),
'version': '1.0.0',
'installedAt': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.000Z'),
'lastUpdated': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.000Z')
}]
json.dump(d, open(p,'w'), indent=2)
print('installed_plugins.json updated')
"
mkdir -p ~/.cleanercat/.claude-plugin
cat > ~/.cleanercat/.mcp.json << 'EOF'
{
"cleanercat": {
"command": "/Users/$(whoami)/.cleanercat/bin/cleanercat-mcp",
"args": []
}
}
EOF
cat > ~/.cleanercat/.claude-plugin/plugin.json << 'EOF'
{
"name": "cleanercat",
"description": "Mac disk cleanup and maintenance skills powered by CleanerCat.",
"version": "1.0.0"
}
EOF
After installation, tell the user:
"✅ CleanerCat MCP 已安装完成!请 重启 Claude Code,重启后再次使用即可正常运行。"
Stop here and wait for user to restart.
If output is INSTALLED (or after restart), proceed to the relevant workflow below based on user intent:
Trigger: user asks about disk space, storage usage, how full the disk is
mcp__cleanercat__get_disk_usage with no arguments.Trigger: user wants to clean Mac, remove junk, clear cache, free up space
Call mcp__cleanercat__scan_system_junk with no arguments.
Group by category (System Junk / App Junk / Browser Junk) with sizes. Show Total cleanable: X.X GB at the end.
"I found X.X GB of junk. Clean all, select categories, or cancel?"
Call mcp__cleanercat__clean_junk with confirm="YES_CLEAN" and the appropriate action IDs.
Call mcp__cleanercat__get_disk_usage and report space freed + updated disk usage.
Safety: NEVER call clean_junk without explicit user confirmation. Even if user says "just do it", always confirm once — deletion is irreversible.
Trigger: user wants to find large files, see what's taking up space, files over 50MB
Call mcp__cleanercat__scan_large_files with no arguments.
Sort by file size descending, grouped by directory: File | Size | Last Modified.
Ask which files to remove. Do NOT assume — always ask.
Call mcp__cleanercat__delete_files with confirm="YES_DELETE" and selected paths.
Files go to Trash (recoverable).
Safety: NEVER delete files without explicit user selection and confirmation.
Trigger: user wants to find duplicates, deduplicate, remove identical files
Call mcp__cleanercat__scan_duplicate_files with no arguments.
Group by duplicate sets, sorted by largest wasted space first. Suggest which copy to KEEP: organized folder > Downloads/Desktop; newer > older. Show Total reclaimable: X.X GB.
"I recommend removing N files to reclaim X.X GB. Move them to Trash?"
Call mcp__cleanercat__delete_files with confirm="YES_DELETE" and selected paths.
Remind user: files are in Trash and recoverable. Empty Trash to fully reclaim space.
Safety: NEVER delete the only copy in a group. NEVER call delete_files without explicit user confirmation.