Free up Mac storage with Claude Code, safely

Claude Code can find what is filling your Mac. A prompt that only looks and never deletes, what to check first, and the folders it often misses.

Updated 3 December 2026 · 2 min read

Yes, Claude Code can help you free up Mac storage. It can measure your folders, explain what each one is and suggest what is safe to remove. The safe way is to let it look but not delete, then remove things yourself once you know what they are.

A prompt that only looks

Open Terminal, run claude in your home folder, and paste this:

Find what is using the most disk space on this Mac. Only read and measure: do not delete, move or change anything. Use du and ls. Give me a table with the folder, its size, what it is, and whether it rebuilds itself if deleted. Mark anything that holds my own work as "keep".

Keep the normal permission prompts on, so that you see each command before it runs.

Check these before you delete anything

  • Does it rebuild itself? Caches, Xcode's DerivedData and node_modules do. Photos, documents and databases do not.
  • Is the app closed? Quit an app before you clear its cache.
  • Is it rm? Files removed with rm do not go to the Bin. Ask for a move to ~/.Trash instead when you are unsure.
  • Is there unsaved work? A project copy can look abandoned and still hold changes you never committed.

What it often misses

Its own leftovers. When coding agents work in parallel, each task can get a full copy of your project, usually in .claude/worktrees. On one of our Macs these copies had reached 80 GB. See them with:

git worktree list
du -sh .claude/worktrees/*

Remove a finished one with git worktree remove <path>, which refuses if anything is unsaved. The full steps are in agent worktrees and disk space.

Old simulators. Xcode keeps every iOS version it downloads. Here is how to delete old simulator runtimes.

Snapshots. If free space does not go up after a clean, run tmutil listlocalsnapshots /. Local Time Machine snapshots hold on to deleted files until they expire.

Saved chats. Old transcripts in ~/.claude/projects can reach many gigabytes. Read what is safe to delete in .claude first.

Do it with Headroom

Headroom for Mac does the looking for you, without prompts or tokens. The scan is free. It lists caches, build folders, duplicates and agent worktrees with a size and a plain explanation for each, and only offers to remove worktrees with nothing unsaved and nothing unmerged. Clearing what you tick is $19 once, for up to 3 Macs. See the price or download Headroom.

Questions

Can Claude Code clean up my Mac?

It can measure folders, explain what they are and delete them if you allow it. Ask it to list first and delete nothing, then approve each item yourself.

Is it safe to let Claude Code delete files?

Only for things that rebuild themselves, such as caches and build folders, and only after you have read the exact command. Files removed with rm skip the Bin, so you cannot put them back.

Why is my Mac still full after Claude Code deleted files?

Local Time Machine snapshots can keep the space of deleted files in use for a while. Run tmutil listlocalsnapshots / to see whether there are any.

Does Claude Code itself use a lot of disk space?

It can. Each parallel task may get its own copy of your project in .claude/worktrees, and saved chats in ~/.claude/projects grow over time.