Find what is filling a Mac disk, including the agent's own leftovers

A Redditor asked Claude Code why their Mac was nearly full and learned that 8.7 GB was 157 Chrome profiles left by Claude's own screenshot scripts, plus an orphaned headless Chrome.

Done withClaude Code· Nov 12, 2026

What they did

A Redditor in r/ClaudeCode saw their Mac had 25 GB free out of 228 and asked Claude Code to find out what was using the space. Earlier sessions had Claude check its own UI work by taking screenshots, and the capture script started Chrome with a fresh temporary profile each time. A week later the disk filled again and the poster had it look a second time.

How it went

The first pass found 157 leftover Chrome profiles, about 8.7 GB, plus a headless Chrome that had run orphaned for 27 hours. The second pass found 439 copies of the Chrome app that macOS makes on each launch. du reported 907 GB, which the disk could not hold; the copies share blocks, so only about 2 GB was real. The poster then added rules: capture scripts keep profiles in one folder and remove them in a finally block, the agent kills any Chrome it started, and it moves files to the trash instead of deleting them.

Worth knowing

None of this showed in a diff or a test. Commenters suggested a SessionEnd hook to clean the temp folder, noting its default time budget is short, and pointed out that temp profiles live under /var/folders and count as System Data. Several warned against letting an agent delete files on its own; have it write a cleanup script you read first.

Try it

With Claude Code· 2 parts to fill in

My [Mac or Linux machine] has only [amount] free. Find what is using the space, starting with temp folders, caches, application support and anything left behind by agent or browser automation runs, such as leftover browser profiles or orphaned headless browsers. Watch for tools that over-count shared or cloned files and report real on-disk size. Give me a ranked list with paths, sizes and what created each one. Do not delete anything. Propose a cleanup script that moves files to the trash, and wait for me to read and approve it.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related