mac-cleanup

Deletes trash, old caches, and aged downloads on macOS via a Python script.

1|Updated May 10, 2026
One-click install
npx skills add https://github.com/Tgoldi/claude-skills --skill mac-cleanup-tgoldi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mac-cleanup
Source: https://github.com/Tgoldi/claude-skills/tree/main/mac-cleanup
Command: npx skills add https://github.com/Tgoldi/claude-skills --skill mac-cleanup-tgoldi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Disk space on a MacBook fills up with accumulated trash, stale system caches, and forgotten downloads, and manually clearing each location is repetitive and easy to forget. ## Core Features & Use Cases - Trash Emptying: Permanently deletes files and folders in ~/.Trash. - Cache Cleanup: Removes files in ~/Library/Caches older than 7 days to reclaim space while avoiding recently used caches. - Downloads Pruning: Deletes files in ~/Downloads older than 30 days. - Safe Dry-Run Default: The script runs in dry-run mode by default, listing what would be deleted; actual deletion requires the --force flag. - Use Case: Ask your agent to "clean up my mac" to get a report of reclaimable space across Trash, Caches, and Downloads before committing to deletion. ## Quick Start Ask the agent to run the mac cleanup skill in dry-run mode to see how much disk space can be reclaimed from Trash, Caches, and Downloads.

Frequently Asked Questions about mac-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up disk space on macOS with a script?

Run the cleanup.py script, which scans ~/.Trash, ~/Library/Caches, and ~/Downloads and deletes files based on age rules. It runs in dry-run mode by default; pass --force to actually delete files.

How to delete old files from Downloads folder automatically on Mac?

The script checks each file's modification time in ~/Downloads and deletes only files older than 30 days. In dry-run mode it prints what would be deleted along with estimated space freed.

Is it safe to delete files from ~/Library/Caches on macOS?

Cache files are generally regenerated by macOS apps, but deleting caches of currently running apps can cause slowdowns or crashes. This script mitigates risk by only deleting cache files older than 7 days and printing a warning.

Does the mac cleanup script delete files permanently?

Yes, when run with --force it uses os.remove and shutil.rmtree, which bypass the Trash and permanently delete files. The default dry-run mode lets you review every deletion before committing.

Why does the cleanup script not delete some files?

Files younger than the age thresholds (7 days for caches, 30 days for downloads) are skipped, and permission errors on protected items are caught and printed. Subdirectories outside the Trash are also left untouched.