<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sergey Nikiforov</title>
    <description>The latest articles on Forem by Sergey Nikiforov (@nixeton).</description>
    <link>https://forem.com/nixeton</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2966408%2Fc42318c5-aa2f-435c-89a1-ad4424688dc1.png</url>
      <title>Forem: Sergey Nikiforov</title>
      <link>https://forem.com/nixeton</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nixeton"/>
    <language>en</language>
    <item>
      <title>I Scanned My MacBook and Found 127GB of Developer Junk. Here's What It Was</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:51:21 +0000</pubDate>
      <link>https://forem.com/nixeton/i-scanned-my-macbook-and-found-127gb-of-developer-junk-heres-what-it-was-12cf</link>
      <guid>https://forem.com/nixeton/i-scanned-my-macbook-and-found-127gb-of-developer-junk-heres-what-it-was-12cf</guid>
      <description>&lt;p&gt;Last week I ran &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; on my development MacBook for the first time in months. It found 127GB of junk. Not "maybe junk" — actual build artifacts, stale caches, and orphaned data from tools I use every day.&lt;/p&gt;

&lt;p&gt;My 512GB drive had 47GB free. After cleaning, I had 168GB free. That's a quarter of my entire disk reclaimed.&lt;/p&gt;

&lt;p&gt;Here's the full breakdown of what was hiding on my machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Scan Results
&lt;/h2&gt;

&lt;p&gt;MegaCleaner scans 29 categories (21 developer tools + 8 general system categories). On my machine, almost everything had something to report. Here's what it found, from largest to smallest.&lt;/p&gt;

&lt;h3&gt;
  
  
  Xcode DerivedData + Simulators — 42GB
&lt;/h3&gt;

&lt;p&gt;This is always the big one. I do iOS work across several projects, and Xcode is relentless about caching.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DerivedData:&lt;/strong&gt; 16GB across about 30 project folders, most of which I haven't opened in months. Xcode never cleans these up. Ever.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Old simulator runtimes:&lt;/strong&gt; 19GB. I had iOS 17.2, 17.5, and 18.0 runtimes still installed. I'm building against iOS 18.4 now. Those are dead weight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Device support files:&lt;/strong&gt; 5GB. Debug symbol caches from old iOS versions on devices I connected once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stale archives:&lt;/strong&gt; 2GB. Old .xcarchive bundles from builds I submitted to App Store Connect months ago.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DerivedData alone is the single easiest win on any developer's Mac. It rebuilds automatically. There's zero risk in deleting it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Images and Build Cache — 31GB
&lt;/h3&gt;

&lt;p&gt;Docker Desktop on macOS stores everything inside a single &lt;code&gt;Docker.raw&lt;/code&gt; disk image, which makes it invisible to most disk analyzers. You have to actually query Docker to see what's inside.&lt;/p&gt;

&lt;p&gt;My breakdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unused images:&lt;/strong&gt; 18GB. Old base images, intermediate layers from builds I ran weeks ago, images for projects I'm no longer working on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build cache:&lt;/strong&gt; 11GB. Docker keeps every build layer cached. Great for rebuild speed, terrible for disk space when you have dozens of Dockerfiles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stopped containers and dangling volumes:&lt;/strong&gt; 2GB. Easy to forget about.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The thing about Docker is that &lt;code&gt;docker system prune&lt;/code&gt; exists, but most people never run it. And even when they do, it doesn't remove images that still have tags. You need &lt;code&gt;docker system prune -a&lt;/code&gt; for that, and most people are (reasonably) nervous about running it.&lt;/p&gt;

&lt;h3&gt;
  
  
  node_modules Across 23 Projects — 18GB
&lt;/h3&gt;

&lt;p&gt;This one is a classic. I counted 23 separate &lt;code&gt;node_modules&lt;/code&gt; directories on my machine. Some of them were in projects I haven't touched in over a year.&lt;/p&gt;

&lt;p&gt;The average &lt;code&gt;node_modules&lt;/code&gt; directory was about 780MB. The largest was 2.1GB — a Next.js project with a heavy dependency tree including Playwright browsers.&lt;/p&gt;

&lt;p&gt;Here's the thing: &lt;code&gt;node_modules&lt;/code&gt; is fully reproducible. &lt;code&gt;npm install&lt;/code&gt; or &lt;code&gt;yarn install&lt;/code&gt; recreates it from the lockfile. There is no reason to keep &lt;code&gt;node_modules&lt;/code&gt; for a project you're not actively working on today. None.&lt;/p&gt;

&lt;p&gt;I kept 4 (active projects). Deleted 19.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rust target/ Directories — 14GB
&lt;/h3&gt;

&lt;p&gt;Rust compile artifacts are large. This is well-known in the Rust community — a single project's &lt;code&gt;target/&lt;/code&gt; directory can hit 5-10GB easily, especially in debug mode.&lt;/p&gt;

&lt;p&gt;I had 6 Rust projects. Two of them I'm actively developing. The other four had &lt;code&gt;target/&lt;/code&gt; folders sitting there doing nothing, totaling about 10GB. Even for the active projects, the &lt;code&gt;target/debug&lt;/code&gt; directories had artifacts from dependencies I'd since removed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cargo clean&lt;/code&gt; exists but you have to run it per-project. And you have to remember.&lt;/p&gt;

&lt;h3&gt;
  
  
  Python Conda Environments — 9GB
&lt;/h3&gt;

&lt;p&gt;I keep conda around for ML experiments. The problem is that conda environments are self-contained — each one bundles its own copy of Python plus every dependency. That's great for isolation, terrible for disk space.&lt;/p&gt;

&lt;p&gt;I had 5 conda environments. Two were from experiments I ran once in late 2025 and never looked at again. Each environment was about 2GB. The pip cache added another 2GB on top.&lt;/p&gt;

&lt;h3&gt;
  
  
  Homebrew Cache — 4GB
&lt;/h3&gt;

&lt;p&gt;Every time Homebrew installs or upgrades a package, it downloads the source/bottle and caches it. These caches stick around indefinitely. &lt;code&gt;brew cleanup&lt;/code&gt; is supposed to help, but I hadn't run it in 4 months.&lt;/p&gt;

&lt;p&gt;4GB isn't dramatic, but it's free money — there's no reason to keep old Homebrew downloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  IDE Caches (VS Code, JetBrains) — 3GB
&lt;/h3&gt;

&lt;p&gt;I use VS Code daily and occasionally fire up a JetBrains IDE for Java work. Both cache aggressively.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VS Code extensions, workspace storage, cached data: 1.8GB&lt;/li&gt;
&lt;li&gt;JetBrains system caches and local history: 1.2GB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing critical in any of it. IDE caches rebuild seamlessly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser Caches — 2GB
&lt;/h3&gt;

&lt;p&gt;Chrome and Arc combined. Not developer-specific, but it all counts. These regenerate automatically as you browse.&lt;/p&gt;

&lt;h3&gt;
  
  
  System Caches and Logs — 4GB
&lt;/h3&gt;

&lt;p&gt;macOS system logs, crash reports, temporary files, expired caches under &lt;code&gt;~/Library/Caches&lt;/code&gt;. The kind of stuff that accumulates silently on every Mac, developer or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Surprises
&lt;/h2&gt;

&lt;p&gt;A few things caught me off guard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker was bigger than I expected.&lt;/strong&gt; I knew I had some images lying around, but 31GB? I had mentally budgeted for maybe 10-15GB. The build cache was the hidden killer — I didn't realize how much Docker was hoarding in layer cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rust's target/ directories were surprisingly large for such few projects.&lt;/strong&gt; Six projects, 14GB. That's over 2GB average per project. Debug builds in Rust are aggressively unoptimized (intentionally — for faster compile times), which means the artifacts are huge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Xcode was not a surprise.&lt;/strong&gt; Anyone who's done iOS development for more than a year knows DerivedData is a storage black hole. The simulators were the real problem — 19GB for runtimes I'll never use again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;node_modules was exactly what I expected&lt;/strong&gt; — which is its own kind of sad. We've all accepted that JavaScript projects casually consume a gigabyte of disk space each. It doesn't have to be that way (keeping them around for stale projects, I mean).&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Cleaned vs. What I Kept
&lt;/h2&gt;

&lt;p&gt;This is where MegaCleaner's confidence levels were useful. Every item it finds is tagged with a confidence level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definite&lt;/strong&gt; — 100% safe to delete. Caches, build artifacts, derived data. Regenerates automatically on next use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Probable&lt;/strong&gt; — Very likely safe. Old archives, stale environments, unused images. Check if you're unsure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Possible&lt;/strong&gt; — Worth reviewing first. Things like large unknown files or old Xcode versions that might still be needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I cleaned everything marked "definite" without hesitation — that was about 95GB. For "probable" items, I skimmed the list and cleaned most of them (another 26GB). The few "possible" items (6GB) I reviewed individually and cleaned about half.&lt;/p&gt;

&lt;p&gt;Total cleaned: &lt;strong&gt;~121GB&lt;/strong&gt; out of the 127GB found.&lt;/p&gt;

&lt;p&gt;What I kept:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DerivedData for 2 active Xcode projects (rebuild takes 8 minutes each)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;node_modules&lt;/code&gt; for 4 active projects&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;target/&lt;/code&gt; for 2 active Rust projects&lt;/li&gt;
&lt;li&gt;My current conda environment for an ongoing ML project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else went to Trash. (MegaCleaner moves to Trash, not permanent delete — so you can always undo if something feels wrong.)&lt;/p&gt;

&lt;h2&gt;
  
  
  The Before and After
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Used space&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;465 GB&lt;/td&gt;
&lt;td&gt;344 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Free space&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;47 GB&lt;/td&gt;
&lt;td&gt;168 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cleaned&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;121 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I went from "I need to buy a new laptop" to "I'm fine for another year."&lt;/p&gt;

&lt;p&gt;A 512GB drive with 47GB free is stress. You're getting macOS warnings, Docker complains, Xcode builds fail because there's no room for intermediate files. At 168GB free, everything just works again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Built MegaCleaner
&lt;/h2&gt;

&lt;p&gt;I used to do this manually. Every few months, when my disk got uncomfortably full, I'd open Terminal and start running commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/DerivedData/&lt;span class="k"&gt;*&lt;/span&gt;
docker system prune &lt;span class="nt"&gt;-a&lt;/span&gt;
find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5
&lt;span class="c"&gt;# ...and so on, for 20 minutes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem isn't that it's hard. Each command is simple. The problem is that it's tedious, you have to remember all the paths, and you inevitably forget something. I'd clean up 40GB, feel good, and then three months later realize Docker build cache had quietly grown to 15GB again.&lt;/p&gt;

&lt;p&gt;So I automated it. First as a script for myself, then as a proper macOS app with a UI, safety checks, and the ability to see everything in one scan.&lt;/p&gt;

&lt;p&gt;That became &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;The scan is free. You can download MegaCleaner, run it, and see exactly how much space your dev tools are wasting — no purchase required.&lt;/p&gt;

&lt;p&gt;If you want to actually clean, it's $49 one-time. Not a subscription. You buy it once, it's yours.&lt;/p&gt;

&lt;p&gt;Given that a 512GB to 1TB MacBook upgrade costs Apple $200, reclaiming 100+ GB for $49 is a decent deal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;Download MegaCleaner&lt;/a&gt; — free scan, see what your Mac is hiding.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Sergey — I build developer tools at &lt;a href="https://morcolabs.com" rel="noopener noreferrer"&gt;Morco Labs&lt;/a&gt;. MegaCleaner is a native macOS app, built in Swift, no Electron, no subscriptions. If you have questions or feedback, find me on &lt;a href="https://x.com/nixeton" rel="noopener noreferrer"&gt;Twitter/X&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Cargo Target Directories: Why Rust Projects Eat 10GB Each</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:49:00 +0000</pubDate>
      <link>https://forem.com/nixeton/cargo-target-directories-why-rust-projects-eat-10gb-each-26kd</link>
      <guid>https://forem.com/nixeton/cargo-target-directories-why-rust-projects-eat-10gb-each-26kd</guid>
      <description>&lt;p&gt;Each Rust project's &lt;code&gt;target/&lt;/code&gt; directory can easily hit 5-15GB. If you have 10 projects on your machine, that's 50-150GB of disk space consumed by build artifacts alone. On a 256GB or 512GB MacBook, that's a significant chunk of your drive gone to compiled code you probably aren't actively using.&lt;/p&gt;

&lt;p&gt;This isn't a bug. It's a direct consequence of how Rust's compilation model works — and once you understand the mechanics, you can make informed decisions about what to clean and how to prevent the bloat from coming back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Rust Builds Are So Large
&lt;/h2&gt;

&lt;p&gt;Rust's compilation strategy optimizes for correctness and runtime performance at the cost of disk space. Several factors compound to produce those multi-gigabyte &lt;code&gt;target/&lt;/code&gt; directories.&lt;/p&gt;

&lt;h3&gt;
  
  
  Debug Info
&lt;/h3&gt;

&lt;p&gt;By default, &lt;code&gt;cargo build&lt;/code&gt; produces a debug build. The compiler embeds full DWARF debug information into every binary and library artifact — function names, variable locations, type definitions, line number mappings. This debug info alone can double or triple the size of a compiled artifact compared to what the actual machine code requires.&lt;/p&gt;

&lt;p&gt;A simple "hello world" debug binary is around 3-4MB. A real application with a handful of dependencies? Easily 50-200MB for the final binary, plus all the intermediate artifacts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Incremental Compilation
&lt;/h3&gt;

&lt;p&gt;Rust's incremental compilation keeps fine-grained intermediate results from previous builds so that recompilation only touches changed code. This is essential for fast iteration — without it, even a one-line change in a large project could mean a full rebuild taking several minutes.&lt;/p&gt;

&lt;p&gt;The trade-off: these incremental artifacts live in &lt;code&gt;target/debug/incremental/&lt;/code&gt; and can grow to several gigabytes per project. Each code change produces new incremental snapshots, and old ones aren't garbage collected aggressively.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dependency Compilation
&lt;/h3&gt;

&lt;p&gt;When you &lt;code&gt;cargo build&lt;/code&gt;, the compiler doesn't just compile your code — it compiles every one of your dependencies from source. A typical Rust project with 100-300 transitive dependencies (check yours with &lt;code&gt;cargo tree | wc -l&lt;/code&gt;) will compile each of those crates and store the resulting &lt;code&gt;.rlib&lt;/code&gt; files, metadata, and build script outputs in &lt;code&gt;target/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Unlike languages with precompiled package distributions (Python wheels, npm prebuilds), Rust compiles everything locally. This means your &lt;code&gt;target/&lt;/code&gt; directory contains compiled output for every crate in your dependency tree.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple Build Profiles and Targets
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;target/&lt;/code&gt; directory grows further if you use multiple build configurations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;target/debug/&lt;/code&gt; — your default &lt;code&gt;cargo build&lt;/code&gt; output&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;target/release/&lt;/code&gt; — &lt;code&gt;cargo build --release&lt;/code&gt; output (separate compilation, separate artifacts)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;target/&amp;lt;triple&amp;gt;/&lt;/code&gt; — cross-compilation targets like &lt;code&gt;aarch64-apple-darwin&lt;/code&gt; or &lt;code&gt;wasm32-unknown-unknown&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each profile and target combination gets its own full set of compiled artifacts. If you cross-compile for two targets in both debug and release mode, you have four complete copies of your dependency tree.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Exactly the Space Goes
&lt;/h2&gt;

&lt;p&gt;Let's break down every location where Cargo stores data on your machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Per-Project: &lt;code&gt;target/debug/&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is the primary build output for &lt;code&gt;cargo build&lt;/code&gt;. It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;deps/&lt;/code&gt;&lt;/strong&gt; — compiled &lt;code&gt;.rlib&lt;/code&gt; and &lt;code&gt;.rmeta&lt;/code&gt; files for every dependency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;build/&lt;/code&gt;&lt;/strong&gt; — output from build scripts (&lt;code&gt;build.rs&lt;/code&gt;), including generated code and compiled C dependencies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;incremental/&lt;/code&gt;&lt;/strong&gt; — incremental compilation cache (often the largest subdirectory)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.fingerprint/&lt;/code&gt;&lt;/strong&gt; — hashes Cargo uses to determine if a crate needs recompilation&lt;/li&gt;
&lt;li&gt;The final binary or library artifact itself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Typical size:&lt;/strong&gt; 2-10GB per project, depending on dependency count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Safe to delete?&lt;/strong&gt; Yes. Running &lt;code&gt;cargo build&lt;/code&gt; regenerates everything. You lose cached compilation, so your next build will be a full rebuild.&lt;/p&gt;

&lt;h3&gt;
  
  
  Per-Project: &lt;code&gt;target/release/&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Same structure as &lt;code&gt;debug/&lt;/code&gt;, but for &lt;code&gt;cargo build --release&lt;/code&gt;. Release builds have different trade-offs: no debug info by default, full optimization passes, but the intermediate artifacts still take significant space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typical size:&lt;/strong&gt; 1-5GB per project. Often smaller than debug due to lack of debug info, but optimized artifacts can be larger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Safe to delete?&lt;/strong&gt; Yes, same as debug.&lt;/p&gt;

&lt;h3&gt;
  
  
  Global: &lt;code&gt;~/.cargo/registry/&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is Cargo's global package registry cache. It has two main subdirectories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;registry/cache/&lt;/code&gt;&lt;/strong&gt; — compressed &lt;code&gt;.crate&lt;/code&gt; files downloaded from crates.io. These are the raw downloaded packages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;registry/src/&lt;/code&gt;&lt;/strong&gt; — extracted source code from those &lt;code&gt;.crate&lt;/code&gt; files. Cargo extracts sources here before compiling them into your project's &lt;code&gt;target/&lt;/code&gt; directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The registry is shared across all your projects — if ten projects depend on &lt;code&gt;serde&lt;/code&gt;, Cargo downloads and extracts it once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typical size:&lt;/strong&gt; 1-5GB, depending on how many unique crates you've used across all projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Safe to delete?&lt;/strong&gt; Yes. Cargo re-downloads crates as needed. Deleting &lt;code&gt;registry/cache/&lt;/code&gt; forces re-download; deleting &lt;code&gt;registry/src/&lt;/code&gt; forces re-extraction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Global: &lt;code&gt;~/.cargo/git/&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;When your &lt;code&gt;Cargo.toml&lt;/code&gt; specifies a git dependency (&lt;code&gt;git = "https://github.com/..."&lt;/code&gt; instead of a version from crates.io), Cargo clones the repository here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git/db/&lt;/code&gt;&lt;/strong&gt; — bare git repositories (the full clone)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git/checkouts/&lt;/code&gt;&lt;/strong&gt; — checked-out working copies at specific commits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Typical size:&lt;/strong&gt; 500MB-5GB, depending on how many git dependencies you use. Some large git dependencies (like forks of big frameworks) can add gigabytes on their own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Safe to delete?&lt;/strong&gt; Yes. Cargo re-clones as needed. You'll pay the download cost again, but nothing is lost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cleanup Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Per-Project: &lt;code&gt;cargo clean&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The simplest approach. Run this from any Rust project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes the entire &lt;code&gt;target/&lt;/code&gt; directory for that project. Your next &lt;code&gt;cargo build&lt;/code&gt; will be a full rebuild from scratch.&lt;/p&gt;

&lt;p&gt;To clean only release artifacts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo clean &lt;span class="nt"&gt;--release&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Registry Cache
&lt;/h3&gt;

&lt;p&gt;Remove the global registry cache (all downloaded crate files):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.cargo/registry/cache
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.cargo/registry/src
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;registry/index&lt;/code&gt; directory contains the crates.io index — you can delete it too, but it's smaller and takes time to re-download.&lt;/p&gt;

&lt;p&gt;To clean git caches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.cargo/git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Finding All Target Directories
&lt;/h3&gt;

&lt;p&gt;The real problem isn't one project — it's the ten projects scattered across your filesystem that you haven't touched in months. Find them all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"target"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 | &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;read dir&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$dir&lt;/span&gt;&lt;span class="s2"&gt;/../Cargo.toml"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$dir&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-f1&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$size&lt;/span&gt;&lt;span class="s2"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;$dir&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;fi
done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This finds &lt;code&gt;target/&lt;/code&gt; directories that are actually Rust projects (verified by the presence of &lt;code&gt;Cargo.toml&lt;/code&gt; in the parent directory) and shows their sizes. Review the output, then clean the ones you want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clean a specific project without cd-ing into it&lt;/span&gt;
cargo clean &lt;span class="nt"&gt;--manifest-path&lt;/span&gt; /path/to/project/Cargo.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  cargo-sweep: Time-Based Cleanup
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/holmgr/cargo-sweep" rel="noopener noreferrer"&gt;cargo-sweep&lt;/a&gt; is a community tool that removes build artifacts older than a specified number of days, keeping your recent work intact:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;cargo-sweep

&lt;span class="c"&gt;# Remove artifacts older than 30 days (run from project root)&lt;/span&gt;
cargo sweep &lt;span class="nt"&gt;--time&lt;/span&gt; 30

&lt;span class="c"&gt;# Or stamp current artifacts, then later sweep unstamped ones&lt;/span&gt;
cargo sweep &lt;span class="nt"&gt;--stamp&lt;/span&gt;
&lt;span class="c"&gt;# ... work on the project ...&lt;/span&gt;
cargo sweep &lt;span class="nt"&gt;--file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is more surgical than &lt;code&gt;cargo clean&lt;/code&gt; — it preserves incremental compilation cache for code you're actively working on while removing artifacts for features or dependencies you changed weeks ago.&lt;/p&gt;

&lt;p&gt;To sweep across all projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"Cargo.toml"&lt;/span&gt; &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 | &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;read &lt;/span&gt;manifest&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nv"&gt;project_dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;dirname&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$manifest&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$project_dir&lt;/span&gt;&lt;span class="s2"&gt;/target"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Sweeping &lt;/span&gt;&lt;span class="nv"&gt;$project_dir&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    cargo sweep &lt;span class="nt"&gt;--time&lt;/span&gt; 30 &lt;span class="nt"&gt;--manifest-path&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$manifest&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;fi
done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Shared Target Directory Trick
&lt;/h2&gt;

&lt;p&gt;If you work on multiple Rust projects, you can point them all at a single shared &lt;code&gt;target/&lt;/code&gt; directory using the &lt;code&gt;CARGO_TARGET_DIR&lt;/code&gt; environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add to your ~/.zshrc or ~/.bashrc&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CARGO_TARGET_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.cargo-target"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or set it in &lt;code&gt;~/.cargo/config.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[build]&lt;/span&gt;
&lt;span class="py"&gt;target-dir&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"/Users/yourname/.cargo-target"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; All projects compile into the same directory. Shared dependencies are compiled once and reused across projects — if five projects depend on &lt;code&gt;tokio&lt;/code&gt;, it's compiled once instead of five times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What this saves:&lt;/strong&gt; Potentially 50-70% of total target directory space if your projects share many dependencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The caveat:&lt;/strong&gt; You can no longer &lt;code&gt;cargo clean&lt;/code&gt; a single project without wiping artifacts for all projects. This trade-off works best if you have many small projects with overlapping dependency trees. You can also set this per-project in &lt;code&gt;.cargo/config.toml&lt;/code&gt; at the project root for monorepo setups.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Automated Way
&lt;/h2&gt;

&lt;p&gt;Manual cleanup works, but it's tedious. Most developers do this once every few months when they get a "disk full" warning — by which point 50-100GB of stale build artifacts have accumulated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; automates this with a dedicated Rust scanner. It searches your configured project directories for &lt;code&gt;target/&lt;/code&gt; folders alongside &lt;code&gt;Cargo.toml&lt;/code&gt; files, and separately finds your global Cargo caches at &lt;code&gt;~/.cargo/registry/&lt;/code&gt; and &lt;code&gt;~/.cargo/git/&lt;/code&gt;. Each location is sized and presented individually so you can review before cleaning.&lt;/p&gt;

&lt;p&gt;The scanner has two sub-features you can toggle independently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cargo&lt;/strong&gt; — finds and sizes your &lt;code&gt;~/.cargo/registry&lt;/code&gt; and &lt;code&gt;~/.cargo/git&lt;/code&gt; caches&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build Output&lt;/strong&gt; — discovers every &lt;code&gt;target/&lt;/code&gt; directory in your projects, reads the project name from &lt;code&gt;Cargo.toml&lt;/code&gt;, and reports the size&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also checks staleness by examining the last-modified dates of source files (&lt;code&gt;.rs&lt;/code&gt;, &lt;code&gt;.toml&lt;/code&gt;, &lt;code&gt;.json&lt;/code&gt;, &lt;code&gt;.yaml&lt;/code&gt;, &lt;code&gt;.yml&lt;/code&gt;) in each project. If you haven't touched a project's source code in a while, MegaCleaner flags that &lt;code&gt;target/&lt;/code&gt; directory as stale and pre-selects it for cleanup. Projects you're actively working on are left unselected by default.&lt;/p&gt;

&lt;p&gt;Rust is just one of MegaCleaner's 29 scanners (21 developer-focused, 8 general). It handles Node.js &lt;code&gt;node_modules&lt;/code&gt;, Xcode DerivedData, Python virtual environments, Docker images, and more — all the caches that quietly consume your disk across different tech stacks. One-time purchase, $49, native macOS app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Reference
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;What It Stores&lt;/th&gt;
&lt;th&gt;Typical Size&lt;/th&gt;
&lt;th&gt;Cleanup Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;project&amp;gt;/target/debug/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Debug build artifacts, incremental cache&lt;/td&gt;
&lt;td&gt;2-10 GB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cargo clean&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;project&amp;gt;/target/release/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Release build artifacts&lt;/td&gt;
&lt;td&gt;1-5 GB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cargo clean --release&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~/.cargo/registry/cache/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Downloaded &lt;code&gt;.crate&lt;/code&gt; files&lt;/td&gt;
&lt;td&gt;500 MB-2 GB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rm -rf ~/.cargo/registry/cache&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~/.cargo/registry/src/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Extracted crate source code&lt;/td&gt;
&lt;td&gt;500 MB-3 GB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rm -rf ~/.cargo/registry/src&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~/.cargo/git/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Git dependency clones&lt;/td&gt;
&lt;td&gt;500 MB-5 GB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rm -rf ~/.cargo/git&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Total across 10 projects: 30-150+ GB&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Everything in this table is safe to delete. Cargo rebuilds and re-downloads automatically. The only cost is time — a full rebuild of a large project might take 5-10 minutes, and re-downloading dependencies requires an internet connection.&lt;/p&gt;

&lt;p&gt;For ongoing maintenance, pick one approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manual:&lt;/strong&gt; Run &lt;code&gt;cargo clean&lt;/code&gt; on projects you haven't touched in a month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cargo-sweep:&lt;/strong&gt; &lt;code&gt;cargo sweep --time 30&lt;/code&gt; for time-based cleanup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared target:&lt;/strong&gt; &lt;code&gt;CARGO_TARGET_DIR&lt;/code&gt; to deduplicate dependencies across projects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated:&lt;/strong&gt; &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; to scan, size, and clean everything with staleness detection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your Mac's SSD is too valuable for build artifacts from six months ago. Reclaim it.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>rust</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Don't Let Conda Eat Your Hard Drive: Python Environment Cleanup for Mac</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:36:53 +0000</pubDate>
      <link>https://forem.com/nixeton/dont-let-conda-eat-your-hard-drive-python-environment-cleanup-for-mac-1oi8</link>
      <guid>https://forem.com/nixeton/dont-let-conda-eat-your-hard-drive-python-environment-cleanup-for-mac-1oi8</guid>
      <description>&lt;p&gt;My Anaconda installation was 28GB. I had 12 conda environments I'd forgotten about — one for every tutorial I'd followed, every Kaggle competition I'd started and abandoned, every "let me just try this library real quick" session. Each one had its own copy of NumPy, pandas, and scikit-learn. Three of them had PyTorch installed. That's 2-3GB per copy, sitting in folders I hadn't touched in months.&lt;/p&gt;

&lt;p&gt;If you do any data science or ML work on a Mac, you've been there. Python's environment model is designed to keep things isolated — and it does, by duplicating everything. That isolation comes at a cost: disk space, and lots of it.&lt;/p&gt;

&lt;p&gt;This guide covers every place Python stores things on macOS, how big each category typically gets, and how to clean them safely — whether you do it manually or let a tool handle it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Reference
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Typical Size&lt;/th&gt;
&lt;th&gt;Safe to Delete?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Conda environments&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;~/anaconda3/envs/&lt;/code&gt; or &lt;code&gt;~/miniconda3/envs/&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;2-30 GB&lt;/td&gt;
&lt;td&gt;Yes (except active ones)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Conda pkgs cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/anaconda3/pkgs/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2-10 GB&lt;/td&gt;
&lt;td&gt;Yes — &lt;code&gt;conda clean --all&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pip cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Caches/pip/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0.5-5 GB&lt;/td&gt;
&lt;td&gt;Yes — &lt;code&gt;pip cache purge&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Virtual envs (.venv)&lt;/td&gt;
&lt;td&gt;Scattered across projects&lt;/td&gt;
&lt;td&gt;1-15 GB total&lt;/td&gt;
&lt;td&gt;Yes (recreatable)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pyenv versions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.pyenv/versions/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1-5 GB&lt;/td&gt;
&lt;td&gt;Yes (except active ones)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Poetry cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Caches/pypoetry/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0.5-3 GB&lt;/td&gt;
&lt;td&gt;Yes — &lt;code&gt;poetry cache clear --all&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uv cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.cache/uv/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0.5-5 GB&lt;/td&gt;
&lt;td&gt;Yes — &lt;code&gt;uv cache clean&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;pycache&lt;/strong&gt; / .pyc&lt;/td&gt;
&lt;td&gt;Inside every project&lt;/td&gt;
&lt;td&gt;10-500 MB total&lt;/td&gt;
&lt;td&gt;Yes — always safe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool caches&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;.ruff_cache&lt;/code&gt;, &lt;code&gt;.mypy_cache&lt;/code&gt;, &lt;code&gt;.pytest_cache&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;10-200 MB total&lt;/td&gt;
&lt;td&gt;Yes — always safe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tox environments&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.tox/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0.5-5 GB&lt;/td&gt;
&lt;td&gt;Yes — regenerated on next run&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Total potential savings: 10-50+ GB&lt;/strong&gt; depending on how many projects and environments you've accumulated.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Python Environments Get So Large
&lt;/h2&gt;

&lt;p&gt;Every virtual environment or conda environment is a self-contained copy of a Python interpreter plus all its packages. Nothing is shared between environments. Great for reproducibility. Terrible for disk space.&lt;/p&gt;

&lt;p&gt;Here's why it adds up so fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PyTorch:&lt;/strong&gt; 2-3 GB per installation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TensorFlow:&lt;/strong&gt; 1-2 GB per installation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NumPy + SciPy + pandas + scikit-learn:&lt;/strong&gt; ~500 MB as a stack&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jupyter + its dependencies:&lt;/strong&gt; ~300 MB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conda base environment:&lt;/strong&gt; 3-5 GB before you install anything extra&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Five conda environments with a ML framework plus the standard data science stack? That's 15-25 GB just in environments. Add caches, and you're at 20-40 GB of Python data on your machine.&lt;/p&gt;

&lt;p&gt;The problem compounds because environments accumulate. You create one for a project, move on, forget about it. A year later, you have a dozen environments and no idea which ones matter.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Conda Environments
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The biggest offender.&lt;/strong&gt; Each conda environment is a full, isolated Python installation with its own packages. A single ML-focused environment can be 3-8 GB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where they live:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/anaconda3/envs/
~/miniconda3/envs/
~/opt/anaconda3/envs/
~/miniforge3/envs/
~/mambaforge/envs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact path depends on which distribution you installed and how you installed it. If you're not sure, check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env &lt;/span&gt;list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows every environment and its path. You'll probably be surprised by how many there are.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean them:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, identify which environments you actually use. Anything you haven't touched in 3+ months is probably safe to remove.&lt;/p&gt;

&lt;p&gt;Remove a specific environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-n&lt;/span&gt; old-project-env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove multiple environments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-n&lt;/span&gt; kaggle-titanic
conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-n&lt;/span&gt; nlp-tutorial
conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-n&lt;/span&gt; test-env-2024
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What to keep:&lt;/strong&gt; Don't remove &lt;code&gt;base&lt;/code&gt; — it's your main conda installation. Keep any environment that belongs to an active project, especially if it has a complex dependency setup that took time to get working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big are they?&lt;/strong&gt; Check individual environment sizes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/anaconda3/envs/&lt;span class="k"&gt;*&lt;/span&gt; 2&amp;gt;/dev/null
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/miniconda3/envs/&lt;span class="k"&gt;*&lt;/span&gt; 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. Conda Package Cache
&lt;/h2&gt;

&lt;p&gt;Even after deleting environments, conda keeps a cache of every package it has ever downloaded. This cache lives inside your conda installation directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it lives:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/anaconda3/pkgs/
~/miniconda3/pkgs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda clean &lt;span class="nt"&gt;--all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cached package tarballs&lt;/li&gt;
&lt;li&gt;Extracted packages no longer linked to any environment&lt;/li&gt;
&lt;li&gt;Index cache&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's completely safe. Conda will re-download any package it needs next time you create an environment or install something.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typical savings:&lt;/strong&gt; 2-10 GB, depending on how long you've been using conda.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. pip Cache
&lt;/h2&gt;

&lt;p&gt;Every time you &lt;code&gt;pip install&lt;/code&gt; something, pip downloads the wheel or sdist and caches it locally. This speeds up future installs, but the cache grows indefinitely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it lives on macOS:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Library/Caches/pip/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(On Linux it's &lt;code&gt;~/.cache/pip/&lt;/code&gt; — if you see that path in tutorials, the macOS equivalent is the Library path above.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip cache purge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Caches/pip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Typical savings:&lt;/strong&gt; 0.5-5 GB. If you install a lot of packages with native extensions (like numpy, scipy, torch), the cache tends to be larger because those wheels are big.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Completely. The cache only speeds up reinstallation — pip will re-download anything it needs.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Virtual Environments (.venv, venv, env)
&lt;/h2&gt;

&lt;p&gt;Unlike conda environments, which live in a central location, Python virtual environments are typically created inside project directories. This makes them easy to forget about — they're scattered across your filesystem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common locations:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/projects/my-app/.venv/
~/projects/my-app/venv/
~/projects/my-app/env/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The standard naming conventions are &lt;code&gt;.venv&lt;/code&gt;, &lt;code&gt;venv&lt;/code&gt;, and &lt;code&gt;env&lt;/code&gt;. A valid virtual environment contains a &lt;code&gt;pyvenv.cfg&lt;/code&gt; file and a &lt;code&gt;bin/python&lt;/code&gt; executable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding all of them:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"pyvenv.cfg"&lt;/span&gt; &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This finds every virtual environment within 5 levels of your home directory. Each result shows the root of a venv — the parent directory is what you'd delete.&lt;/p&gt;

&lt;p&gt;A more targeted approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~/projects ~/code ~/dev &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="se"&gt;\(&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;".venv"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"venv"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"env"&lt;/span&gt; &lt;span class="se"&gt;\)&lt;/span&gt; &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 4 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to clean them:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simply delete the directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/projects/old-project/.venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes — as long as you can recreate it. If the project has a &lt;code&gt;requirements.txt&lt;/code&gt;, &lt;code&gt;pyproject.toml&lt;/code&gt;, or &lt;code&gt;Pipfile&lt;/code&gt;, you can always rebuild:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Orphaned environments&lt;/strong&gt; are especially safe to delete — these are venvs where the parent project no longer has any Python source files or config files. The project was probably deleted or moved, but the environment was left behind.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typical total size:&lt;/strong&gt; 1-15 GB across all projects, depending on how many you have and whether any include ML frameworks.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. pyenv, Poetry, and uv
&lt;/h2&gt;

&lt;p&gt;A few more Python tools that accumulate disk usage:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pyenv&lt;/strong&gt; installs each Python version separately at &lt;code&gt;~/.pyenv/versions/&lt;/code&gt;. Each version is 200-500 MB. Run &lt;code&gt;pyenv versions&lt;/code&gt; to see what's installed, and &lt;code&gt;pyenv uninstall 3.9.7&lt;/code&gt; to remove old point releases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Poetry&lt;/strong&gt; caches packages at &lt;code&gt;~/Library/Caches/pypoetry/&lt;/code&gt;. Clean with &lt;code&gt;poetry cache clear --all .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;uv&lt;/strong&gt; caches aggressively at &lt;code&gt;~/.cache/uv/&lt;/code&gt; for speed — expect 1-5 GB if you use it regularly. Clean with &lt;code&gt;uv cache clean&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. &lt;strong&gt;pycache&lt;/strong&gt; and Tool Caches
&lt;/h2&gt;

&lt;p&gt;These are small individually but add up across many projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;strong&gt;pycache&lt;/strong&gt; directories&lt;/strong&gt; contain compiled Python bytecode (&lt;code&gt;.pyc&lt;/code&gt; files). Every Python project has them scattered throughout its source tree. &lt;strong&gt;Tool caches&lt;/strong&gt; include &lt;code&gt;.ruff_cache/&lt;/code&gt;, &lt;code&gt;.mypy_cache/&lt;/code&gt;, &lt;code&gt;.pytest_cache/&lt;/code&gt;, and &lt;code&gt;.tox/&lt;/code&gt; (tox environments at &lt;code&gt;~/.tox/&lt;/code&gt; can be large).&lt;/p&gt;

&lt;p&gt;All of these are completely safe to delete — they regenerate automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~/projects &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"__pycache__"&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;
find ~/projects &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="se"&gt;\(&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;".mypy_cache"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;".ruff_cache"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;".pytest_cache"&lt;/span&gt; &lt;span class="se"&gt;\)&lt;/span&gt; 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Typical total size:&lt;/strong&gt; 10-500 MB across all projects. Not huge, but it's free space with zero risk.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Safe to Delete vs. What to Keep
&lt;/h2&gt;

&lt;p&gt;Here's the short version:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Always safe (zero risk):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pip cache&lt;/li&gt;
&lt;li&gt;conda package cache (&lt;code&gt;conda clean --all&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;__pycache__&lt;/code&gt; / &lt;code&gt;.pyc&lt;/code&gt; files everywhere&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.ruff_cache&lt;/code&gt;, &lt;code&gt;.mypy_cache&lt;/code&gt;, &lt;code&gt;.pytest_cache&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;uv and Poetry caches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Safe if you can recreate (low risk):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Virtual environments with a &lt;code&gt;requirements.txt&lt;/code&gt; or &lt;code&gt;pyproject.toml&lt;/code&gt; nearby&lt;/li&gt;
&lt;li&gt;Conda environments you haven't used in months&lt;/li&gt;
&lt;li&gt;Old pyenv versions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Verify first:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conda environments for active projects with complex dependency pinning&lt;/li&gt;
&lt;li&gt;Virtual environments with no dependency file (you might not remember what was installed)&lt;/li&gt;
&lt;li&gt;The conda &lt;code&gt;base&lt;/code&gt; environment — don't delete this unless you're uninstalling conda entirely&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Prevention: Keeping Python Lean
&lt;/h2&gt;

&lt;p&gt;You can't avoid the problem entirely, but you can slow the growth:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Miniconda instead of Anaconda.&lt;/strong&gt; A full Anaconda install is 3-5 GB out of the box because it includes hundreds of packages. Miniconda starts at ~400 MB. If you're already on Anaconda, switching is probably the single biggest disk savings you can make.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Miniforge or Mambaforge on Apple Silicon.&lt;/strong&gt; Miniforge gives you conda-forge as the default channel with native ARM packages. Mamba (a faster conda replacement) is included with Mambaforge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clean caches monthly.&lt;/strong&gt; Run &lt;code&gt;conda clean --all&lt;/code&gt; and &lt;code&gt;pip cache purge&lt;/code&gt; once a month. It takes 5 seconds and prevents multi-gigabyte cache buildup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Export before deleting.&lt;/strong&gt; The environment file is what matters, not the installed copy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env export&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; my-env &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; environment.yml
conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-n&lt;/span&gt; my-env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Automated Way
&lt;/h2&gt;

&lt;p&gt;Finding all Python environments manually — across conda directories, scattered venvs, multiple cache locations — is tedious. That's part of why the cleanup doesn't happen: it's not hard, it's just annoying enough that you put it off.&lt;/p&gt;

&lt;p&gt;This is exactly the problem I built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; to solve.&lt;/p&gt;

&lt;p&gt;MegaCleaner's Python scanner finds everything covered in this article automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Conda environments&lt;/strong&gt; across all installation paths (&lt;code&gt;~/anaconda3/envs/&lt;/code&gt;, &lt;code&gt;~/miniconda3/envs/&lt;/code&gt;, &lt;code&gt;~/opt/anaconda3/envs/&lt;/code&gt;, &lt;code&gt;~/miniforge3/envs/&lt;/code&gt;, &lt;code&gt;~/mambaforge/envs/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtual environments&lt;/strong&gt; (&lt;code&gt;.venv&lt;/code&gt;, &lt;code&gt;venv&lt;/code&gt;, &lt;code&gt;env&lt;/code&gt;) scattered across all your project directories, with orphan detection — it flags venvs where the parent project no longer has source files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pip cache&lt;/strong&gt; at &lt;code&gt;~/Library/Caches/pip/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;uv cache&lt;/strong&gt; at &lt;code&gt;~/.cache/uv/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Poetry cache&lt;/strong&gt; at &lt;code&gt;~/Library/Caches/pypoetry/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tox environments&lt;/strong&gt; at &lt;code&gt;~/.tox/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;__pycache__&lt;/code&gt;&lt;/strong&gt; directories and &lt;code&gt;.pyc&lt;/code&gt; files across all projects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool caches&lt;/strong&gt; — &lt;code&gt;.ruff_cache&lt;/code&gt;, &lt;code&gt;.mypy_cache&lt;/code&gt;, &lt;code&gt;.pytest_cache&lt;/code&gt; in every project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each item gets a confidence level: caches are marked "definitely safe," stale environments are "probably safe," and active environments are "verify first." Everything goes to Trash (undoable) — nothing is permanently deleted.&lt;/p&gt;

&lt;p&gt;And Python is just one of 29 scanners (21 developer tools + 8 system categories). If you also use Docker, Node.js, Xcode, Rust, or Homebrew, those get scanned too.&lt;/p&gt;

&lt;p&gt;How it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scan is free&lt;/strong&gt; — see exactly how much space Python (and everything else) is using&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidence levels&lt;/strong&gt; — every item is labeled so you know what's safe&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One click&lt;/strong&gt; — select what to clean, hit Clean, done&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$49 one-time&lt;/strong&gt; — not a subscription&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick Reference Commands
&lt;/h2&gt;

&lt;p&gt;Bookmark this section for next time your disk fills up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env &lt;/span&gt;list                                    &lt;span class="c"&gt;# List all environments&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/anaconda3/envs/&lt;span class="k"&gt;*&lt;/span&gt; 2&amp;gt;/dev/null             &lt;span class="c"&gt;# Check environment sizes&lt;/span&gt;
conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;env-name&amp;gt;                    &lt;span class="c"&gt;# Remove an environment&lt;/span&gt;
conda clean &lt;span class="nt"&gt;--all&lt;/span&gt;                                 &lt;span class="c"&gt;# Clean package cache&lt;/span&gt;

&lt;span class="c"&gt;# pip&lt;/span&gt;
pip cache info                                    &lt;span class="c"&gt;# Check cache size&lt;/span&gt;
pip cache purge                                   &lt;span class="c"&gt;# Purge cache&lt;/span&gt;

&lt;span class="c"&gt;# Virtual environments&lt;/span&gt;
find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"pyvenv.cfg"&lt;/span&gt; &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 2&amp;gt;/dev/null &lt;span class="c"&gt;# Find all venvs&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /path/to/project/.venv                     &lt;span class="c"&gt;# Remove a venv&lt;/span&gt;

&lt;span class="c"&gt;# pyenv&lt;/span&gt;
pyenv versions                                    &lt;span class="c"&gt;# List installed versions&lt;/span&gt;
pyenv uninstall &amp;lt;version&amp;gt;                         &lt;span class="c"&gt;# Remove a version&lt;/span&gt;

&lt;span class="c"&gt;# Other caches&lt;/span&gt;
uv cache clean                                    &lt;span class="c"&gt;# Clean uv cache&lt;/span&gt;
poetry cache clear &lt;span class="nt"&gt;--all&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;                        &lt;span class="c"&gt;# Clean Poetry cache&lt;/span&gt;

&lt;span class="c"&gt;# __pycache__ cleanup&lt;/span&gt;
find ~/projects &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"__pycache__"&lt;/span&gt; &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; + 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Python environments silently consume 10-50 GB on most data scientists' and ML engineers' Macs. The biggest culprits are forgotten conda environments (2-8 GB each) and duplicated ML framework installations across virtual environments.&lt;/p&gt;

&lt;p&gt;At a minimum, do this quarterly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;conda env list&lt;/code&gt;&lt;/strong&gt; and delete environments you don't recognize&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;conda clean --all&lt;/code&gt;&lt;/strong&gt; to clear the package cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;pip cache purge&lt;/code&gt;&lt;/strong&gt; to clear the pip download cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search for orphaned &lt;code&gt;.venv&lt;/code&gt; directories&lt;/strong&gt; in old project folders&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check &lt;code&gt;~/.pyenv/versions/&lt;/code&gt;&lt;/strong&gt; for Python versions you no longer use&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The manual cleanup takes 10-15 minutes if you follow this guide. Or scan with &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; and do it in under a minute.&lt;/p&gt;

&lt;p&gt;Either way, your hard drive will thank you.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>python</category>
      <category>tooling</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>node_modules is Why Your Mac is Full: Find and Delete All of Them</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:32:11 +0000</pubDate>
      <link>https://forem.com/nixeton/nodemodules-is-why-your-mac-is-full-find-and-delete-all-of-them-jfk</link>
      <guid>https://forem.com/nixeton/nodemodules-is-why-your-mac-is-full-find-and-delete-all-of-them-jfk</guid>
      <description>&lt;p&gt;I had 47 &lt;code&gt;node_modules&lt;/code&gt; folders totaling 38GB on my Mac. Most of them were for projects I hadn't touched in months. A weekend tutorial from last year? Still has its node_modules. That side project I abandoned after two commits? node_modules. A cloned repo I opened once to read the source? You guessed it — node_modules.&lt;/p&gt;

&lt;p&gt;If your Mac keeps telling you the disk is full and you're a JavaScript developer, there is a very good chance that node_modules is the single biggest reason why. It's not your photos. It's not your music. It's 200,000 tiny files spread across dozens of forgotten project directories.&lt;/p&gt;

&lt;p&gt;Let's fix that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why node_modules Gets So Absurdly Big
&lt;/h2&gt;

&lt;p&gt;If you've ever looked at a fresh &lt;code&gt;node_modules&lt;/code&gt; folder and wondered how a project with three dependencies ended up with 900MB of installed packages, you're not imagining things. There are real structural reasons why this happens.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flat Dependency Trees
&lt;/h3&gt;

&lt;p&gt;npm v3 introduced flat dependency trees to solve the deeply nested paths problem on Windows. The trade-off? Every transitive dependency gets hoisted to the top level of &lt;code&gt;node_modules&lt;/code&gt;. Install &lt;code&gt;create-react-app&lt;/code&gt; and you'll find yourself with 1,400+ packages in a flat directory. Your project depends on 5 things. Those 5 things depend on 1,395 other things. All of them live in your project folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  Duplicate Packages Across Projects
&lt;/h3&gt;

&lt;p&gt;Here's where the math gets painful. If you have 10 React projects on your machine, you likely have 10 complete copies of React, 10 copies of webpack, 10 copies of TypeScript, and 10 copies of every shared dependency between them. There's no deduplication across projects. Each &lt;code&gt;node_modules&lt;/code&gt; is an island.&lt;/p&gt;

&lt;p&gt;A typical React project's node_modules weighs 300-500MB. A Next.js project can hit 600MB-1GB. Multiply that by every project on your machine and you start to see how 20-50GB disappears silently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Native Binaries and Platform-Specific Code
&lt;/h3&gt;

&lt;p&gt;Some packages include prebuilt native binaries — &lt;code&gt;esbuild&lt;/code&gt;, &lt;code&gt;swc&lt;/code&gt;, &lt;code&gt;sharp&lt;/code&gt;, &lt;code&gt;better-sqlite3&lt;/code&gt;, Playwright's browser binaries. These are often 50-200MB each. They compile or download platform-specific builds during &lt;code&gt;npm install&lt;/code&gt;, and they're not small.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build Output Hiding in Plain Sight
&lt;/h3&gt;

&lt;p&gt;On top of node_modules itself, most JavaScript projects also generate build output directories: &lt;code&gt;dist&lt;/code&gt;, &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;.next&lt;/code&gt;, &lt;code&gt;.nuxt&lt;/code&gt;, &lt;code&gt;out&lt;/code&gt;. A Next.js build cache (&lt;code&gt;.next&lt;/code&gt;) alone can be 200-500MB. These add up across projects too, and they're just as safe to delete as node_modules — they regenerate on the next build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding All node_modules on Your Mac
&lt;/h2&gt;

&lt;p&gt;Before you delete anything, let's see the damage. This command finds every &lt;code&gt;node_modules&lt;/code&gt; directory under your home folder and shows its size:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see output like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;1.2G    /Users/you/projects/webapp/node_modules
487M    /Users/you/projects/api-server/node_modules
923M    /Users/you/code/nextjs-blog/node_modules
341M    /Users/you/tutorials/react-course/node_modules
756M    /Users/you/clients/dashboard/node_modules
&lt;/span&gt;&lt;span class="c"&gt;...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Want just the total? Pipe it through &lt;code&gt;awk&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sm&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{total += $1} END {printf "Total: %.1f GB\n", total/1024}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fair warning: this command can take a minute or two to run. &lt;code&gt;du&lt;/code&gt; has to stat every file inside every node_modules, and there are a lot of files.&lt;/p&gt;

&lt;p&gt;If you want a quick count of how many node_modules folders you have without waiting for sizes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 2&amp;gt;/dev/null | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't be surprised if it's more than you expected. I never would have guessed 47.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Nuclear Option: Delete Them All
&lt;/h2&gt;

&lt;p&gt;Once you've seen the list, you'll probably realize that most of these projects don't need their dependencies installed right now. You can always run &lt;code&gt;npm install&lt;/code&gt; (or &lt;code&gt;yarn&lt;/code&gt;, or &lt;code&gt;pnpm install&lt;/code&gt;) again later when you actually work on a project. The &lt;code&gt;package.json&lt;/code&gt; and lockfile are what matter — node_modules is just a cache.&lt;/p&gt;

&lt;p&gt;To delete every node_modules folder under your home directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; + 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;A few things to know before you run this:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's safe.&lt;/strong&gt; node_modules is fully regenerable from your lockfile. Nothing unique lives in there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Running projects will break.&lt;/strong&gt; If you have a dev server running, it will crash. Stop your dev servers first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You'll need to reinstall.&lt;/strong&gt; The next time you &lt;code&gt;cd&lt;/code&gt; into a project and run it, you'll need to &lt;code&gt;npm install&lt;/code&gt; first. This is normal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It won't touch your source code.&lt;/strong&gt; Only the &lt;code&gt;node_modules&lt;/code&gt; directories are deleted. Your &lt;code&gt;package.json&lt;/code&gt;, lockfiles, and source files are untouched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to be more selective — say, only delete node_modules for projects you haven't modified in over 30 days — that's harder to do from the command line. You'd need to cross-reference each node_modules with the modification dates of the source files in the parent project directory. (This is actually something &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; does automatically — more on that below.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Package Manager Caches: The Other Storage Hog
&lt;/h2&gt;

&lt;p&gt;Deleting node_modules folders is only half the story. Your package manager also keeps a global cache of downloaded packages. This cache speeds up future installs so npm doesn't have to re-download packages from the registry, but it grows over time and can get large — especially if you work across many projects with different dependency versions.&lt;/p&gt;

&lt;p&gt;Here's where each package manager stores its cache on macOS and how to clean it.&lt;/p&gt;

&lt;h3&gt;
  
  
  npm
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cache location:&lt;/strong&gt; &lt;code&gt;~/.npm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;npm's cache stores tarballs and metadata for every package you've ever installed. It grows indefinitely.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check size&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.npm

&lt;span class="c"&gt;# Clean it&lt;/span&gt;
npm cache clean &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--force&lt;/code&gt; flag is required because npm wants you to really mean it. After cleaning, future installs will be slightly slower for the first run as packages are re-downloaded.&lt;/p&gt;

&lt;h3&gt;
  
  
  Yarn (v1/Classic)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cache location:&lt;/strong&gt; &lt;code&gt;~/Library/Caches/Yarn&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can verify the exact path on your system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn cache &lt;span class="nb"&gt;dir&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To clean it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check size&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/Library/Caches/Yarn

&lt;span class="c"&gt;# Clean it&lt;/span&gt;
yarn cache clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  pnpm
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cache location:&lt;/strong&gt; &lt;code&gt;~/Library/pnpm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;pnpm uses a content-addressable store, which is actually more efficient than npm or yarn — it deduplicates packages across projects using hard links. That said, the store still grows over time as you install different package versions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check size&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/Library/pnpm

&lt;span class="c"&gt;# Remove unreferenced packages&lt;/span&gt;
pnpm store prune
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pnpm store prune&lt;/code&gt; is gentler than a full delete — it removes packages that aren't referenced by any project on your machine, but keeps the ones that are still in use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bun
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cache location:&lt;/strong&gt; &lt;code&gt;~/.bun/install/cache&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Bun's cache stores downloaded packages in its own format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check size&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.bun/install/cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's no built-in &lt;code&gt;bun cache clean&lt;/code&gt; command as of this writing. To clear it, you can delete the directory manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.bun/install/cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deno
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cache location:&lt;/strong&gt; &lt;code&gt;~/.deno&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Deno stores downloaded dependencies and compilation caches here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check size&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.deno
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Turborepo
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cache location:&lt;/strong&gt; &lt;code&gt;~/.turbo&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you use Turborepo for monorepo build orchestration, it maintains a global build cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check size&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.turbo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The One-Liner to Check All of Them
&lt;/h3&gt;

&lt;p&gt;Want to see how much space all your package manager caches are consuming? Run this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"=== Package Manager Caches ==="&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.npm 2&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/Library/Caches/Yarn 2&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/Library/pnpm 2&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.bun/install/cache 2&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.deno 2&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.turbo 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my experience, the combined size of these caches ranges from 2-10GB depending on how many different projects and package versions you've worked with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prevention Tips: Keeping node_modules Under Control
&lt;/h2&gt;

&lt;p&gt;Deleting everything feels great, but it'll grow back. Here are some strategies to keep node_modules from swallowing your disk again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use pnpm Instead of npm
&lt;/h3&gt;

&lt;p&gt;pnpm's content-addressable store means that if 10 projects use the same version of React, only one copy exists on disk. Each project's node_modules contains hard links to the central store. In practice, this reduces total disk usage by 50-70% compared to npm.&lt;/p&gt;

&lt;p&gt;Switching is straightforward — pnpm uses the same &lt;code&gt;package.json&lt;/code&gt; format and can import existing lockfiles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; pnpm
pnpm import        &lt;span class="c"&gt;# converts package-lock.json to pnpm-lock.yaml&lt;/span&gt;
pnpm &lt;span class="nb"&gt;install&lt;/span&gt;       &lt;span class="c"&gt;# creates a linked node_modules&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configure .npmrc for Smaller Installs
&lt;/h3&gt;

&lt;p&gt;Add these to your &lt;code&gt;~/.npmrc&lt;/code&gt; to reduce what gets installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c"&gt;# Don't install optional dependencies (often native binaries you don't need)
&lt;/span&gt;&lt;span class="py"&gt;optional&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;false&lt;/span&gt;

&lt;span class="c"&gt;# Disable package-lock generation for throwaway projects
# (only use this for experiments, not real projects)
# package-lock=false
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Clean Up Regularly
&lt;/h3&gt;

&lt;p&gt;Set a reminder to clean node_modules every month or two. Or, if you want to remember which projects are stale, use &lt;code&gt;ls -la&lt;/code&gt; on your project directories and sort by modification date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# List projects by last modification date&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lt&lt;/span&gt; ~/projects/&lt;span class="k"&gt;*&lt;/span&gt;/package.json 2&amp;gt;/dev/null | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Don't Forget Build Artifacts
&lt;/h3&gt;

&lt;p&gt;JavaScript build tools generate output directories that are just as safe to delete as node_modules. Common ones include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dist/&lt;/code&gt; — Vite, Rollup, webpack, esbuild&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;build/&lt;/code&gt; — Create React App, various tools&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.next/&lt;/code&gt; — Next.js build cache and output&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.nuxt/&lt;/code&gt; — Nuxt.js build output&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;out/&lt;/code&gt; — Next.js static export, other tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These regenerate on the next &lt;code&gt;npm run build&lt;/code&gt;. If a project is sitting idle, there's no reason to keep them around.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Automated Way: Let MegaCleaner Handle It
&lt;/h2&gt;

&lt;p&gt;The command-line approach works, but it has limitations. &lt;code&gt;find&lt;/code&gt; is slow on large directory trees, it can't tell you which projects are stale versus actively in use, and you have to remember to run it. Plus, manually tracking six different cache directories across four package managers gets old.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; is a native macOS app I built specifically for this problem. Its Node.js scanner handles all of the above automatically:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it finds:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every &lt;code&gt;node_modules&lt;/code&gt; folder across all your project directories and external drives&lt;/li&gt;
&lt;li&gt;Package manager caches: npm (&lt;code&gt;~/.npm&lt;/code&gt;), Yarn (&lt;code&gt;~/Library/Caches/Yarn&lt;/code&gt;), pnpm (&lt;code&gt;~/Library/pnpm&lt;/code&gt;), Bun (&lt;code&gt;~/.bun/install/cache&lt;/code&gt;), Deno (&lt;code&gt;~/.deno&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Turborepo global build cache (&lt;code&gt;~/.turbo&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;JS/Web build artifacts (&lt;code&gt;dist&lt;/code&gt;, &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;.next&lt;/code&gt;, &lt;code&gt;.nuxt&lt;/code&gt;, &lt;code&gt;out&lt;/code&gt;) in any project that has a &lt;code&gt;package.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What makes it smarter than &lt;code&gt;find&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Staleness detection.&lt;/strong&gt; MegaCleaner checks the modification dates of actual source files in each project (&lt;code&gt;.js&lt;/code&gt;, &lt;code&gt;.ts&lt;/code&gt;, &lt;code&gt;.tsx&lt;/code&gt;, &lt;code&gt;.vue&lt;/code&gt;, &lt;code&gt;.svelte&lt;/code&gt;, &lt;code&gt;.astro&lt;/code&gt;, &lt;code&gt;.json&lt;/code&gt;, &lt;code&gt;.css&lt;/code&gt;, &lt;code&gt;.scss&lt;/code&gt;, and more) — not just the node_modules folder itself. If you haven't edited source code in a project for months, it marks that project's node_modules as stale and pre-selects it for cleanup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project name detection.&lt;/strong&gt; It reads each project's &lt;code&gt;package.json&lt;/code&gt; to show you human-readable project names instead of raw directory paths.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Package manager awareness.&lt;/strong&gt; It detects which package manager each project uses by checking for lockfiles (&lt;code&gt;bun.lockb&lt;/code&gt;, &lt;code&gt;pnpm-lock.yaml&lt;/code&gt;, &lt;code&gt;yarn.lock&lt;/code&gt;, &lt;code&gt;package-lock.json&lt;/code&gt;) and shows you the correct reinstall command (&lt;code&gt;bun install&lt;/code&gt;, &lt;code&gt;pnpm install&lt;/code&gt;, &lt;code&gt;yarn&lt;/code&gt;, or &lt;code&gt;npm install&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No nested duplicates.&lt;/strong&gt; It skips &lt;code&gt;node_modules&lt;/code&gt; inside other &lt;code&gt;node_modules&lt;/code&gt; folders to avoid double-counting, and follows canonical paths to prevent counting symlinked directories twice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Symlink safety.&lt;/strong&gt; It skips symbolic links entirely to avoid infinite loops and accidental deletion of linked directories.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Node.js is just one of MegaCleaner's 29 scanners. It also covers Xcode DerivedData, Docker images, Python virtual environments, Rust target directories, Go module caches, Homebrew leftovers, and more. If you're a polyglot developer, the savings add up fast.&lt;/p&gt;

&lt;p&gt;MegaCleaner is a one-time purchase: &lt;strong&gt;$49&lt;/strong&gt;, no subscription. It's a native macOS app — no Electron, no web views.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;Download MegaCleaner&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Reference: Commands Checklist
&lt;/h2&gt;

&lt;p&gt;Here's everything from this article in one place. Bookmark this section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Find all node_modules and their sizes:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete all node_modules:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; + 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clean npm cache:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm cache clean &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clean Yarn cache:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn cache clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Prune pnpm store:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm store prune
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete Bun cache:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.bun/install/cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check all cache sizes at once:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/.npm ~/Library/Caches/Yarn ~/Library/pnpm ~/.bun/install/cache ~/.deno ~/.turbo 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;JavaScript's dependency model means node_modules will always come back. The key is not to let it sit around consuming space in projects you're not actively working on. Whether you set up a monthly terminal ritual or let &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; handle it automatically, your Mac's storage will thank you.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>npm</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Homebrew, Gradle, and the Hidden Caches Eating Your Mac's Storage</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:30:00 +0000</pubDate>
      <link>https://forem.com/nixeton/homebrew-gradle-and-the-hidden-caches-eating-your-macs-storage-3f9e</link>
      <guid>https://forem.com/nixeton/homebrew-gradle-and-the-hidden-caches-eating-your-macs-storage-3f9e</guid>
      <description>&lt;p&gt;Most developers know about the big offenders — Xcode's DerivedData, Docker images, &lt;code&gt;node_modules&lt;/code&gt;. But there's a second tier of caches that almost nobody thinks about: Homebrew downloads, Gradle wrapper distributions, Maven repositories, Go module caches, Ruby gems, and IDE workspace storage.&lt;/p&gt;

&lt;p&gt;None of these is massive on its own. Homebrew might be 3GB. Gradle caches, 8GB. Your IDE's workspace storage, another 4GB. But stack five or six of these together and you're looking at &lt;strong&gt;20-40GB of disk space&lt;/strong&gt; consumed by files you'll never open, never reference, and never miss if they're gone.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; specifically because I kept rediscovering these folders every few months, manually cleaning them, and then forgetting about them again. This article covers every location, every cleanup command, and the typical savings you can expect.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Homebrew Cache
&lt;/h2&gt;

&lt;p&gt;Homebrew is installed on nearly every developer Mac, and it quietly caches every package it downloads. Upgrade a formula? The old tarball stays. Install something, try it, uninstall it? The download stays. Over time, these downloads pile up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it lives:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Library/Caches/Homebrew/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory holds cached downloads, bottle tarballs, and formula metadata. Homebrew also stores build and install logs separately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Library/Logs/Homebrew/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What most people don't know about:&lt;/strong&gt; Beyond the download cache, Homebrew keeps old versions of installed formulas in its Cellar directory. If you've had a formula installed through several upgrades, each old version sits in its own folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/opt/homebrew/Cellar/&amp;lt;formula&amp;gt;/&amp;lt;old-version&amp;gt;/    # Apple Silicon Macs
/usr/local/Cellar/&amp;lt;formula&amp;gt;/&amp;lt;old-version&amp;gt;/       # Intel Macs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These outdated kegs aren't cleaned up automatically. If you've been running &lt;code&gt;brew upgrade&lt;/code&gt; for a year or two, you may have dozens of old versions sitting idle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 2-10GB, depending on how many packages you use and how often you upgrade. Heavy Homebrew users (those installing large casks like databases, language runtimes, or GUI apps) can see even more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Remove cached downloads (anything older than 120 days by default):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew cleanup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Force-remove all cached downloads regardless of age:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew cleanup &lt;span class="nt"&gt;-s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove packages that were installed only as dependencies and are no longer needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew autoremove
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a full cleanup, run both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew cleanup &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; brew autoremove
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes. Cached downloads are re-downloaded on next install. Old keg versions are only used if you explicitly &lt;code&gt;brew switch&lt;/code&gt; to them, which almost nobody does. Homebrew logs are purely informational.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Gradle and Maven Caches
&lt;/h2&gt;

&lt;p&gt;If you do any JVM development — Java, Kotlin, Android, Spring Boot — Gradle and Maven are downloading dependencies into local caches that grow without bound. These are some of the largest caches on a typical developer Mac.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gradle
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Where it lives:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.gradle/caches/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where Gradle stores downloaded dependencies, transformed artifacts, build cache entries, and metadata. It's the main storage consumer.&lt;/p&gt;

&lt;p&gt;Gradle also downloads full Gradle distributions for each version referenced by the wrapper in your projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.gradle/wrapper/dists/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each Gradle version is roughly 100-200MB, and if you work across multiple projects using different Gradle versions, you might have 5-10 versions sitting here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 5-20GB. Android developers tend toward the higher end because the Android build system downloads substantial support libraries, build tools, and transformed artifacts. If you've been doing Android development for a few years, 15-20GB is common.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Delete the entire cache (dependencies will re-download on next build):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.gradle/caches/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete old wrapper distributions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.gradle/wrapper/dists/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gradle itself doesn't provide a built-in cleanup command for the local cache. There's a &lt;code&gt;--no-build-cache&lt;/code&gt; flag, but it only prevents &lt;em&gt;writing&lt;/em&gt; to the cache — it doesn't remove existing entries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes. Everything in &lt;code&gt;~/.gradle/caches/&lt;/code&gt; is downloaded from remote repositories and will be fetched again when needed. The first build after cleaning will be slower as dependencies are re-resolved. Wrapper distributions are re-downloaded automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maven
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Where it lives:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.m2/repository/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Maven's local repository is a mirror of every dependency your projects have ever resolved. Unlike Gradle, Maven stores artifacts in a structured directory tree (&lt;code&gt;groupId/artifactId/version/&lt;/code&gt;), which makes it easy to browse but doesn't help with cleanup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 2-10GB for most developers. If you work on large enterprise projects with extensive dependency trees, it can exceed 15GB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Delete the entire local repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.m2/repository/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use Maven's dependency plugin to selectively purge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn dependency:purge-local-repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes. Everything is re-downloaded from Maven Central (or your configured repositories) on next build. The only risk: if you have locally installed artifacts (&lt;code&gt;mvn install&lt;/code&gt; on local projects), those will need to be rebuilt.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Go Module and Build Caches
&lt;/h2&gt;

&lt;p&gt;Go has two distinct caches that grow independently and are both safe to clean.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module cache
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Where it lives:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/go/pkg/mod/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the default location when &lt;code&gt;$GOPATH&lt;/code&gt; is not set (which is the case for most modern Go setups). If you've customized &lt;code&gt;$GOPATH&lt;/code&gt;, the module cache lives at &lt;code&gt;$GOPATH/pkg/mod/&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;The module cache stores downloaded source code for every version of every dependency your Go projects have ever used. Because Go modules are versioned, switching between dependency versions doesn't remove old ones — they accumulate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build cache
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.cache/go-build/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The build cache stores compiled object files so that unchanged packages don't need recompilation. This is separate from the module cache and grows based on how many packages you compile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; 1-5GB combined for most developers. Heavy Go users working on microservice architectures with many dependencies can see more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean them:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clear the build cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go clean &lt;span class="nt"&gt;-cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clear the module cache (requires &lt;code&gt;sudo&lt;/code&gt; since Go sets directories to read-only):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go clean &lt;span class="nt"&gt;-modcache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clear both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go clean &lt;span class="nt"&gt;-cache&lt;/span&gt; &lt;span class="nt"&gt;-modcache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes. Modules are re-downloaded via &lt;code&gt;go mod download&lt;/code&gt; (triggered automatically on next build). Build artifacts are recompiled as needed.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Ruby Gems and Bundler
&lt;/h2&gt;

&lt;p&gt;Ruby's gem ecosystem creates multiple cache layers, and if you use version managers like rbenv or RVM, the storage multiplies across Ruby versions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gem cache
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Where it lives:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.gem/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory contains downloaded gem files, compiled native extensions, and metadata for every gem you've installed. Each Ruby version gets its own subdirectory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bundler cache
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.bundle/cache/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bundler stores its own cache of downloaded gems separately from the system gem cache.&lt;/p&gt;

&lt;h3&gt;
  
  
  Version managers
&lt;/h3&gt;

&lt;p&gt;If you use rbenv or RVM, each installed Ruby version is a full Ruby installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.rbenv/versions/     # rbenv
~/.rvm/                # RVM (entire installation)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Vendor bundles
&lt;/h3&gt;

&lt;p&gt;Projects that use &lt;code&gt;bundle install --deployment&lt;/code&gt; or &lt;code&gt;bundle install --path vendor/bundle&lt;/code&gt; store a complete copy of all gems inside the project directory at &lt;code&gt;vendor/bundle/&lt;/code&gt;. These are easy to overlook because they're buried inside project folders.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 1-5GB for the gem and bundler caches alone. Add version managers and you can add 500MB-2GB per installed Ruby version. Vendor bundles add 200MB-1GB per project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Remove old gem versions (keeps only the latest version of each gem):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem cleanup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Preview what would be removed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem cleanup &lt;span class="nt"&gt;--dryrun&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clear bundler cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.bundle/cache/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Gem cleanup is safe — old versions are rarely needed, and &lt;code&gt;gem install&lt;/code&gt; restores them. Be careful with version manager directories if you actively use multiple Ruby versions. Vendor bundles can be restored with &lt;code&gt;bundle install&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. IDE Caches
&lt;/h2&gt;

&lt;p&gt;Your code editor or IDE maintains its own caches, extensions, and workspace state. If you use multiple IDEs, this adds up fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  VS Code
&lt;/h3&gt;

&lt;p&gt;VS Code stores caches and workspace data across several locations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Library/Application Support/Code/Cache/
~/Library/Application Support/Code/CachedData/
~/Library/Application Support/Code/User/workspaceStorage/
~/.vscode/extensions/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Cache&lt;/code&gt; and &lt;code&gt;CachedData&lt;/code&gt; directories are standard Electron app caches — safe to delete, rebuilt automatically. &lt;code&gt;workspaceStorage&lt;/code&gt; holds per-project state for extensions (search history, git state, etc.) and grows with every project you open. The &lt;code&gt;extensions&lt;/code&gt; directory holds your installed extensions and their data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 2-8GB. Workspace storage alone can be 1-4GB if you've opened many projects. Extensions can be another 1-3GB depending on how many you have installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cursor and Windsurf
&lt;/h3&gt;

&lt;p&gt;If you use Cursor or Windsurf (VS Code-based AI editors), they maintain their own separate caches in the same structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Library/Application Support/Cursor/Cache/
~/Library/Application Support/Cursor/CachedData/
~/.cursor/extensions/

~/Library/Application Support/Windsurf/Cache/
~/Library/Application Support/Windsurf/CachedData/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are independent from VS Code's caches, so if you run multiple editors you're paying the storage cost for each.&lt;/p&gt;

&lt;h3&gt;
  
  
  JetBrains IDEs
&lt;/h3&gt;

&lt;p&gt;IntelliJ IDEA, WebStorm, PyCharm, CLion, GoLand, Android Studio, RustRover, and every other JetBrains IDE stores caches and logs in versioned subdirectories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Library/Caches/JetBrains/&amp;lt;IDEVersion&amp;gt;/
~/Library/Logs/JetBrains/&amp;lt;IDEVersion&amp;gt;/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, &lt;code&gt;~/Library/Caches/JetBrains/IntelliJIdea2024.1/&lt;/code&gt;. Each IDE version gets its own folder, and caches from old versions remain after you upgrade. If you've used IntelliJ through several yearly releases, you might have 4-5 old cache directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 1-5GB per IDE, multiplied by the number of versions you've had installed. Two JetBrains IDEs across three version upgrades can easily be 10-15GB of stale caches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sublime Text and Zed
&lt;/h3&gt;

&lt;p&gt;Smaller editors leave smaller footprints, but they still cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Library/Caches/com.sublimetext.3/
~/Library/Caches/com.sublimetext.4/
~/Library/Caches/Zed/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to clean IDE caches:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;VS Code — clear caches (extensions stay intact):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/Cache
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/CachedData
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JetBrains — remove old version caches (check which versions you actually use first):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; ~/Library/Caches/JetBrains/
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Caches/JetBrains/IntelliJIdea2023.&lt;span class="k"&gt;*&lt;/span&gt;/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Cache and CachedData directories are safe — IDEs rebuild them on launch. Workspace storage is safe to clear but you'll lose per-project editor state. Extensions directories should be handled with care — deleting them means reinstalling your extensions.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. The Combined Impact
&lt;/h2&gt;

&lt;p&gt;Here's what all of these look like together. On a developer Mac that's been in use for a year or more, these are typical numbers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Cache Path&lt;/th&gt;
&lt;th&gt;Typical Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Homebrew cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Caches/Homebrew/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2-5 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Homebrew logs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Logs/Homebrew/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;100-500 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Homebrew outdated kegs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/opt/homebrew/Cellar/*/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;500 MB-3 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gradle caches&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.gradle/caches/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;5-15 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gradle wrapper&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.gradle/wrapper/dists/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;500 MB-2 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maven repository&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.m2/repository/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2-10 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Go module cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/go/pkg/mod/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1-3 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Go build cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.cache/go-build/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;500 MB-2 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ruby gems&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.gem/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;500 MB-2 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bundler cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.bundle/cache/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200 MB-1 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VS Code caches&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Application Support/Code/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2-5 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JetBrains caches&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Caches/JetBrains/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2-10 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~20-50 GB&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's 20-50GB of disk space consumed by caches from tools that aren't even your primary development stack in many cases. And none of these clean themselves up automatically.&lt;/p&gt;

&lt;p&gt;The uncomfortable truth: even if you're diligent about running cleanup commands, you have to &lt;em&gt;remember&lt;/em&gt; to do it. For each tool. Regularly. Most developers run &lt;code&gt;brew cleanup&lt;/code&gt; once, feel good about it, and then forget for six months.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. The Automated Way
&lt;/h2&gt;

&lt;p&gt;This is the problem I built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; to solve.&lt;/p&gt;

&lt;p&gt;MegaCleaner is a native macOS app with &lt;strong&gt;29 specialized scanners&lt;/strong&gt; — 21 for developer tools (including dedicated scanners for Homebrew, Gradle/Maven, Go, Ruby, and IDE caches) and 8 for general macOS cleanup. It scans every path covered in this article, plus Xcode, Docker, Node.js, Python, Rust, Cocoapods, SPM, and more.&lt;/p&gt;

&lt;p&gt;What it does that manual cleanup doesn't:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scans all tools at once&lt;/strong&gt; — no switching between terminals and remembering paths.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shows you exactly what's stale&lt;/strong&gt; — MegaCleaner tracks file modification dates and flags caches that haven't been touched in weeks or months, so you can keep recent caches and clean only what's truly idle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handles outdated Homebrew kegs&lt;/strong&gt; — it identifies old formula versions in the Cellar, keeping only the latest version of each package.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finds IDE caches across editors&lt;/strong&gt; — VS Code, Cursor, Windsurf, JetBrains (all IDEs, all versions), Sublime Text, Zed, even Vim/Neovim undo files. If you use more than one editor, this adds up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovers vendor bundles in projects&lt;/strong&gt; — finds &lt;code&gt;vendor/bundle&lt;/code&gt; directories buried inside Ruby projects across your codebase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Respects $GOPATH&lt;/strong&gt; — automatically resolves custom Go paths instead of assuming the default.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pricing:&lt;/strong&gt; $49 one-time purchase. No subscription. Free updates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;Download MegaCleaner&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Quick Reference Commands
&lt;/h2&gt;

&lt;p&gt;Bookmark this section. Here's every cleanup command from this article in one place:&lt;/p&gt;

&lt;h3&gt;
  
  
  Homebrew
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew cleanup &lt;span class="nt"&gt;-s&lt;/span&gt;          &lt;span class="c"&gt;# Remove all cached downloads&lt;/span&gt;
brew autoremove          &lt;span class="c"&gt;# Remove unused dependencies&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Gradle
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.gradle/caches/         &lt;span class="c"&gt;# Delete dependency cache&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.gradle/wrapper/dists/  &lt;span class="c"&gt;# Delete wrapper distributions&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Maven
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.m2/repository/         &lt;span class="c"&gt;# Delete local repository&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Go
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go clean &lt;span class="nt"&gt;-cache&lt;/span&gt;       &lt;span class="c"&gt;# Clear build cache&lt;/span&gt;
go clean &lt;span class="nt"&gt;-modcache&lt;/span&gt;    &lt;span class="c"&gt;# Clear module cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Ruby
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem cleanup              &lt;span class="c"&gt;# Remove old gem versions&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.bundle/cache/  &lt;span class="c"&gt;# Clear Bundler cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  VS Code
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/Cache
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/CachedData
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/User/workspaceStorage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  JetBrains
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; ~/Library/Caches/JetBrains/
&lt;span class="nb"&gt;ls&lt;/span&gt; ~/Library/Logs/JetBrains/
&lt;span class="c"&gt;# Then remove old versions selectively&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nuclear option (everything at once)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew cleanup &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; brew autoremove
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.gradle/caches/ ~/.gradle/wrapper/dists/
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.m2/repository/
go clean &lt;span class="nt"&gt;-cache&lt;/span&gt; &lt;span class="nt"&gt;-modcache&lt;/span&gt;
gem cleanup
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.bundle/cache/
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/Cache
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/CachedData
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fair warning: the nuclear option means slower first builds across &lt;em&gt;all&lt;/em&gt; your projects as dependencies are re-downloaded. It's safe, but plan for it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Developer tool caches are a death-by-a-thousand-cuts storage problem. No single one is outrageous, but they compound. And they all share the same characteristic: they grow without limit and never clean themselves up.&lt;/p&gt;

&lt;p&gt;You have two options. You can bookmark this article and run through the commands every few months. Or you can let &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; scan everything in one pass and show you exactly what's safe to remove, with size and staleness information for every item.&lt;/p&gt;

&lt;p&gt;Either way, go check &lt;code&gt;~/Library/Caches/Homebrew/&lt;/code&gt; and &lt;code&gt;~/.gradle/caches/&lt;/code&gt; right now. You might be surprised.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>showdev</category>
      <category>softwaredevelopment</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Docker Ate Your Disk: Reclaiming 20-50GB on macOS</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:10:07 +0000</pubDate>
      <link>https://forem.com/nixeton/docker-ate-your-disk-reclaiming-20-50gb-on-macos-4k86</link>
      <guid>https://forem.com/nixeton/docker-ate-your-disk-reclaiming-20-50gb-on-macos-4k86</guid>
      <description>&lt;p&gt;Docker Desktop was using 67GB on my Mac. I didn't notice until my build failed with "no space left on device" and I started digging.&lt;/p&gt;

&lt;p&gt;67GB. For containers I hadn't run in months, images I'd pulled once for a quick test, build cache from projects I'd abandoned, and a VM disk file that had ballooned to 40GB and refused to shrink.&lt;/p&gt;

&lt;p&gt;If you're a developer running Docker on macOS, you're almost certainly in the same situation. Docker is designed to cache aggressively and clean up never. On Linux, Docker stores everything directly on the filesystem, so standard disk tools can see it. On macOS, Docker runs inside a Linux VM — and everything it stores is hidden inside a single disk image file. That file only grows. It never shrinks on its own.&lt;/p&gt;

&lt;p&gt;This guide covers every category of Docker disk usage on macOS: what it is, how to find it, how to clean it, and how to stop it from coming back.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Docker Uses Disk on macOS
&lt;/h2&gt;

&lt;p&gt;Before we start cleaning, it helps to understand why Docker on macOS is a special kind of disk hog.&lt;/p&gt;

&lt;p&gt;Docker containers are Linux. macOS is not Linux. So Docker Desktop runs a lightweight Linux virtual machine behind the scenes, and all your images, containers, volumes, and build cache live inside that VM's virtual disk. That disk is a single file on your Mac — typically called &lt;code&gt;Docker.raw&lt;/code&gt; or &lt;code&gt;Docker.qcow2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here's the problem: the VM disk file is dynamically allocated. It grows as Docker stores more data inside it. But when you delete images or containers inside Docker, the VM disk file does not shrink. The space is freed inside the VM, but the file on your Mac stays the same size.&lt;/p&gt;

&lt;p&gt;This means Docker's disk usage on macOS is driven by two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;What's inside Docker&lt;/strong&gt; — images, containers, volumes, build cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The VM disk file itself&lt;/strong&gt; — which remembers its high-water mark&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You need to address both.&lt;/p&gt;




&lt;h2&gt;
  
  
  Finding How Much Space Docker Uses
&lt;/h2&gt;

&lt;p&gt;Start by asking Docker itself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system &lt;span class="nb"&gt;df&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows a breakdown by category:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          47        3         18.72GB   16.48GB (88%)
Containers      12        1         1.24GB    1.19GB (95%)
Local Volumes   23        2         8.31GB    7.89GB (95%)
Build Cache     184       0         14.2GB    14.2GB (100%)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's what Docker knows about. But it doesn't tell you the size of the VM disk file on your Mac's filesystem — which is often much larger than the sum of those numbers.&lt;/p&gt;

&lt;p&gt;To see the VM disk file size:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lh&lt;/span&gt; ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't be surprised if this file is 40-60GB even when &lt;code&gt;docker system df&lt;/code&gt; reports only 15-20GB of actual content.&lt;/p&gt;

&lt;p&gt;For a more detailed breakdown, add the verbose flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system &lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lists every image, container, and volume individually with sizes — useful for finding the worst offenders.&lt;/p&gt;




&lt;h2&gt;
  
  
  Images: Dangling and Unused
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What they are:&lt;/strong&gt; Every &lt;code&gt;docker pull&lt;/code&gt; and &lt;code&gt;docker build&lt;/code&gt; downloads or creates image layers. Over time, you accumulate images from projects you no longer work on, base images for stacks you've moved away from, and "dangling" images — intermediate layers that aren't tagged and aren't referenced by any other image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; 5-25GB easily. A single Node.js or Python image can be 1GB+. If you work across multiple projects with different base images, this stacks up fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to see them:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker images &lt;span class="nt"&gt;-a&lt;/span&gt;

&lt;span class="c"&gt;# Show only dangling images (untagged, unreferenced)&lt;/span&gt;
docker images &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"dangling=true"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to clean them:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Remove only dangling images (safe, minimal impact):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker image prune
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove all images not used by a running container (more aggressive, frees the most space):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker image prune &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be prompted to confirm. Add &lt;code&gt;-f&lt;/code&gt; to skip the confirmation prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Dangling images are always safe to remove — they're orphaned layers that serve no purpose. Unused images (the &lt;code&gt;-a&lt;/code&gt; flag) are also safe, but you'll need to re-pull them if you want to use them again. If you have a slow connection or work with large proprietary images, consider being selective.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Re-pulling is cheap:&lt;/strong&gt; For public images, &lt;code&gt;docker pull node:20&lt;/code&gt; takes 30 seconds on a decent connection. The disk space you save is worth more than the re-download time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Containers: Stopped and Dead
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What they are:&lt;/strong&gt; Every &lt;code&gt;docker run&lt;/code&gt; creates a container. When the process exits, the container stays on disk in a "stopped" state. It retains its filesystem layer (any files written during execution) and metadata. Most developers have dozens of stopped containers they've forgotten about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; Usually 100MB-2GB total, but containers that wrote large files (logs, databases, build artifacts) can individually be much larger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to see them:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps &lt;span class="nt"&gt;-a&lt;/span&gt;

&lt;span class="c"&gt;# Show only stopped containers&lt;/span&gt;
docker ps &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"status=exited"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to clean them:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker container prune
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes all containers with status &lt;code&gt;exited&lt;/code&gt;, &lt;code&gt;dead&lt;/code&gt;, or &lt;code&gt;created&lt;/code&gt; (never started).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; If a container is stopped and you don't plan to &lt;code&gt;docker start&lt;/code&gt; it again, yes. Any data not stored in a volume is lost when the container is removed — that's the point. If you need the data, copy it out first with &lt;code&gt;docker cp&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Volumes: Orphaned Data
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What they are:&lt;/strong&gt; Docker volumes are persistent storage that survives container removal. They're used for databases, file uploads, configuration — anything that should persist across container restarts. The problem is that volumes are not automatically deleted when the container that created them is removed.&lt;/p&gt;

&lt;p&gt;Over time, you accumulate "dangling" volumes — volumes that no running or stopped container references. These are pure dead weight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; 2-15GB. Database volumes (Postgres, MySQL, MongoDB) can individually be several GB. If you've been spinning up database containers for different projects, this adds up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to see them:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker volume &lt;span class="nb"&gt;ls&lt;/span&gt;

&lt;span class="c"&gt;# Show only dangling (unused) volumes&lt;/span&gt;
docker volume &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"dangling=true"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to clean them:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker volume prune
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes only dangling volumes — ones not referenced by any container (running or stopped).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Dangling volumes are by definition not attached to any container. But they may contain data you care about — old database dumps, uploaded files, test fixtures. If in doubt, inspect a volume before removing it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker volume inspect &amp;lt;volume_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the &lt;code&gt;Mountpoint&lt;/code&gt; path and verify what's inside if you're unsure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Volume data is not recoverable after deletion. Unlike images (which can be re-pulled) and containers (which can be re-run), volume data is gone forever. Be more careful here than with other categories.&lt;/p&gt;




&lt;h2&gt;
  
  
  Build Cache: The Silent Hog
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; Docker's BuildKit caches intermediate build steps so that subsequent builds are faster. Every &lt;code&gt;RUN&lt;/code&gt; instruction in your Dockerfile produces a cached layer. Over time — especially if you work with multiple projects or iterate frequently — this cache grows large.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 5-20GB is common. If you build large images (anything with native compilation, ML dependencies, or monorepos), the cache can exceed 30GB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to see it:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system &lt;span class="nb"&gt;df&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "Build Cache" row shows total size and how much is reclaimable. Usually 100% is reclaimable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker builder prune
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove all build cache including tagged intermediate results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker builder prune &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Completely. Build cache is a performance optimization, not data. Your next build will be slower (it has to re-execute cached steps), but everything still works. If you're not actively iterating on Docker builds, this is free space.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Nuclear Option
&lt;/h2&gt;

&lt;p&gt;If you want to clean everything at once — all unused images, all stopped containers, all dangling volumes, and all build cache — Docker provides a single command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system prune &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;--volumes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the "start fresh" button. It keeps only:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running containers&lt;/li&gt;
&lt;li&gt;Images used by running containers&lt;/li&gt;
&lt;li&gt;Volumes used by running containers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else is removed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt; When you haven't done a cleanup in months and don't have any stopped containers or images you need to preserve. I run this roughly quarterly and it typically frees 15-30GB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When NOT to use it:&lt;/strong&gt; If you have stopped containers with data you haven't extracted, or named volumes with database data you still need. Review &lt;code&gt;docker ps -a&lt;/code&gt; and &lt;code&gt;docker volume ls&lt;/code&gt; first.&lt;/p&gt;




&lt;h2&gt;
  
  
  Docker.raw: The File That Never Shrinks
&lt;/h2&gt;

&lt;p&gt;This is the part most guides skip, and it's usually the biggest chunk of wasted space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; The virtual disk file for Docker's Linux VM. All Docker data (images, containers, volumes, cache) lives inside this file. On macOS, it's typically at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on your Docker Desktop version and architecture, it might also be at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.raw
~/.docker/desktop/vms/0/data/Docker.raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The file format may be &lt;code&gt;.raw&lt;/code&gt; or &lt;code&gt;.qcow2&lt;/code&gt; depending on your Docker Desktop settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it's a problem:&lt;/strong&gt; Docker.raw uses sparse/dynamic allocation. It grows when Docker needs more space but does not automatically shrink when space is freed inside the VM. If your Docker usage peaked at 50GB at some point — even if you've since pruned everything — the file stays at 50GB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to check its size:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lh&lt;/span&gt; ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare this to what &lt;code&gt;docker system df&lt;/code&gt; reports. The difference is wasted space — freed inside the VM but not released back to macOS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to reclaim the space:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most reliable way to shrink Docker.raw is to reset the Docker Desktop VM:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Docker Desktop &amp;gt; Settings &amp;gt; Resources &amp;gt; Disk image size&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Note the current allocation&lt;/li&gt;
&lt;li&gt;Quit Docker Desktop completely&lt;/li&gt;
&lt;li&gt;Delete the disk image file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;rm&lt;/span&gt; ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start Docker Desktop — it creates a fresh, small disk image&lt;/li&gt;
&lt;li&gt;Re-pull only the images you actually need&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the most effective single action you can take. Going from a 50GB Docker.raw to a fresh 2GB one is a common outcome.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative — reduce the disk size limit:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Docker Desktop, go to &lt;strong&gt;Settings &amp;gt; Resources &amp;gt; Advanced&lt;/strong&gt; and lower the "Disk image size" slider. This sets the maximum size the VM disk can grow to. Reducing it from the default 64GB to 32GB (or whatever your actual usage requires) prevents future bloat.&lt;/p&gt;

&lt;p&gt;After reducing the limit, Docker Desktop may need to recreate the disk image. Back up any volumes you need before doing this.&lt;/p&gt;




&lt;h2&gt;
  
  
  Not Just Docker Desktop: Colima and OrbStack
&lt;/h2&gt;

&lt;p&gt;If you use Docker alternatives like Colima or OrbStack instead of Docker Desktop, you have the same VM disk problem — just in different locations:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Runtime&lt;/th&gt;
&lt;th&gt;Disk Image Path&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Docker Desktop&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Colima&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;~/.colima/default/colima.qcow2&lt;/code&gt; and &lt;code&gt;~/.colima/default/diffdisk&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OrbStack&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.orbstack/data/disk.img&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same cleanup principles apply: prune Docker content first, then address the VM disk file if it's oversized.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prevention: Keeping Docker Lean
&lt;/h2&gt;

&lt;p&gt;Cleaning up is good. Not accumulating junk in the first place is better.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Multi-Stage Builds
&lt;/h3&gt;

&lt;p&gt;Multi-stage Dockerfiles separate the build environment from the runtime environment. Your final image contains only what's needed to run — no compilers, no dev dependencies, no build artifacts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;node:20&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;builder&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package*.json ./&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm ci
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm run build

&lt;span class="c"&gt;# Runtime stage — small, only production dependencies&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:20-slim&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --from=builder /app/dist ./dist&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --from=builder /app/node_modules ./node_modules&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["node", "dist/index.js"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This alone can reduce image sizes from 1.5GB to 200MB.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use .dockerignore
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;.dockerignore&lt;/code&gt; file prevents large, irrelevant files from being copied into the Docker build context. Without it, Docker sends your entire project directory to the build daemon — including &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;.git&lt;/code&gt;, test fixtures, and anything else in the folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="err"&gt;node_modules&lt;/span&gt;
&lt;span class="err"&gt;.git&lt;/span&gt;
&lt;span class="err"&gt;*.md&lt;/span&gt;
&lt;span class="err"&gt;.env&lt;/span&gt;
&lt;span class="err"&gt;dist&lt;/span&gt;
&lt;span class="err"&gt;coverage&lt;/span&gt;
&lt;span class="err"&gt;.DS_Store&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Set Up a Prune Schedule
&lt;/h3&gt;

&lt;p&gt;Add a monthly cleanup to your calendar, or add it to your shell profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add to ~/.zshrc or ~/.bashrc&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;docker-cleanup&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'docker system prune -a --volumes -f &amp;amp;&amp;amp; echo "Docker cleanup complete"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use --rm for Temporary Containers
&lt;/h3&gt;

&lt;p&gt;When running containers you don't need to keep:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; ubuntu:22.04 bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--rm&lt;/code&gt; flag automatically removes the container when it exits — no stopped container left behind.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lower the Disk Size Limit
&lt;/h3&gt;

&lt;p&gt;In Docker Desktop settings, reduce the disk image size from the default 64GB to something reasonable for your workload. 32GB is enough for most developers. This caps the Docker.raw file growth.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Automated Way
&lt;/h2&gt;

&lt;p&gt;If you're reading this and thinking "I do not want to remember all these commands and run them manually every month" — I built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; for exactly this reason.&lt;/p&gt;

&lt;p&gt;MegaCleaner's Docker scanner covers all five categories described in this guide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker Images&lt;/strong&gt; — finds all images, flags dangling ones as definitely safe to remove&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Containers&lt;/strong&gt; — identifies stopped and exited containers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Volumes&lt;/strong&gt; — detects unused/orphaned volumes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Build Cache&lt;/strong&gt; — shows reclaimable build cache with exact sizes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VM Disk Files&lt;/strong&gt; — locates Docker.raw, qcow2, Colima, and OrbStack disk images and reports their sizes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It pulls data directly from the Docker CLI (same &lt;code&gt;docker images&lt;/code&gt;, &lt;code&gt;docker ps&lt;/code&gt;, &lt;code&gt;docker volume ls&lt;/code&gt;, and &lt;code&gt;docker system df&lt;/code&gt; commands described above) and presents everything in a single view with confidence levels: "definitely safe" for dangling images and build cache, "probably safe" for stopped containers and unused volumes, "verify first" for VM disk files.&lt;/p&gt;

&lt;p&gt;And Docker is just one of 29 scanners (21 developer tools + 8 system categories). If you're also running Xcode, node_modules, Python environments, Rust/Cargo, Homebrew, or any of the other tools developers accumulate — MegaCleaner scans all of them in seconds.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scanning is always free&lt;/strong&gt; — see the full breakdown before paying anything&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$49 one-time&lt;/strong&gt; — not a subscription&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everything goes to Trash&lt;/strong&gt; — fully undoable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Download at &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;megacleaner.app&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Reference: All Commands in One Block
&lt;/h2&gt;

&lt;p&gt;Bookmark this. You'll need it again in three months.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system &lt;span class="nb"&gt;df&lt;/span&gt;            &lt;span class="c"&gt;# Summary by category&lt;/span&gt;
docker system &lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt;         &lt;span class="c"&gt;# Detailed per-item breakdown&lt;/span&gt;

&lt;span class="c"&gt;# ── Clean by category ────────────────────────────────&lt;/span&gt;
docker image prune          &lt;span class="c"&gt;# Remove dangling images only&lt;/span&gt;
docker image prune &lt;span class="nt"&gt;-a&lt;/span&gt;       &lt;span class="c"&gt;# Remove ALL unused images&lt;/span&gt;
docker container prune      &lt;span class="c"&gt;# Remove stopped containers&lt;/span&gt;
docker volume prune         &lt;span class="c"&gt;# Remove orphaned volumes&lt;/span&gt;
docker builder prune        &lt;span class="c"&gt;# Remove build cache&lt;/span&gt;
docker builder prune &lt;span class="nt"&gt;-a&lt;/span&gt;     &lt;span class="c"&gt;# Remove ALL build cache&lt;/span&gt;

&lt;span class="c"&gt;# ── Nuclear option ───────────────────────────────────&lt;/span&gt;
docker system prune &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;--volumes&lt;/span&gt;   &lt;span class="c"&gt;# Remove everything unused&lt;/span&gt;

&lt;span class="c"&gt;# ── Check VM disk file size ──────────────────────────&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lh&lt;/span&gt; ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

&lt;span class="c"&gt;# ── Prevent container accumulation ───────────────────&lt;/span&gt;
docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &amp;lt;image&amp;gt; &amp;lt;cmd&amp;gt;   &lt;span class="c"&gt;# Auto-remove on exit&lt;/span&gt;

&lt;span class="c"&gt;# ── Clean alias (add to ~/.zshrc) ────────────────────&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;docker-cleanup&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'docker system prune -a --volumes -f'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Docker on macOS consumes disk through five channels: images, containers, volumes, build cache, and the VM disk file. The first four are standard Docker content that &lt;code&gt;docker system prune&lt;/code&gt; handles. The fifth — Docker.raw — is the one most people miss, and it's often the biggest offender because it never shrinks automatically.&lt;/p&gt;

&lt;p&gt;A full cleanup looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;docker system df&lt;/code&gt; to see the damage&lt;/li&gt;
&lt;li&gt;Prune each category (or use &lt;code&gt;docker system prune -a --volumes&lt;/code&gt; for everything)&lt;/li&gt;
&lt;li&gt;Check the Docker.raw file size — if it's much larger than your Docker content, reset it&lt;/li&gt;
&lt;li&gt;Lower the disk size limit in Docker Desktop settings to prevent future bloat&lt;/li&gt;
&lt;li&gt;Adopt prevention habits: multi-stage builds, .dockerignore, &lt;code&gt;--rm&lt;/code&gt; flag, regular prune schedules&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do this quarterly and Docker will never silently eat 50GB of your disk again. Or scan with &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; and handle it in under a minute.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Your Dev Tools Are Why Your Mac is Full. Here's How to Reclaim 50-100GB</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 13:15:08 +0000</pubDate>
      <link>https://forem.com/nixeton/your-dev-tools-are-why-your-mac-is-full-heres-how-to-reclaim-50-100gb-3n8b</link>
      <guid>https://forem.com/nixeton/your-dev-tools-are-why-your-mac-is-full-heres-how-to-reclaim-50-100gb-3n8b</guid>
      <description>&lt;p&gt;Last year I got a new MacBook Pro. 512GB SSD. I figured that was plenty — I'm not storing raw video footage or anything. I write code.&lt;/p&gt;

&lt;p&gt;Four months later, macOS told me I was running low on disk space.&lt;/p&gt;

&lt;p&gt;I opened System Settings &amp;gt; Storage and stared at the breakdown. "Developer" was the single largest category, bigger than my music library, photos, and documents combined. But macOS doesn't tell you &lt;em&gt;what&lt;/em&gt; in that category is eating the space. It just shows you a gray bar and shrugs.&lt;/p&gt;

&lt;p&gt;So I started digging. I opened Terminal and started checking folder sizes manually. What I found was staggering: over 200GB of cached build artifacts, old container images, orphaned virtual environments, and dependency folders for projects I hadn't touched in months.&lt;/p&gt;

&lt;p&gt;That investigation — and the frustration of repeating it every few months — is why I eventually built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt;. But before I talk about that, let me show you exactly where your disk space is going. Because once you see the numbers, you'll understand why a 512GB Mac fills up in months, not years.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Problem: Dev Tools Cache Everything, Clean Up Nothing
&lt;/h2&gt;

&lt;p&gt;Here's the pattern every developer tool follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download&lt;/strong&gt; dependencies, SDKs, container images, or runtimes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache&lt;/strong&gt; compiled artifacts, build products, and intermediate files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never delete any of it&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There's no malice here. Build caches make your second compile faster. Docker keeps old images around in case you need them. npm doesn't delete &lt;code&gt;node_modules&lt;/code&gt; from abandoned projects. Each tool is individually rational.&lt;/p&gt;

&lt;p&gt;But collectively? You're running 8-12 development tools, each maintaining its own cache, and none of them coordinate with each other or with the OS. Nobody's watching the total. Nobody's cleaning up.&lt;/p&gt;

&lt;p&gt;The result: your 512GB SSD fills up with data that's 80% regenerable and 100% invisible.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Full Breakdown: Where Developer Disk Space Actually Goes
&lt;/h2&gt;

&lt;p&gt;I've spent months cataloging this. Here's what eats your disk, roughly ordered by how much damage each tool typically does.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Xcode — 30-100GB
&lt;/h3&gt;

&lt;p&gt;Xcode is the undisputed champion of disk waste on macOS. If you do any iOS, macOS, watchOS, or visionOS development, Xcode alone can consume more storage than everything else on this list combined.&lt;/p&gt;

&lt;p&gt;The main offenders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DerivedData&lt;/strong&gt; (&lt;code&gt;~/Library/Developer/Xcode/DerivedData/&lt;/code&gt;) — 10-50GB. Every project gets its own build cache folder, and Xcode never removes them. Projects you archived six months ago? Still cached.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simulator Runtimes&lt;/strong&gt; (&lt;code&gt;~/Library/Developer/CoreSimulator/&lt;/code&gt;) — 20-150GB. Each iOS version you've ever tested against downloads a 5-8GB simulator runtime. Have you tested on iOS 17, 18, and 26? That's potentially 20-30GB in runtimes alone, before counting device data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Archives&lt;/strong&gt; (&lt;code&gt;~/Library/Developer/Xcode/Archives/&lt;/code&gt;) — 5-30GB. Every time you build for distribution, Xcode saves a complete archive with debug symbols.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Device Support&lt;/strong&gt; (&lt;code&gt;~/Library/Developer/Xcode/iOS DeviceSupport/&lt;/code&gt;) — 10-40GB. Debug symbols for every physical device you've ever plugged in, organized by iOS version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wrote a &lt;a href="https://dev.to/nixeton/how-to-clean-up-xcode-and-free-30-50gb-on-your-mac-3ogh"&gt;detailed Xcode cleanup guide&lt;/a&gt; if you want the full breakdown with exact paths and safety levels.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/DerivedData/&lt;span class="k"&gt;*&lt;/span&gt;
xcrun simctl delete unavailable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These two commands alone can reclaim 15-40GB with zero risk.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Docker — 10-100GB
&lt;/h3&gt;

&lt;p&gt;Docker on macOS runs inside a Linux VM, which stores everything in a single disk image file. This file only grows — it never shrinks on its own, even when you delete containers and images.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker.raw / Docker.qcow2&lt;/strong&gt; (&lt;code&gt;~/Library/Containers/com.docker.docker/Data/vms/&lt;/code&gt;) — the VM disk image. Starts at a few GB, grows to 20-60GB or more. Even after pruning images, the file doesn't reclaim the space without a manual reclaim operation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build cache&lt;/strong&gt; — Docker's layer cache for builds can silently grow to 10-50GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dangling images&lt;/strong&gt; — images with no tag, left behind after rebuilds. Usually 2-10GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stopped containers&lt;/strong&gt; — containers you ran once and forgot about, along with their writable layers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system prune &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;--volumes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes all stopped containers, unused images, build cache, and orphaned volumes. On a Mac that's been running Docker for 6+ months, this routinely frees 10-30GB. But remember — the &lt;code&gt;.raw&lt;/code&gt; file won't shrink immediately. Docker Desktop has a "Reclaim disk space" button in Settings &amp;gt; Resources that triggers a filesystem trim.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. node_modules — 5-50GB
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;node_modules&lt;/code&gt; folder is a running joke in the developer community for a reason. A single React project can have a &lt;code&gt;node_modules&lt;/code&gt; folder exceeding 500MB. If you have 20 projects on your machine — even ones you haven't touched in a year — that's 10GB+ of duplicated dependencies sitting in forgotten directories.&lt;/p&gt;

&lt;p&gt;The problem compounds because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every project gets its own complete copy of every dependency&lt;/li&gt;
&lt;li&gt;npm and yarn also maintain global caches (&lt;code&gt;~/.npm&lt;/code&gt;, &lt;code&gt;~/.yarn/cache&lt;/code&gt;) — another 1-5GB&lt;/li&gt;
&lt;li&gt;Projects you cloned once to review a PR and never deleted still have their &lt;code&gt;node_modules&lt;/code&gt; intact&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Find all node_modules folders and their sizes&lt;/span&gt;
find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 &lt;span class="nt"&gt;-prune&lt;/span&gt; &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then delete the ones in projects you haven't touched recently. Or use &lt;a href="https://github.com/voidcosmos/npkill" rel="noopener noreferrer"&gt;&lt;code&gt;npkill&lt;/code&gt;&lt;/a&gt; for an interactive cleanup.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Python — 5-30GB
&lt;/h3&gt;

&lt;p&gt;Python's storage footprint sneaks up on you through multiple independent channels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Virtual environments&lt;/strong&gt; — every project with a &lt;code&gt;venv/&lt;/code&gt; or &lt;code&gt;.venv/&lt;/code&gt; folder has its own copy of the Python interpreter plus all installed packages. Each venv is typically 200MB-2GB. Across 10-15 projects, that's 5-20GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conda environments&lt;/strong&gt; — if you use conda, each environment can be 1-5GB. Conda also maintains a package cache (&lt;code&gt;~/miniconda3/pkgs/&lt;/code&gt; or &lt;code&gt;~/anaconda3/pkgs/&lt;/code&gt;) that grows indefinitely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pip cache&lt;/strong&gt; (&lt;code&gt;~/Library/Caches/pip/&lt;/code&gt;) — downloaded wheel files for every package you've ever installed. Usually 1-3GB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clean pip cache&lt;/span&gt;
pip cache purge

&lt;span class="c"&gt;# List conda environments and their sizes&lt;/span&gt;
conda info &lt;span class="nt"&gt;--envs&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/miniconda3/envs/&lt;span class="k"&gt;*&lt;/span&gt;/

&lt;span class="c"&gt;# Remove conda cache&lt;/span&gt;
conda clean &lt;span class="nt"&gt;--all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Rust — 5-50GB
&lt;/h3&gt;

&lt;p&gt;Rust's compile times are famously long, and its build artifacts are famously large. Each project's &lt;code&gt;target/&lt;/code&gt; directory contains compiled binaries, intermediate artifacts, and debug symbols. A single Rust project's &lt;code&gt;target/&lt;/code&gt; folder can easily reach 5-15GB.&lt;/p&gt;

&lt;p&gt;Then there's the Cargo registry and cache:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;~/.cargo/registry/&lt;/code&gt; — source code of every crate you've ever depended on&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~/.cargo/git/&lt;/code&gt; — git checkouts of dependencies that reference git repos&lt;/li&gt;
&lt;li&gt;Per-project &lt;code&gt;target/&lt;/code&gt; folders — the real space killers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you work on 3-5 Rust projects, you can easily have 20-40GB in &lt;code&gt;target/&lt;/code&gt; directories alone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clean a specific project&lt;/span&gt;
cargo clean

&lt;span class="c"&gt;# Find all target/ directories&lt;/span&gt;
find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"target"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 4 &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"{}/CACHEDIR.TAG"&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; &lt;span class="nt"&gt;-print&lt;/span&gt; &lt;span class="nt"&gt;-prune&lt;/span&gt; 2&amp;gt;/dev/null | xargs &lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. Homebrew — 2-10GB
&lt;/h3&gt;

&lt;p&gt;Homebrew keeps old versions of installed packages around as a courtesy (so you can roll back). It also caches downloaded bottles in &lt;code&gt;~/Library/Caches/Homebrew/&lt;/code&gt;. Over time, this adds up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Remove old versions and cache&lt;/span&gt;
brew cleanup &lt;span class="nt"&gt;--prune&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;all

&lt;span class="c"&gt;# See how much space Homebrew is using&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--cache&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--cellar&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. IDE Caches — 1-5GB per IDE
&lt;/h3&gt;

&lt;p&gt;Your IDE has its own set of caches, separate from the build system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code&lt;/strong&gt; — extensions, cached data, logs. Lives in &lt;code&gt;~/Library/Application Support/Code/&lt;/code&gt; and &lt;code&gt;~/.vscode/extensions/&lt;/code&gt;. Usually 1-3GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JetBrains IDEs&lt;/strong&gt; (IntelliJ, PyCharm, WebStorm, etc.) — indexes, local history, caches. Stored in &lt;code&gt;~/Library/Caches/JetBrains/&lt;/code&gt; and &lt;code&gt;~/Library/Application Support/JetBrains/&lt;/code&gt;. Each IDE version creates its own folder, and old versions are never cleaned up. 2-5GB per IDE is normal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt; Delete cache folders for IDE versions you've already upgraded past (e.g., &lt;code&gt;IntelliJIdea2024.3&lt;/code&gt; when you're running &lt;code&gt;2025.1&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Java/Gradle/Maven — 5-20GB
&lt;/h3&gt;

&lt;p&gt;The JVM ecosystem's dependency management creates two major cache locations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Maven local repository&lt;/strong&gt; (&lt;code&gt;~/.m2/repository/&lt;/code&gt;) — every JAR you've ever depended on. Grows to 2-10GB over time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gradle cache&lt;/strong&gt; (&lt;code&gt;~/.gradle/caches/&lt;/code&gt;) — build outputs, dependency cache, wrapper distributions. 3-15GB is common.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gradle wrapper distributions&lt;/strong&gt; (&lt;code&gt;~/.gradle/wrapper/dists/&lt;/code&gt;) — full copies of Gradle itself, one per version. Each is ~150MB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick win:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Gradle: remove old caches&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.gradle/caches/
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.gradle/wrapper/dists/

&lt;span class="c"&gt;# Maven: remove the local repo (re-downloads on next build)&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.m2/repository/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9. The Long Tail
&lt;/h3&gt;

&lt;p&gt;Several other tools contribute smaller but meaningful amounts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Go&lt;/strong&gt; — &lt;code&gt;~/go/pkg/mod/&lt;/code&gt; for module cache, &lt;code&gt;~/go/bin/&lt;/code&gt; for installed binaries. Typically 1-5GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ruby&lt;/strong&gt; — gem caches in &lt;code&gt;~/.gem/&lt;/code&gt; or managed by rbenv/rvm. 1-3GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP&lt;/strong&gt; — Composer cache in &lt;code&gt;~/.composer/cache/&lt;/code&gt;. Usually under 1GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;.NET&lt;/strong&gt; — NuGet cache in &lt;code&gt;~/.nuget/packages/&lt;/code&gt;. 1-5GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terraform&lt;/strong&gt; — &lt;code&gt;.terraform/&lt;/code&gt; directories in every project with their own copy of provider binaries. Each provider is 100-500MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playwright&lt;/strong&gt; — downloads full browser binaries (Chromium, Firefox, WebKit) per version. Each set is ~1GB, and old versions aren't automatically removed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flutter/Dart&lt;/strong&gt; — pub cache in &lt;code&gt;~/.pub-cache/&lt;/code&gt;, plus the Flutter SDK itself is ~2GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android SDK&lt;/strong&gt; — emulator images, build tools, platform tools. Lives in &lt;code&gt;~/Library/Android/sdk/&lt;/code&gt;. Can reach 10-30GB on its own.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Individually, none of these are catastrophic. Together, they add another 5-20GB of invisible cache.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Generic Mac Cleaners Miss All of This
&lt;/h2&gt;

&lt;p&gt;I tried CleanMyMac and other popular cleaners before building my own tool. They're good at what they do — finding system caches, language files, old log files, mail attachments. But they have no idea what &lt;code&gt;DerivedData&lt;/code&gt; is. They don't know that &lt;code&gt;~/Library/Developer/CoreSimulator/Devices/&lt;/code&gt; contains 50GB of old simulator runtimes. They'll never scan your home directory for orphaned &lt;code&gt;node_modules&lt;/code&gt; folders or stale Python virtual environments.&lt;/p&gt;

&lt;p&gt;Generic cleaners are built for general Mac users. They look for browser caches, system logs, and application leftovers. Developer tools live in completely different locations, use different caching strategies, and require different safety assessments. Deleting &lt;code&gt;~/Library/Caches/com.apple.Safari/&lt;/code&gt; is straightforward. Deciding whether a Docker image is still needed requires understanding the tool's context.&lt;/p&gt;

&lt;p&gt;This gap between "general Mac cleanup" and "developer-specific cleanup" is where 50-100GB of reclaimable space hides — and where most developers end up manually running Terminal commands every few months.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Did About It
&lt;/h2&gt;

&lt;p&gt;After the third time I found myself spending an hour running &lt;code&gt;du -sh&lt;/code&gt; on various Library directories and Googling "is it safe to delete Xcode archives," I decided to automate the whole process.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; — a native macOS app with 29 scanners (21 for developer tools, 8 for general system cleanup) that knows exactly where each tool stores its caches and which files are safe to remove.&lt;/p&gt;

&lt;p&gt;The 21 developer tool scanners cover everything in this article: Xcode (with its sub-categories), Docker, node_modules, Python, Rust, Homebrew, IDE caches, Java/Gradle, CocoaPods, Swift Package Manager, Git repos, Go, Ruby, PHP, .NET, Android, Flutter/Dart, C/C++, Terraform, and Playwright. The 8 general scanners handle browser data, system caches, downloads, Trash, mail attachments, app leftovers, iOS device backups, and log files.&lt;/p&gt;

&lt;p&gt;A few design decisions I'm proud of:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three confidence levels.&lt;/strong&gt; Every scannable item gets a confidence rating — "definite" (DerivedData, pip cache — always safe), "probable" (old archives, unused simulators — almost certainly safe), or "possible" (items that need your judgment). You can filter by confidence so you only clean what you're comfortable with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Moves to Trash, not permanent delete.&lt;/strong&gt; Everything MegaCleaner removes goes to your Trash. Changed your mind? Pull it back out. This was non-negotiable for me — when a tool offers to delete 80GB of data, "undo" needs to exist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free to scan, pay to clean.&lt;/strong&gt; You can run a full scan and see exactly how much space each tool is wasting before spending anything. The scan itself often teaches you things about your system you didn't know. Cleaning requires a license — $49 one-time, not a subscription.&lt;/p&gt;

&lt;p&gt;I built MegaCleaner because I needed it. If you're a developer whose Mac is perpetually full, &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;give the scan a try&lt;/a&gt;. At minimum, you'll learn where your space is going.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Wins: 5 Commands to Reclaim the Most Space Right Now
&lt;/h2&gt;

&lt;p&gt;If you don't want to install anything and just want to reclaim space immediately, here are the five highest-impact commands. Run them in Terminal:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Nuke Xcode DerivedData (10-50GB)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/DerivedData/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero risk. Everything rebuilds on next compile.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Remove old Xcode simulators (5-30GB)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl delete unavailable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Removes simulators for iOS versions your current Xcode no longer supports.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Prune Docker (10-30GB)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system prune &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;--volumes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Removes all stopped containers, unused images, and orphaned volumes. Run with care if you have images you want to keep — this removes everything not currently in use.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Find and kill old node_modules (5-20GB)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~ &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 5 &lt;span class="nt"&gt;-prune&lt;/span&gt; &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-hr&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows your 20 largest &lt;code&gt;node_modules&lt;/code&gt; folders. Delete the ones in projects you haven't touched recently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /path/to/old-project/node_modules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Clean package manager caches (2-10GB)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Homebrew&lt;/span&gt;
brew cleanup &lt;span class="nt"&gt;--prune&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;all

&lt;span class="c"&gt;# pip&lt;/span&gt;
pip cache purge

&lt;span class="c"&gt;# npm&lt;/span&gt;
npm cache clean &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Combined, these five steps typically reclaim &lt;strong&gt;30-100GB&lt;/strong&gt; on a Mac that's been used for development for 6+ months. No tools required, no cost, just Terminal commands and 10 minutes of your time.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Bigger Picture
&lt;/h2&gt;

&lt;p&gt;Your Mac isn't broken. Apple didn't sell you insufficient storage. The problem is that modern software development involves a dozen tools, each maintaining its own caches, and none of them talk to each other about total disk usage.&lt;/p&gt;

&lt;p&gt;A 512GB Mac is fine for development — as long as you periodically clean up. The choice is between doing it manually (bookmarking this article and revisiting it quarterly), automating it (with &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; or scripts), or buying a 1TB Mac next time and kicking the can down the road.&lt;/p&gt;

&lt;p&gt;I chose to automate it. Whatever you choose, at least now you know where the space is going.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CleanMyMac vs MegaCleaner: Why Generic Cleaners Miss 80% of Developer Bloat</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Wed, 29 Apr 2026 13:07:14 +0000</pubDate>
      <link>https://forem.com/nixeton/cleanmymac-vs-megacleaner-why-generic-cleaners-miss-80-of-developer-bloat-2hgb</link>
      <guid>https://forem.com/nixeton/cleanmymac-vs-megacleaner-why-generic-cleaners-miss-80-of-developer-bloat-2hgb</guid>
      <description>&lt;p&gt;You're a developer. Your Mac says you have 15GB free. You download CleanMyMac, run a scan, and it proudly offers to clean 4.7GB of system caches and browser data. You clean it. The number barely moves. Meanwhile, you have 40GB of stale &lt;code&gt;node_modules&lt;/code&gt; folders, 25GB of Xcode DerivedData, 18GB of Docker images you forgot about, and 8GB of Rust &lt;code&gt;target/&lt;/code&gt; directories scattered across old projects.&lt;/p&gt;

&lt;p&gt;That's not CleanMyMac's fault. It was never designed to find those things. It's a general-purpose Mac cleaner built for everyone — your parents, your coworkers in marketing, your friend who just wants their MacBook to stop saying "Your disk is almost full."&lt;/p&gt;

&lt;p&gt;But as a developer, your storage problem is fundamentally different. Most of your disk bloat comes from tools that generic cleaners don't even know exist.&lt;/p&gt;

&lt;p&gt;This article is a fair, honest comparison of CleanMyMac, &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt;, DevCleaner for Xcode, and DaisyDisk. Each has real strengths. The right choice depends on who you are and what's eating your disk.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Developer Disks Are Different
&lt;/h2&gt;

&lt;p&gt;A typical Mac user's storage problem is old photos, browser cache, duplicate files, forgotten app data. Generic cleaners handle this well — they scan &lt;code&gt;~/Library/Caches&lt;/code&gt;, system temp files, browser data, mail attachments, and old logs. That covers 90% of Mac users.&lt;/p&gt;

&lt;p&gt;A developer's storage problem is fundamentally different:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Typical Size&lt;/th&gt;
&lt;th&gt;What Creates It&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Xcode DerivedData&lt;/td&gt;
&lt;td&gt;10-50 GB&lt;/td&gt;
&lt;td&gt;Every build of every project, forever&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;iOS Simulators &amp;amp; Runtimes&lt;/td&gt;
&lt;td&gt;20-150 GB&lt;/td&gt;
&lt;td&gt;Each iOS version = 5-8 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;node_modules&lt;/code&gt; directories&lt;/td&gt;
&lt;td&gt;10-60 GB&lt;/td&gt;
&lt;td&gt;Every JS/TS project, often duplicated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker images &amp;amp; volumes&lt;/td&gt;
&lt;td&gt;10-50 GB&lt;/td&gt;
&lt;td&gt;Docker.raw grows silently&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cargo &lt;code&gt;target/&lt;/code&gt; folders&lt;/td&gt;
&lt;td&gt;5-30 GB&lt;/td&gt;
&lt;td&gt;Rust builds are notoriously large&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Python venvs &amp;amp; conda envs&lt;/td&gt;
&lt;td&gt;5-20 GB&lt;/td&gt;
&lt;td&gt;Forgotten environments accumulate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gradle/Maven caches&lt;/td&gt;
&lt;td&gt;3-15 GB&lt;/td&gt;
&lt;td&gt;Java/Android build caches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Homebrew cache&lt;/td&gt;
&lt;td&gt;2-10 GB&lt;/td&gt;
&lt;td&gt;Downloaded bottles and logs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IDE caches&lt;/td&gt;
&lt;td&gt;2-10 GB&lt;/td&gt;
&lt;td&gt;VS Code, JetBrains, Zed extensions/cache&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Total developer-specific bloat: 60-300+ GB.&lt;/strong&gt; This is space that CleanMyMac, by design, does not scan.&lt;/p&gt;

&lt;p&gt;These aren't "system junk" — they're the byproducts of development tools. Scanning them requires knowing what each tool creates, where it stores data, and what's safe to delete. That's the gap &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; was built to fill.&lt;/p&gt;




&lt;h2&gt;
  
  
  What CleanMyMac Actually Does Well
&lt;/h2&gt;

&lt;p&gt;Before comparing, CleanMyMac deserves its credit. &lt;a href="https://macpaw.com/cleanmymac" rel="noopener noreferrer"&gt;MacPaw&lt;/a&gt; has been building it for over a decade, and it's a polished product. It organizes its tools into five categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cleanup&lt;/strong&gt; — System junk, old caches, broken downloads, mail attachments, language files, and about 20 other categories of system-level waste.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protection&lt;/strong&gt; — A proprietary malware scanner that MacPaw claims detects 99% of macOS-specific threats. This is a real feature with a continuously updated threat database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt; — Maintenance scripts, DNS cache clearing, Spotlight re-indexing, login item management, RAM optimization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Applications&lt;/strong&gt; — Full app uninstaller that finds and removes leftover files when you drag an app to Trash. Also identifies old, unused applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My Clutter&lt;/strong&gt; — Finds large and old files across your system and helps you decide what to keep.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For general Mac maintenance, this is a strong package. The malware scanner and app uninstaller are genuinely useful features that most competing tools don't offer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it stops:&lt;/strong&gt; CleanMyMac treats your Mac as a consumer device. It doesn't know that &lt;code&gt;~/Library/Developer/Xcode/DerivedData&lt;/code&gt; contains build caches, that &lt;code&gt;~/.cargo/registry&lt;/code&gt; is a package cache, or that 47 &lt;code&gt;node_modules&lt;/code&gt; folders scattered across your home directory are safe to delete. It may catch some of these under "System Junk," but it won't systematically find, categorize, or explain them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What MegaCleaner Does Differently
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; approaches the problem from the opposite direction. It was built by a developer (me — I'm the solo founder), specifically because I kept running out of disk space and no existing tool could find what was actually using it.&lt;/p&gt;

&lt;p&gt;MegaCleaner has 29 scanners: 21 for developer tools and 8 for general system cleaning.&lt;/p&gt;

&lt;h3&gt;
  
  
  The 21 Developer Tool Scanners
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Xcode&lt;/strong&gt; — DerivedData, simulators, archives, device support, documentation cache, old Xcode versions (6 sub-categories)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CocoaPods&lt;/strong&gt; — Pod cache and spec repositories&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swift Package Manager&lt;/strong&gt; — Build artifacts and package cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker&lt;/strong&gt; — Images, containers, volumes, build cache, Desktop VM (Docker.raw)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Homebrew&lt;/strong&gt; — Bottle cache, downloads, logs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;node_modules&lt;/strong&gt; — Recursive discovery across all projects, plus npm/yarn/pnpm/bun caches, duplicate detection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; — Virtual environments, conda environments, pip cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rust/Cargo&lt;/strong&gt; — Registry cache, &lt;code&gt;target/&lt;/code&gt; directories across all projects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Go&lt;/strong&gt; — Module cache, build artifacts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Java&lt;/strong&gt; — Maven &lt;code&gt;.m2&lt;/code&gt; cache, Gradle caches&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android&lt;/strong&gt; — SDK components, emulator images, build cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flutter/Dart&lt;/strong&gt; — Flutter cache, Dart package cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;C/C++&lt;/strong&gt; — CMake build artifacts, Conan package cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;.NET&lt;/strong&gt; — NuGet cache, build artifacts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP&lt;/strong&gt; — Composer cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ruby&lt;/strong&gt; — Gem cache, Bundler cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git Repositories&lt;/strong&gt; — Duplicate repos, repository history bloat&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git Worktrees&lt;/strong&gt; — Forgotten/orphaned worktrees&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IDE Caches&lt;/strong&gt; — VS Code, JetBrains (IntelliJ, WebStorm, etc.), Sublime Text, Zed, Vim/Neovim&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playwright&lt;/strong&gt; — Browser downloads and test cache&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terraform&lt;/strong&gt; — &lt;code&gt;.terraform&lt;/code&gt; directories with provider binaries&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The 8 General Scanners
&lt;/h3&gt;

&lt;p&gt;Browser cache, system caches and logs, downloads folder, Trash, Mail data, orphaned app data, iOS backups, and log files. These overlap somewhat with what CleanMyMac does, though with less depth in this category.&lt;/p&gt;

&lt;h3&gt;
  
  
  Confidence Levels
&lt;/h3&gt;

&lt;p&gt;Every item MegaCleaner finds is tagged with one of three confidence levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definite&lt;/strong&gt; — 100% safe to delete. DerivedData, caches, temp files. These regenerate automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Probable&lt;/strong&gt; — Very likely safe. Old archives, stale dependencies, unused simulator runtimes. Reasonable to delete, but worth a glance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Possible&lt;/strong&gt; — User should verify. Large files in ambiguous locations, old project directories, things that might matter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This matters because developer files aren't all equal. Deleting DerivedData has zero risk — it rebuilds in minutes. Deleting an Xcode archive for a build that's currently in the App Store review queue would be a problem. The confidence system lets you clean aggressively on "definite" items and make informed decisions on everything else.&lt;/p&gt;




&lt;h2&gt;
  
  
  Head-to-Head Comparison
&lt;/h2&gt;

&lt;p&gt;Here's the full feature comparison across four tools. I'm including DevCleaner for Xcode and DaisyDisk because they come up in every "best Mac cleaner" discussion and serve specific niches well.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;MegaCleaner&lt;/th&gt;
&lt;th&gt;CleanMyMac&lt;/th&gt;
&lt;th&gt;DevCleaner for Xcode&lt;/th&gt;
&lt;th&gt;DaisyDisk&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Price&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$49 one-time&lt;/td&gt;
&lt;td&gt;~$40/yr subscription or ~$196 one-time&lt;/td&gt;
&lt;td&gt;Free (open source)&lt;/td&gt;
&lt;td&gt;$10 one-time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pricing model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;One-time purchase&lt;/td&gt;
&lt;td&gt;Subscription or one-time&lt;/td&gt;
&lt;td&gt;Free (GPL-3)&lt;/td&gt;
&lt;td&gt;One-time purchase&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Free scanning&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes — scan free, pay to clean&lt;/td&gt;
&lt;td&gt;No — requires license&lt;/td&gt;
&lt;td&gt;Fully free&lt;/td&gt;
&lt;td&gt;Scan free, no cleaning engine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dev tool scanners&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;21 tools (Xcode, Docker, npm, Python, Rust, Go, Java, etc.)&lt;/td&gt;
&lt;td&gt;No dev-specific scanning&lt;/td&gt;
&lt;td&gt;Xcode only (6 categories)&lt;/td&gt;
&lt;td&gt;None — disk visualizer only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;General cleaning&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8 scanners (browser, system cache, downloads, etc.)&lt;/td&gt;
&lt;td&gt;20+ categories, very thorough&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;None — shows files, manual deletion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Confidence/safety levels&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3 tiers (definite, probable, possible)&lt;/td&gt;
&lt;td&gt;No per-item safety rating&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Malware scanning&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes — proprietary engine, continuously updated&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;App uninstaller&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes — finds app leftovers&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Disk visualization&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes — interactive sunburst map&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance tools&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes — RAM, DNS, login items, maintenance scripts&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deletion method&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Move to Trash (undoable)&lt;/td&gt;
&lt;td&gt;Permanent delete&lt;/td&gt;
&lt;td&gt;Permanent delete&lt;/td&gt;
&lt;td&gt;Manual (Finder)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Native macOS app&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes (Swift/SwiftUI)&lt;/td&gt;
&lt;td&gt;Yes (Objective-C/Swift)&lt;/td&gt;
&lt;td&gt;Yes (Swift)&lt;/td&gt;
&lt;td&gt;Yes (Objective-C)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Open source&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes (GPL-3)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;macOS requirement&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;14.0+ (Sonoma)&lt;/td&gt;
&lt;td&gt;13.0+ (Ventura)&lt;/td&gt;
&lt;td&gt;12.0+ (Monterey)&lt;/td&gt;
&lt;td&gt;10.13+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Team behind it&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Solo developer&lt;/td&gt;
&lt;td&gt;MacPaw (200+ employees)&lt;/td&gt;
&lt;td&gt;Solo developer&lt;/td&gt;
&lt;td&gt;Software Ambiance (small team)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A few notes on this table:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CleanMyMac's pricing is complex.&lt;/strong&gt; The subscription runs roughly $40/year for one Mac. The one-time purchase (~$196) only covers the current major version — future major releases require a new purchase. Multi-Mac plans are available at higher prices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DevCleaner is genuinely free and good&lt;/strong&gt; — if Xcode is your only concern. It covers DerivedData, simulators, archives, device support, and documentation caches. Open source (GPL-3), on the Mac App Store. The limitation is scope: it doesn't touch Docker, node_modules, Python, Rust, or any non-Xcode tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DaisyDisk is a different category.&lt;/strong&gt; It's a disk space visualizer, not a cleaner — a beautiful interactive map of what's using your disk, at $10 one-time. But it doesn't know what any file is. You need domain knowledge to decide what's safe to delete.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where CleanMyMac Wins
&lt;/h2&gt;

&lt;p&gt;Let's be honest about what CleanMyMac does better than MegaCleaner:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Malware scanning.&lt;/strong&gt; MegaCleaner doesn't scan for malware at all. CleanMyMac has a proprietary anti-malware engine with a continuously updated threat database. If you want malware protection bundled with your cleaning tool, CleanMyMac is the only option here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App uninstaller.&lt;/strong&gt; When you drag an app to Trash on macOS, it leaves behind preferences, caches, login items, and support files scattered across &lt;code&gt;~/Library&lt;/code&gt;. CleanMyMac finds and removes all of that. MegaCleaner doesn't have an app uninstaller.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;General system cleaning depth.&lt;/strong&gt; A decade of refinement with a large team shows. CleanMyMac catches more types of system junk and offers more granular control over language files, old logs, and similar items. MegaCleaner's 8 general scanners cover the basics but don't go as deep.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance and maintenance tools.&lt;/strong&gt; RAM freeing, DNS cache flushing, Spotlight re-indexing, login item management — CleanMyMac bundles a full system utility suite. MegaCleaner is purely a disk cleaner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Polish and track record.&lt;/strong&gt; MacPaw has 200+ employees and millions of users. The UI is refined, the documentation is extensive. MegaCleaner is a solo-developer product — functional and clean, but newer and less proven.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where MegaCleaner Wins
&lt;/h2&gt;

&lt;p&gt;Now the other side:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Developer tool intelligence.&lt;/strong&gt; This is the core differentiator. 21 dedicated scanners that understand the structure and safety characteristics of each tool's output. MegaCleaner knows that &lt;code&gt;DerivedData&lt;/code&gt; is always safe but Xcode archives might not be, that &lt;code&gt;node_modules&lt;/code&gt; can be regenerated with &lt;code&gt;npm install&lt;/code&gt;, and that Docker.raw can be reclaimed but active containers shouldn't be removed. CleanMyMac has no equivalent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Confidence levels.&lt;/strong&gt; Every item MegaCleaner finds is categorized as "definite," "probable," or "possible" for deletion safety. This gives you the information to make smart decisions without needing to research each file path yourself. No other tool in this comparison offers this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-time pricing.&lt;/strong&gt; $49, once, forever. No subscription, no annual renewal, no "this version only" restrictions. CleanMyMac's subscription means paying ~$40/year indefinitely, and their "one-time" purchase only covers the current major version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free scanning.&lt;/strong&gt; Download MegaCleaner, scan your entire system, see exactly how much space each dev tool is wasting — all without paying. The license is only required to clean. Verify the value before spending a dollar.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Move to Trash, not permanent delete.&lt;/strong&gt; MegaCleaner sends everything to Trash instead of permanently deleting. Need something back? It's recoverable. CleanMyMac permanently deletes by default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Built for developers, by a developer.&lt;/strong&gt; I built MegaCleaner because I had this exact problem — working across Swift, TypeScript, Rust, Python, and Go, tired of running &lt;code&gt;du -sh&lt;/code&gt; commands to find what was eating my disk. Every scanner exists because it solves a real problem I've hit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who Should Use What
&lt;/h2&gt;

&lt;p&gt;Here's a simple decision framework:&lt;/p&gt;

&lt;h3&gt;
  
  
  You're not a developer
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use CleanMyMac.&lt;/strong&gt; It's the best general-purpose Mac cleaner available. The malware scanning, app uninstaller, and system maintenance tools are genuinely useful for everyday Mac users. MegaCleaner's developer scanners would find nothing relevant on your machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  You're an iOS/Swift developer and Xcode is your only concern
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Start with DevCleaner for Xcode.&lt;/strong&gt; It's free, open source, and covers Xcode storage categories well. If you find yourself wanting more — scanning Docker, node_modules, or other tools — then look at MegaCleaner.&lt;/p&gt;

&lt;h3&gt;
  
  
  You want to visualize what's using your disk before deciding what to do
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use DaisyDisk.&lt;/strong&gt; At $10, it's the best disk space visualizer on macOS. It won't tell you what's safe to delete, but it gives you a clear picture of where space is going. Pair it with domain knowledge and you can clean manually.&lt;/p&gt;

&lt;h3&gt;
  
  
  You're a developer who works across multiple tools and languages
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use MegaCleaner.&lt;/strong&gt; This is exactly what it was built for. If you work with any combination of Xcode, Docker, Node.js, Python, Rust, Go, Java, or the other tools on the list, MegaCleaner will find tens of gigabytes that no other tool catches. The confidence levels make it safe to clean without second-guessing.&lt;/p&gt;

&lt;h3&gt;
  
  
  You want the most comprehensive setup
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use both.&lt;/strong&gt; MegaCleaner handles the 60-300 GB of developer tool bloat. CleanMyMac handles malware scanning, app uninstalling, and deeper general system cleaning. They complement each other with almost no overlap.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Note on "Free" Alternatives
&lt;/h2&gt;

&lt;p&gt;If you search for "cleanmymac alternative free," a few options are worth knowing about: &lt;strong&gt;DevCleaner for Xcode&lt;/strong&gt; is genuinely free and good, but Xcode-only. &lt;strong&gt;AppCleaner by FreeMacSoft&lt;/strong&gt; is a free app uninstaller that does one thing well. &lt;strong&gt;OnyX&lt;/strong&gt; is a free system maintenance utility — powerful but technical, not focused on disk cleaning. And of course there are &lt;strong&gt;manual terminal commands&lt;/strong&gt; (&lt;code&gt;docker system prune&lt;/code&gt;, &lt;code&gt;rm -rf node_modules&lt;/code&gt;, &lt;code&gt;cargo clean&lt;/code&gt;) — free by definition, but tedious across dozens of projects. That's exactly what MegaCleaner automates.&lt;/p&gt;

&lt;p&gt;MegaCleaner itself is free to scan — the $49 license is only required to clean.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Honest Take
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CleanMyMac is a better product for general Mac users.&lt;/strong&gt; It has more features, more polish, a larger team, malware protection, and a decade of refinement. If you're not a developer, or if your development doesn't generate significant disk bloat, CleanMyMac covers your needs better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MegaCleaner is a better product for developers.&lt;/strong&gt; It finds 5-20x more reclaimable space on a developer's machine because it understands the tools developers use. The 21 developer scanners, confidence levels, and one-time pricing make it a straightforward value proposition — scan for free, see the number, decide if $49 is worth it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;They're not really competitors.&lt;/strong&gt; CleanMyMac cleans your Mac. MegaCleaner cleans your development environment. The overlap is small. The ideal developer setup might genuinely include both.&lt;/p&gt;

&lt;p&gt;The real question is simple: &lt;strong&gt;do you have developer tools installed?&lt;/strong&gt; If yes, run a free MegaCleaner scan. The number will speak for itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;Download MegaCleaner&lt;/a&gt; — free to scan, no subscription.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Clean Up Xcode and Free 30-50GB on Your Mac</title>
      <dc:creator>Sergey Nikiforov</dc:creator>
      <pubDate>Sat, 04 Apr 2026 18:52:02 +0000</pubDate>
      <link>https://forem.com/nixeton/how-to-clean-up-xcode-and-free-30-50gb-on-your-mac-3ogh</link>
      <guid>https://forem.com/nixeton/how-to-clean-up-xcode-and-free-30-50gb-on-your-mac-3ogh</guid>
      <description>&lt;p&gt;Xcode is the single biggest storage consumer on most developers' Macs. A fresh install starts around 35GB, but over months of development it quietly grows to 80, 100, even 150GB+. Most of that growth is invisible — cached build products, old simulators, debug symbols for iOS versions you no longer use.&lt;/p&gt;

&lt;p&gt;I've been building iOS apps for years, and this problem is exactly why I built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; — I got tired of manually tracking down these hidden folders every few months. But whether you use a tool or do it by hand, you should know where the space goes.&lt;/p&gt;

&lt;p&gt;This guide covers every Xcode storage category: what it is, where it lives, how big it typically gets, and whether it's safe to delete. No guesswork, no vague advice — just exact paths and clear safety levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Reference
&lt;/h2&gt;

&lt;p&gt;Before we dive in, here's the full picture. Bookmark this table — you'll want it next time your Mac complains about storage.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Typical Size&lt;/th&gt;
&lt;th&gt;Safe to Delete?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DerivedData&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Developer/Xcode/DerivedData&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;10-50 GB&lt;/td&gt;
&lt;td&gt;Yes — rebuilds automatically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Simulators&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Developer/CoreSimulator/Devices&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;20-150 GB&lt;/td&gt;
&lt;td&gt;Yes for old versions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Archives&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Developer/Xcode/Archives&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;5-30 GB&lt;/td&gt;
&lt;td&gt;Yes if older than 6 months&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Device Support&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Developer/Xcode/iOS DeviceSupport&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;10-40 GB&lt;/td&gt;
&lt;td&gt;Yes for old iOS versions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Module/Doc Cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Developer/Xcode/DocumentationCache&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1-5 GB&lt;/td&gt;
&lt;td&gt;Yes — regenerates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Old Xcode Versions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/Applications/Xcode*.app&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;12-30 GB each&lt;/td&gt;
&lt;td&gt;Verify first&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CocoaPods Cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Caches/CocoaPods&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1-5 GB&lt;/td&gt;
&lt;td&gt;Yes — &lt;code&gt;pod install&lt;/code&gt; restores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SPM Cache&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Caches/org.swift.swiftpm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1-5 GB&lt;/td&gt;
&lt;td&gt;Yes — &lt;code&gt;swift package resolve&lt;/code&gt; restores&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Total potential savings: 30-150+ GB&lt;/strong&gt; depending on how long you've been developing.&lt;/p&gt;

&lt;p&gt;Now let's go through each one.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. DerivedData
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; Every time you build a project in Xcode, it stores compiled objects, indexes, logs, and debug info in a project-specific subfolder. These are named &lt;code&gt;ProjectName-uniqueID&lt;/code&gt; (the unique ID is a 28-character hash), so you can identify which project each folder belongs to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it lives:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Developer/Xcode/DerivedData/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How big it gets:&lt;/strong&gt; 10-50 GB depending on how many projects you work on. Each active project adds 500 MB to several GB of build artifacts. Since Xcode never cleans these up automatically, they accumulate forever.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From Terminal — delete everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/DerivedData/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or selectively — delete a specific project's cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/DerivedData/MyProject-&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From Xcode — go to &lt;strong&gt;Settings &amp;gt; Locations&lt;/strong&gt;, click the small arrow next to the DerivedData path to open it in Finder, then select and delete the contents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes. DerivedData is completely regenerated on your next build. The only cost is a slightly longer first build after cleaning — typically 1-5 minutes depending on project size. This is the single safest cleanup you can do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; If you're mid-project and don't want to rebuild everything, delete only the folders for projects you haven't touched in a while. The folder names include the project name, so it's easy to tell which is which.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Simulators and Runtimes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What they are:&lt;/strong&gt; iOS, watchOS, tvOS, and visionOS simulator instances — full virtual devices that Xcode uses for testing. Each runtime version (iOS 17.5, iOS 18.2, etc.) is a separate download, and each simulated device (iPhone 16 Pro, iPad Air, etc.) creates its own data folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where they live:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Developer/CoreSimulator/Devices/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; This is typically the largest category — &lt;strong&gt;20-150 GB&lt;/strong&gt;. Each simulator runtime is 5-8 GB. If you've been developing through multiple iOS versions (17, 18, 26), the runtimes alone can be 30-50 GB. Add device data folders and it grows fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, remove simulators for iOS versions that Xcode no longer supports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl delete unavailable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List all installed simulators to see what you have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl list devices
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete a specific simulator by its UUID:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl delete &amp;lt;UDID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove old runtimes you no longer need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl runtime delete &lt;span class="s2"&gt;"iOS 17.5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also manage simulators in Xcode: &lt;strong&gt;Window &amp;gt; Devices and Simulators&lt;/strong&gt;, then right-click any device to delete it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; For old iOS versions (more than 2 major versions behind), absolutely — you're never going to debug against iOS 16 when you're building for iOS 26. For current versions, it's safe but you'll need to re-download the runtime if you delete it (5-8 GB download).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watch for orphans:&lt;/strong&gt; Sometimes simulator device folders survive crashes or manual cleanup attempts. These folders exist on disk but don't appear in &lt;code&gt;xcrun simctl list&lt;/code&gt;. They're dead weight — safe to delete.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Archives
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What they are:&lt;/strong&gt; .xcarchive bundles created every time you build for distribution (Product &amp;gt; Archive). Each archive contains the compiled app, debug symbols (dSYMs), and metadata. They're organized by date in subfolders like &lt;code&gt;2026-03-15/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where they live:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Developer/Xcode/Archives/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; 5-30 GB. Individual archives range from 100 MB to 2+ GB depending on app size. If you archive regularly, this adds up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From Xcode — &lt;strong&gt;Window &amp;gt; Organizer &amp;gt; Archives&lt;/strong&gt;. Right-click an archive and select Delete.&lt;/p&gt;

&lt;p&gt;From Terminal — remove archives older than 6 months:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ~/Library/Developer/Xcode/Archives &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.xcarchive"&lt;/span&gt; &lt;span class="nt"&gt;-mtime&lt;/span&gt; +180 &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; +
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; For archives older than 6 months: yes. The main reason to keep archives is their dSYM files, which you need to symbolicate crash reports. If you've uploaded the build to App Store Connect, Apple retains the dSYMs — so your local copy is redundant.&lt;/p&gt;

&lt;p&gt;For recent archives of builds currently in production: keep them until you've confirmed the dSYMs are uploaded.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Device Support Files
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What they are:&lt;/strong&gt; Debug symbol caches that Xcode downloads when you connect a physical iPhone, iPad, or Apple Watch. They allow Xcode to symbolicate crash logs and debug on-device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where they live:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Developer/Xcode/iOS DeviceSupport/
~/Library/Developer/Xcode/watchOS DeviceSupport/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Folder names follow the format &lt;code&gt;DeviceModel version (build)&lt;/code&gt; — for example, &lt;code&gt;iPhone15,3 17.4 (21E219)&lt;/code&gt;. In older Xcode versions, the format was just &lt;code&gt;17.4 (21E219)&lt;/code&gt; without the device model prefix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; 10-40 GB. Each iOS version creates a 2-5 GB folder. If you've been developing through several iOS releases, these pile up fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Just delete the folders for old iOS versions you're no longer debugging against:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/iOS&lt;span class="se"&gt;\ &lt;/span&gt;DeviceSupport/&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;16.&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/iOS&lt;span class="se"&gt;\ &lt;/span&gt;DeviceSupport/&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;17.&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the folders matching the iOS versions currently on your devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; For old versions (2+ major versions behind your current iOS): completely safe. These are cached copies — Xcode will re-download them if you ever connect a device running that version again. For your current iOS version: keep it, or you'll trigger a re-download next time you plug in your device.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Module and Documentation Cache
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; Pre-built module indexes and documentation caches that Xcode creates for quick access to API docs and symbol lookup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where they live:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Developer/Xcode/DocumentationCache/
~/Library/Developer/Shared/Documentation/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; 1-5 GB combined. Not the biggest offender, but easy to clean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Xcode/DocumentationCache/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Developer/Shared/Documentation/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes. These are fully auto-regenerated by Xcode when needed. No downsides.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Old Xcode Versions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; If you've ever installed multiple Xcode versions side-by-side (common when testing against beta versions or maintaining legacy projects), the old versions may still be sitting in your Applications folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to find them:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check which Xcode is your active version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcode-select &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns something like &lt;code&gt;/Applications/Xcode.app/Contents/Developer&lt;/code&gt; — meaning &lt;code&gt;Xcode.app&lt;/code&gt; is your active version.&lt;/p&gt;

&lt;p&gt;Now check for other Xcode installations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; /Applications/Xcode&lt;span class="k"&gt;*&lt;/span&gt;.app
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; ~/Applications/Xcode&lt;span class="k"&gt;*&lt;/span&gt;.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How big they get:&lt;/strong&gt; 12-30 GB &lt;strong&gt;per version&lt;/strong&gt;. Having Xcode 15 and Xcode 16 both installed wastes 25-35 GB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to clean it:&lt;/strong&gt; Move the old versions to Trash. If you're sure you don't need them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /Applications/Xcode-15.4.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Only if you no longer need the old version. Some developers keep older Xcode versions for building against older SDKs or submitting to the App Store with specific toolchain requirements. Verify before deleting.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. CocoaPods and SPM Caches
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What they are:&lt;/strong&gt; Cached downloads and build artifacts from dependency managers — CocoaPods and Swift Package Manager.&lt;/p&gt;

&lt;h3&gt;
  
  
  CocoaPods
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Caches/CocoaPods/          &lt;span class="c"&gt;# Downloaded pod cache&lt;/span&gt;
~/.cocoapods/repos/                   &lt;span class="c"&gt;# Spec repositories&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clean with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Caches/CocoaPods
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.cocoapods/repos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restore with &lt;code&gt;pod install&lt;/code&gt; in your project. Specs restore with &lt;code&gt;pod repo update&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Swift Package Manager
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/Library/Caches/org.swift.swiftpm/   &lt;span class="c"&gt;# Package cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clean with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/Library/Caches/org.swift.swiftpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restore with &lt;code&gt;swift package resolve&lt;/code&gt; in your project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Project-level folders
&lt;/h3&gt;

&lt;p&gt;Don't forget per-project &lt;code&gt;Pods/&lt;/code&gt; directories and &lt;code&gt;.build/&lt;/code&gt; folders in Swift packages. These can be large but are fully regenerated by their respective dependency managers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Combined size:&lt;/strong&gt; 1-10 GB depending on how many projects you work on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe?&lt;/strong&gt; Yes. Dependency manager caches are fully regenerated. The only cost is re-download time on your next &lt;code&gt;pod install&lt;/code&gt; or &lt;code&gt;swift package resolve&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What NOT to Delete
&lt;/h2&gt;

&lt;p&gt;Not everything should be deleted at once. Here's what to keep:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Active project DerivedData.&lt;/strong&gt; If you're in the middle of working on a project, deleting its DerivedData means a full rebuild — which can take 5-30 minutes on large projects. Clean stale projects, keep active ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SPM package cache on slow connections.&lt;/strong&gt; The &lt;code&gt;~/Library/Caches/org.swift.swiftpm&lt;/code&gt; directory caches all downloaded packages. On a slow network, re-downloading everything takes time. If bandwidth isn't an issue, delete freely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Current iOS Device Support.&lt;/strong&gt; If you're actively debugging on a device running iOS 18.5, keep the &lt;code&gt;18.5 (...)&lt;/code&gt; folder. Deleting it means Xcode will need to re-download it the next time you connect your device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recent archives you haven't uploaded.&lt;/strong&gt; If you archived a build for App Store distribution but haven't submitted it yet, you need that archive. Once it's uploaded to App Store Connect, the local copy is safe to delete.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Automated Way
&lt;/h2&gt;

&lt;p&gt;If hunting through all these paths manually every few months sounds tedious — it is. That's exactly why I built &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;MegaCleaner scans all 6 Xcode storage categories (DerivedData, simulators, archives, device support, docs, old versions) plus CocoaPods and SPM caches — and it doesn't stop at Xcode. It covers 29 tools total (21 developer tools + 8 system categories), including Docker, node_modules, Python environments, Rust/Cargo, Homebrew, and more.&lt;/p&gt;

&lt;p&gt;How it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scan is free&lt;/strong&gt; — see exactly how much space each tool wastes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidence levels&lt;/strong&gt; — every item is marked as "definitely safe" (like DerivedData), "probably safe" (like old archives), or "verify first" (like old Xcode versions)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One click&lt;/strong&gt; — select what to clean, hit Clean, done. Everything goes to Trash (undoable)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$49 one-time&lt;/strong&gt; — not a subscription&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you only care about Xcode cleanup, &lt;a href="https://apps.apple.com/app/devcleaner-for-xcode/id1388020431" rel="noopener noreferrer"&gt;DevCleaner for Xcode&lt;/a&gt; is a solid free alternative. It covers similar Xcode categories but doesn't touch other dev tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;MegaCleaner&lt;/th&gt;
&lt;th&gt;DevCleaner&lt;/th&gt;
&lt;th&gt;CleanMyMac&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Price&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$49 one-time&lt;/td&gt;
&lt;td&gt;Free (tip jar)&lt;/td&gt;
&lt;td&gt;$90/year&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Xcode cleanup&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;6 sub-features&lt;/td&gt;
&lt;td&gt;6 categories&lt;/td&gt;
&lt;td&gt;Basic cache only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Other dev tools&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;20 more (Docker, npm, Python...)&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Safety levels&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3 confidence tiers&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Open source&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes (GPL-3)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dev tool intelligence&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes — 21 dev tool scanners&lt;/td&gt;
&lt;td&gt;Xcode only&lt;/td&gt;
&lt;td&gt;No dev awareness&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Xcode can quietly consume 30-100+ GB of your disk without any visible sign. At a minimum, do this quarterly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Delete DerivedData&lt;/strong&gt; for stale projects — instant win, zero risk&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remove old simulator runtimes&lt;/strong&gt; — usually the biggest savings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean Device Support&lt;/strong&gt; for old iOS versions — easy 10-20 GB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check for old Xcode versions&lt;/strong&gt; in /Applications — 12-30 GB each&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The manual cleanup takes 10-15 minutes if you follow this guide. Or scan with &lt;a href="https://megacleaner.app" rel="noopener noreferrer"&gt;MegaCleaner&lt;/a&gt; and do it in under a minute.&lt;/p&gt;

&lt;p&gt;Either way, your Mac will thank you.&lt;/p&gt;

</description>
      <category>xcode</category>
      <category>macos</category>
      <category>ios</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
