agentleFS
Simple-With-UsSimple-With-Us/BotFleet/.claude/skills/mac-cleanup/SKILL.md

mac-cleanup

Skill4 starsChanged 10 days agoApache-2.0View on GitHub

Optimize Mac workstation and Hetzner Coolify disk space, prune merged git worktrees across all apps, clean Xcode symbols/simulators, and flush package caches. Use when checking disk health or optimizing local storage.

  • Deletes or force-pushes

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Mac & Hetzner Disk Cleanup Skill (ALL AGENTS)

Shared ~/.claude/skills. Monet, Claude/Fable, and (when active) Renoir all load this directory. Do not treat the word Monet in examples as proof of your seat. Pin AGENT_SEAT / AGENT_TAG from the logged-in account before Slack or board --by:

  • Monet → MONET, Notes Monet, monet/, ~/apps/<app>-monet
  • Claude / Fable → CLAUDE, Notes Claude, claude/, ~/apps/<app>-claude
  • Renoir → RENOIR, Notes Renoir, renoir/, ~/apps/<app>-renoir Cursor, Grok, Grok Bot, Codex, AG, DeepSeek, Kimi, and Fx have their own skill dirs and must not take identity from here.

Optimize local workstation storage and remote Coolify server disk usage by running the unified automated maintenance sweep.

How to Run the Cleanup

1. Direct Command (All Platforms)

Any agent (Antigravity, Grok, Claude, Cursor, Codex) or operator can execute the unified cleanup script directly:

bash /Users/jay/apps/mac-auto-cleanup.sh

Or using the CLI shortcut (available in zsh and bash):

mac-auto-cleanup

2. What It Cleans (Safe & Idempotent)

  1. Merged Git Worktrees:
    • Owned by com.jay.disk-janitor (clean + idle + no --force). This script does not reap worktrees or wipe ~/.grok/worktrees.
  2. Xcode Developer Caches:
    • Cleans ~/Library/Developer/Xcode/iOS DeviceSupport symbols.
    • Cleans ~/Library/Developer/Xcode/DerivedData build caches.
    • Prunes unavailable simulators only (xcrun simctl delete unavailable). Never rm -rf CoreSimulator/Devices.
  3. Package Manager Caches:
    • npm cache clean --force and ~/.npm/_npx
    • pnpm store prune
    • yarn cache clean
    • brew cleanup -s
  4. Spotlight PipelineStorage Journals:
    • Truncates oversized Apple Intelligence / CoreSpotlight PipelineStorage journals.
  5. Agent Session Transcripts:
    • Prunes Grok session transcripts older than 7 days (~/.grok/sessions).
    • Prunes old Codex archived sessions (~/.codex/archived_sessions).
    • Prunes old Antigravity brain conversation folders older than 7 days (~/.gemini/antigravity/brain).
  6. Remote Hetzner Coolify Server (167.233.254.55):
    • Automatically triggers remote Docker cleanup (docker builder prune -af --filter "until=72h" and docker system prune -af --volumes).

Scheduled Automation

  • Mac LaunchAgent: ~/Library/LaunchAgents/com.jay.mac-cleanup.plist runs automatically every 4 hours (StartInterval: 14400).
  • Hetzner Cron: /etc/cron.d/coolify-maintenance runs automatically every 4 hours.

Quick Status Check

To view live disk space and system process health:

ms
# or
bash ~/apps/mac-status.sh

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.