Opencode ate my storage - and how I fixed it

Brady Stroud
6 March 2026 by Brady Stroud

AI collaboration: This post was drafted with AI support, but the ideas, experiences and opinions are all my own.

I sat down to work and my Mac was basically unusable. Builds failing, apps crashing, the works. I checked storage and had 2.7GB free on a 926GB drive. A few days earlier I had over 400GB available.

macOS System Settings pointed the finger at "Documents" — 614GB. But ~/Documents was only 1.9GB. Something else was going on...

I wasn't sure where to look, so I told Claude the situation and let it cook 🍳

macOS "Documents" Is Misleading

Here's the first realisation: the "Documents" category in System Settings doesn't just mean your Documents folder. It includes ~/Library, all your dotfiles and dotfolders, and basically everything in your home directory that macOS can't categorize as Applications, Developer, Photos, etc.

So when it says "Documents: 614GB", that could be anything.

Hunting Down the Space Hog

Claude started with a top-level sweep of my home directory:

du -d1 -h ~ 2>/dev/null | sort -hr | head -20

Most things looked normal — ~/Library at 103GB (large but expected), ~/Developer at 76GB.

Claude started clearing obvious developer caches first:

ItemSize
NuGet cache (~/.nuget)39 GB
JetBrains caches + logs22 GB
pnpm store~10 GB
npm cache5.3 GB
All node_modules in ~/Developer~22 GB
Misc caches (Homebrew, pip, Graphisoft)~5 GB

This helped a bit but cleary wasn't the root cause. So I told it to keep looking.

Then it found:

427G    /Users/bradystroud/.local

427GB in a hidden folder. That's not normal.

Drilling Down

Claude kept digging:

du -d1 -h ~/.local/share | sort -hr | head -5
427G    /Users/bradystroud/.local/share/opencode

opencode has a snapshot feature that tracks file changes using git under the hood.

du -sh ~/.local/share/opencode/snapshot/* | sort -hr
424G    .../snapshot/global
1.2G    .../snapshot/a36e09...
164M    .../snapshot/17143e...

The global snapshot directory was a bare git repo with 401GB of pack files. It had initialized a .git repo in my home directory and was snapshotting everything (I created this accidentally the day before 🙃) — binaries, caches, node_modules, NuGet packages, the lot.

Once I understood the problem, I thought it was an OpenCode bug. But the more I thought about it, this is mostly my fault for creating a git repo in my home directory and letting OpenCode snapshot it. OpenCode could be smarter about when to snapshot stuff, but this was mostly user error.

The Fix

Straightforward once Claude found the culprit:

# Delete the bloated snapshot
find ~/.local/share/opencode/snapshot/global -type f -delete
find ~/.local/share/opencode/snapshot/global -type d -empty -delete

# Remove the git repo I created in home directory
rm -rf ~/.git

Result: Claude took me from 2.7GB free → 533GB free.

If your Mac suddenly runs out of space and you can't figure out why, just ask Claude.