See every developer cache on your Mac in one command

diskreceipt is a free, read-only Terminal tool that prints the space Xcode, node_modules, .venv, Docker and package caches use on your Mac, with what's safe to delete and the command for each.

Short answer

Install diskreceipt with brew install abdiraimov-otabek/tap/diskreceipt and run diskreceipt in Terminal. It prints a receipt of the developer caches on your Mac, from Xcode DerivedData, node_modules, Python .venv folders and Docker to the npm, uv, Gradle and Homebrew caches. Each line is labeled safe, check or keep and comes with the official command to clean it. It only reads and never deletes anything.

What diskreceipt is

The Storage screen in System Settings shows developer caches as one large "System Data" number and stops there. diskreceipt is the itemized version: a free, open-source Bash script that weighs about 30 known cache folders and every project folder under your home folder, then prints the result as a thermal receipt.

diskreceipt scanning a Mac, then printing a receipt with node_modules at 7.7 GB, Python .venv at 7.5 GB and a total of 26.8 GB

That's a real run on a developer Mac. The total was 26.8 GB: 47 node_modules folders took 7.7 GB, 17 Python .venv folders took 7.5 GB, and 10.3 GB of it was cache that rebuilds on its own.

Install

With Homebrew:

Terminal
$ brew install abdiraimov-otabek/tap/diskreceipt

Without Homebrew, download the script and make it executable:

Terminal
$ curl -fsSL https://raw.githubusercontent.com/abdiraimov-otabek/diskreceipt/main/diskreceipt -o /usr/local/bin/diskreceipt
$ chmod +x /usr/local/bin/diskreceipt

It's one script with no dependencies, and it runs on the Bash that ships with macOS. Check it with diskreceipt --version. Update it with brew upgrade diskreceipt, and remove it with brew uninstall diskreceipt.

Run your first scan

Terminal
$ diskreceipt

A spinner shows what's being weighed and a running total, so you know it isn't stuck. The known cache folders take a second or two. Searching your home folder for project folders takes most of the time, about 20 seconds on a typical developer Mac. Then the receipt prints line by line, biggest item first.

Press Control-C at any time. Nothing has changed, because diskreceipt only reads.

How to read the receipt

Each item takes two lines. The first has the name, a bar showing its size compared with your biggest item, and the size. A count like ×47 means 47 folders of that kind were found and added up. The second line has the label and how to clean it.

LabelWhat it meansWhat to do
safeA cache. It rebuilds on the next build or install.Clean it whenever you need the space.
checkComes back, but only after a reinstall.Clean it for projects you no longer work on.
keepYour own files. They don't come back.Only delete them if you're sure, by hand.

Below the items, TOTAL adds up every line. of which safe to clean adds up only the safe ones. FREE SPACE LEFT is the free space on your startup disk.

A project folder only counts when its marker file sits next to it: package.json for node_modules, Cargo.toml for target/, Package.swift for .build and Podfile for Pods/. A random folder called target is ignored, and nested node_modules are counted once.

Clean the quick wins first

The receipt ends with QUICK WINS: the three biggest safe items that have an official one-line command, ready to paste. On the Mac above they were:

Terminal
$ uv cache prune
$ npm cache npx rm
$ npx @puppeteer/browsers clear

Together they were worth up to 6.8 GB. It says "up to" because some commands, like uv cache prune, only remove the parts no project uses.

Safe

Quick wins only ever include safe items, caches that the tool which made them rebuilds on its own. The cost is a slower first build or install afterwards.

After that, work through the rest of the receipt by tool. Each one has its own guide:

Check first

check items like node_modules and .venv come back only when you reinstall. Remove them for projects you've finished with, not the one you're working on today.

Run diskreceipt again afterwards to see the new total.

Scan less, scan faster

You wantRun
Global caches only, about 1 seconddiskreceipt --no-projects
Only the projects in one folderdiskreceipt --root ~/code
A shallower project searchdiskreceipt --depth 3
The receipt at once, no animationdiskreceipt --no-anim
No colorsdiskreceipt --no-color

--depth counts folder levels below --root (6 by default). The project search always skips ~/Library, the Trash, .git, .cache, .npm and .cargo, because the caches inside those are already on the known-cache list.

Keep a history

When you redirect the receipt to a file, it's plain text with no colors and no animation:

Terminal
$ mkdir -p ~/receipts
$ diskreceipt > ~/receipts/$(date +%F).txt

Save one a month and compare two of them with diff to see which caches grow back fastest. To print only the total, run diskreceipt --no-projects | grep '^TOTAL'.

Troubleshooting

The scan seems slow. Almost all the time goes into the project search. Narrow it with --root ~/code or --depth 3, or skip it with --no-projects.

A folder you know about is missing. Check these in order:

  1. Items under 1 MB are left off.
  2. A project folder needs its marker file next to it.
  3. It may sit deeper than --depth, or outside --root.

The sizes don't match Finder. diskreceipt uses du, which counts disk blocks in use. Finder can show the logical size, which is larger for sparse files like Docker's disk image. du is closer to what deleting would actually free.

macOS asks whether Terminal can access data from other apps. That can happen when diskreceipt measures Docker Desktop's disk image, which lives in Docker's app container. If you deny it, the Docker line is left off and everything else still works.

Want it cleaned, not just counted?Shedi finds the same caches, explains every item, pre-selects only the safe ones and moves them to the Trash first.
Get Shedi

Sources

Questions

Does diskreceipt delete anything?

No. It only measures with du and find, and prints the official command to clean each item. It never deletes, moves or changes a file, and it makes no network calls.

How long does a scan take?

The known cache folders take a second or two. Searching your home folder for node_modules, target, .build, Pods and .venv folders takes most of the time, about 20 seconds on a typical developer Mac. diskreceipt --no-projects skips that search and finishes in about a second.

What do safe, check and keep mean?

Safe is a cache that rebuilds on the next build or install. Check comes back, but only after you reinstall, like node_modules or a .venv. Keep is your own files, like Xcode Archives and Android emulators, which don't come back.

Why are the sizes different from Finder?

diskreceipt uses du, which counts the disk blocks actually in use. Finder can show the logical size instead, which differs for sparse files like Docker's disk image and for APFS clones. du is closer to what deleting the item would free.