- A practical guide to cleaning up a Mac with Claude Code: find what's eating your disk, what's safe to delete, how to compress huge videos without quality loss, and how to get alerts before your disk fills up. Includes copy-paste prompts.
A 69-minute screen recording at 120 frames per second took up 13.7GB on my machine. The same recording at 30 frames per second, which looks identical to the eye, comes out at around 1.8GB.
My Mac's disk hit 100%. I had 69MB free out of 460GB. That wasn't even the scary part.
The scary part was discovering that, without a single warning, half my automations had already stopped working. 19 Reels renders had failed, a website build had stalled mid-process, and even Claude Code couldn't run a single command: every command needs to write a small output file, and there was nowhere to write it.
Within half an hour, working together with Claude Code, I went from 69MB to 12GB free without touching a single personal file, and mapped out another 45GB I could still reclaim. This guide covers the method step by step, the prompts you can copy, and the mistake I almost made.
In short
| Step | What you do | How much it freed for me |
|---|---|---|
| 1. Diagnosis | Claude Code shows what's taking up disk space, without deleting anything | 0, but now you can see everything |
| 2. Safe caches | npm, Homebrew, pip | ~12GB |
| 3. Junk files | Installer files and duplicates, to the Trash | ~1.6GB |
| 4. Compression | A massive screen recording, from 120 to 30 fps | ~12GB |
| 5. Archive | Old raw project files to Drive or an external disk | 34.6GB |
| 6. Prevention | Automatic alert when space runs low | Peace of mind |
Why does a Mac's disk fill up without you noticing?
Because most of the space is eaten by things you never see: caches, raw project files, and old downloads. macOS labels them as "System Data" or hides them in folders like Library, which makes it genuinely hard to understand what's actually taking up space.
Here's what we found on my machine:
- Downloads: 63GB. Most of it was two folders: raw Screen Studio projects (34.6GB) and a single video file at 13.7GB.
- App caches (Library/Caches): 41GB, with 30GB belonging to Chrome alone.
- npm cache: 14GB. Every time you install a code package, a copy of it gets saved on the side.
- My Reels system cache: 5.3GB.
Step 1: Diagnose, without deleting anything
The first rule: look first, decide later. Don't let any AI agent delete anything before you have a full list in front of you.
Here's the prompt I used in Claude Code:
"Check how much free space I have on disk and what's taking up the most space in my home directory, including Downloads and Library/Caches. Don't delete anything. Show me a sorted list by size."
Behind the scenes, Claude Code runs two simple commands. If you want to see for yourself:
df -h /System/Volumes/Data
du -sh ~/Downloads ~/Library/Caches ~/.npm 2>/dev/null | sort -h
The first line shows how much space is free. The second shows the size of each folder.
Step 2: What's safe to delete, and what isn't?
Caches from tools and apps are safe to delete, because they rebuild themselves automatically. Your own files are your decision alone. I asked Claude Code to split the list into three groups:
"From this list, what is safe to delete because it rebuilds itself, what should be compressed, and what are personal files that only I decide on? Split into three groups and explain each one in a sentence."
| Group | Examples | What to do |
|---|---|---|
| Safe | npm cache, Homebrew cache, pip cache, installer files (dmg) for apps already installed | Delete |
| Compress | Screen recordings and raw video files | Compress, and delete the original only after reviewing |
| Your call | Documents, recordings, projects, Downloads folder | Move to Trash, Drive, or an external disk |
Step 3: The mistake I almost made
I tried to delete the entire npm cache in one command, and it failed partway through. Some of the files there had been created with admin permissions (sudo), and the deletion got stuck on them with "Permission denied."
Luckily, even a partial deletion freed almost 12GB, and from that point the machine could breathe again. But the lesson matters: if you see "Permission denied," don't try to force your way through. The clean approach is to take ownership of the folder first, then clean it:
sudo chown -R $(whoami) ~/.npm
npm cache clean --force
Run the command with sudo yourself, since it will ask for your password. An AI agent should never receive your computer password. Not ever.
Step 4: One recording at 13.7GB
The most surprising find: a single video file taking up 13.7GB. Claude Code inspected it and found a 69-minute recording at 1080p and 120 frames per second, at a bitrate of 27.7Mbps. That's four times more than the eye needs.
"Compress this video to 30 frames per second at a quality that looks identical, and save it as a new file. Don't delete the original until I've reviewed the compressed version."
The result: 1.8GB instead of 13.7GB, at the exact same length, 69 minutes. The original stayed on the side until I watched the compressed version and confirmed it.
Step 5: Old raw project files
Screen recording apps like Screen Studio save a raw project file of 2 to 7GB for every recording. After you export the final video, you only need them if you want to re-edit.
I had 29 such projects, totaling 34.6GB. The decision: keep the 6 projects from the last two months, and move the older ones to Drive or an external disk. That way they leave the Mac without being lost.
And a hard rule: personal files go to the Trash, they don't get permanently deleted. Empty the Trash only after you've reviewed it, and only then does the space actually free up.
Step 6: Making sure it doesn't happen again
The real problem wasn't the full disk. It was that nobody knew. So I asked Claude Code to build an alert:
"Build me an automated check that runs every hour on the Mac. If less than 10GB is free, pop up a notification on screen showing how much space is left and which folders are the largest."
In my case the alert goes to WhatsApp, and my Reels system stops itself before it fails. For you, a simple macOS notification is a fine place to start: Claude Code builds it using launchd, the Mac's built-in scheduler, in a matter of minutes.
Other things that eat space, and what to do about them
- Chrome cache: 30GB on my machine. Chrome rebuilds it on its own, but it's better to clear it from within Chrome: Settings, Privacy, "Clear browsing data," and check only "Cached images and files."
- Old iPhone backups: Located in Library/Application Support/MobileSync. If you have several, you can keep only the most recent.
- Docker: If you're a developer,
docker system prunecan sometimes free tens of GB of old images. - The Trash: Obvious, but everything you've moved to the Trash still takes up space until you empty it.
What this means for your business
Any business running automations on a computer depends on the least interesting thing imaginable: free disk space. Agents, scripts, and render jobs don't warn you when the disk fills up. They just fail silently.
A two-minute check worth doing today:
- How much free space is on the machine running your automations?
- What happens to your processes if it fills up tomorrow morning?
- Who gets an alert, and when?
If the answer to the third question is "nobody," that's the first thing to build. More on automations that run on their own on a Mac: Scheduled tasks with Claude Code. And for those just getting started: Claude Code for beginners.
The bottom line
Claude Code didn't clean the computer for me. It did something better: showed me exactly what was there, separated what was safe from what was mine, and did the grunt work only after I approved. 69MB became 12GB in half an hour, and another 45GB is waiting on my decision.
Want to learn to work this way with Claude Code across your whole machine, not just on code? The full Claude Code workshop teaches exactly that.
Yaakov Tzedek, AI lecturer, consultant and implementer for organizations, community leader in AI, GEO and AI adoption, with over 150,000 people.

