JetBrains IDE caches on Mac: safe to delete?
Where it is
~/Library/Caches/JetBrains~/Library/Logs/JetBrains
What it is
Each JetBrains IDE version keeps a system directory under ~/Library/Caches/JetBrains with project indexes, compiler caches, Local History and other derived data, plus a matching logs folder under ~/Library/Logs/JetBrains.
Why it gets so big
Every IDE and every version gets its own folder, and after an upgrade the old version's caches often stay behind. Indexes for large projects and SDKs are big on their own.
Is it safe to delete?
Yes, with two side effects. The IDE rebuilds its indexes the next time it opens, which can take a while on large projects, and Local History (the IDE's own record of recent file edits) is stored here, so it will be gone. Close your JetBrains IDEs first. Settings and plugins live in Application Support and aren't affected.
Tip
Folders named for IDE versions you no longer run are the easiest win. For the current version, File > Invalidate Caches does a clean reset from inside the IDE.
See how much space it uses
du -sh "$HOME/Library/Caches/JetBrains" "$HOME/Library/Logs/JetBrains" 2>/dev/nullDelete it by hand
Run in Terminal. Deleting cannot be undone, so check the paths first.
rm -rf "$HOME/Library/Caches/JetBrains"/*
rm -rf "$HOME/Library/Logs/JetBrains"/*