Language toolchains & SDKs

Carthage Cache Cleanup: Reclaim Disk From ~/Library/Caches/org.carthage

If you've been doing iOS or macOS development for any length of time, you've likely noticed a familiar culprit swelling your storage: Carthage cache on Mac. The folder at ~/Library/Caches/org.carthage quietly accumulates pre-built frameworks, downloaded archives, and intermediate build products across every project you've ever touched — and on a busy development machine, it can easily reach 10–30 GB or more. This guide explains exactly what lives there, why it grows so fast, how to safely clear it, and what you can do to keep it under control going forward.

What Is the Carthage Cache and Where Does It Live?

Carthage is a decentralized dependency manager for Swift and Objective-C. Unlike CocoaPods, which integrates into your Xcode workspace, Carthage builds each dependency as a standalone binary framework and lets you link it yourself. To avoid rebuilding the same framework version repeatedly across projects, Carthage keeps a shared cache on disk.

On macOS Sequoia and Tahoe (and all modern versions of macOS), that cache lives in two main locations:

  • ~/Library/Caches/org.carthage/DependencyResolutionResult — resolved dependency graphs stored as JSON.
  • ~/Library/Caches/org.carthage/Constants/dependencies — pre-built .framework and .xcframework bundles, organized by dependency name and version.

There is also the project-level Carthage/ directory that lives inside each repository, but that is tracked (or gitignored) by you — it is not the shared system cache discussed here.

Why the Cache Grows So Large

Every time you run carthage update or carthage bootstrap with --cache-builds, Carthage stores the resulting binaries in ~/Library/Caches/org.carthage. Because these builds are keyed on dependency + version + platform + Swift toolchain version, upgrading Xcode alone can double the cache size: the old Swift-compiled artifacts remain alongside the new ones. Over a year of active development — especially if you work across multiple apps or run CI jobs locally — it is completely normal to accumulate:

  • Multiple major versions of the same library (e.g., Alamofire 5.6, 5.7, 5.8, 5.9).
  • Fat binaries built for both Apple Silicon and Intel slices, even after you've moved entirely to Apple Silicon machines.
  • Artifacts from projects you no longer maintain.
  • Frameworks compiled against a Swift toolchain that shipped with a version of Xcode you uninstalled months ago.

How Much Space Is the Carthage Cache Using?

Before deleting anything, measure. Open Terminal and run:

du -sh ~/Library/Caches/org.carthage

To see a breakdown by dependency name, drill one level deeper:

du -sh ~/Library/Caches/org.carthage/Constants/dependencies/*

That second command often surfaces surprises — a single framework like RealmSwift or RxSwift can account for several gigabytes across versions and platform targets. The table below shows a representative breakdown from a real development machine after two years of active iOS work:

Dependency Versions cached Approx. size Notes
Realm / RealmSwift 4 6.2 GB Large binary; includes device + simulator slices
RxSwift 3 2.8 GB Multiple RxCocoa/RxRelay sub-frameworks
Alamofire 5 1.1 GB Thin framework; size driven by version count
SnapKit 2 0.4 GB Lean framework; small per-version footprint
FirebaseCrashlytics 2 1.9 GB Firebase umbrella brings many sub-frameworks
Other / misc varies 3.6 GB Smaller utilities, stale toolchain artifacts

Is It Safe to Delete the Carthage Cache?

Yes — the contents of ~/Library/Caches/org.carthage are purely a performance cache. Deleting it will not break any of your projects. The next time you run carthage bootstrap or carthage update, Carthage will re-download and re-build only what it needs for that project. The trade-off is time: rebuilding large frameworks like Realm from source can take 5–15 minutes on the first run after clearing the cache. Your source code, Cartfile, and Cartfile.resolved are completely untouched.

How to Clean the Carthage Cache on Mac (Step-by-Step)

There are several levels of cleanup, from cautious to thorough. Choose the approach that fits your situation.

Option 1: Delete the Entire Cache at Once

The safest and most common approach is a full wipe:

  1. Quit Xcode and any running carthage processes.
  2. Open Terminal and run:
    rm -rf ~/Library/Caches/org.carthage
  3. Verify it is gone:
    ls ~/Library/Caches/org.carthage
    You should see "No such file or directory." Carthage will recreate the folder the next time it runs.

Option 2: Remove Only Stale Versions of Specific Frameworks

If you want to keep the most recent cached build of a dependency and only remove older versions, navigate into the cache and delete selectively:

  1. List available versions of a specific dependency:
    ls ~/Library/Caches/org.carthage/Constants/dependencies/Alamofire
  2. Remove an old version:
    rm -rf "~/Library/Caches/org.carthage/Constants/dependencies/Alamofire/5.6.4"

This surgical approach is slower but lets you keep warm-cache builds for the versions you still actively use.

Option 3: Use the Carthage Built-In Outdated Check Before Deleting

Run carthage outdated inside each active project to identify which dependency versions you actually need, then cross-reference with the cache directories before deleting. This is the most conservative path but worthwhile if rebuilding large frameworks is a concern.

Other Carthage Folders Worth Knowing About

The shared cache is the biggest win, but Carthage leaves artifacts in a few other places too:

  • ~/Library/Caches/org.carthage/DependencyResolutionResult — small JSON files, usually under 10 MB total; safe to delete.
  • <project>/Carthage/Build/ — the linked frameworks for a specific project. These are typically gitignored. Deleting them forces a carthage bootstrap re-run for that project.
  • <project>/Carthage/Checkouts/ — source checkouts. Deleting these forces a fresh clone on the next carthage update.

If you want to understand the full picture of what development toolchains are consuming on your Mac — including Xcode DerivedData at ~/Library/Developer/Xcode/DerivedData, npm caches, CocoaPods repositories, and more — this guide to what's taking up space on your Mac covers each category with size expectations and cleanup steps. For a deeper look at Xcode-specific bloat alone, see why Xcode takes up so much space.

Preventing Unnecessary Cache Growth

Cleaning the Carthage cache once is easy; keeping it from ballooning again takes a bit of discipline.

  • Pin your dependencies. The more version churn you allow (e.g., accepting minor-version bumps across many libraries), the faster distinct cache entries accumulate. Lock versions in Cartfile.resolved and only update intentionally.
  • Use --cache-builds only when you mean to. The --cache-builds flag is what writes artifacts into ~/Library/Caches/org.carthage. On a CI machine or a build you don't plan to repeat, omitting it avoids polluting the cache.
  • Audit after major Xcode upgrades. When you install a new Xcode version, old toolchain artifacts become dead weight. Schedule a cache clear right after upgrading.
  • Add a quarterly reminder. On a machine that's actively building iOS apps, a full cache wipe every 3–6 months is a reasonable maintenance routine. Tools like Crumb can audit all of these caches at once — Carthage, CocoaPods, Xcode DerivedData, npm — and surface what's safe to remove before you delete anything.

Apple Silicon vs. Intel: What It Means for Cache Size

If you transitioned from an Intel Mac to an Apple Silicon Mac and migrated your home directory, you may be carrying simulator and device builds compiled for Intel architectures you no longer need. Carthage on Apple Silicon running under Rosetta or natively will produce arm64 artifacts; the old x86_64 builds just sit in the cache consuming space. After migrating to Apple Silicon, a full cache wipe is especially worthwhile — your next carthage bootstrap will produce lean arm64-only (or universal) binaries appropriate for your current machine.

Quick Reference: Cache Locations and Cleanup Commands

Keep these commands handy for your next cleanup session:

  • Check total size: du -sh ~/Library/Caches/org.carthage
  • View per-dependency breakdown: du -sh ~/Library/Caches/org.carthage/Constants/dependencies/*
  • Full cache wipe: rm -rf ~/Library/Caches/org.carthage
  • Verify deletion: ls ~/Library/Caches/org.carthage

The Carthage cache is one of the most consistent gigabyte-level wins on an active iOS development machine. A few seconds in Terminal today can recover 10–30 GB that your Mac can put to better use.

Reclaim your disk in one click

Crumb audits your whole Mac, tells you what's safe to delete, and frees the space in seconds — private, local, and Apple-notarized.

Download Crumb for macOS

Frequently asked questions

Is it safe to delete ~/Library/Caches/org.carthage?
Yes, completely safe. The contents are a performance cache only — your source code, Cartfile, and Cartfile.resolved are untouched. The next time you run carthage bootstrap or carthage update, Carthage will rebuild only what each project needs.
Where exactly is the Carthage cache on Mac?
The shared binary cache lives at ~/Library/Caches/org.carthage/Constants/dependencies. Each subfolder is named after a dependency, with sub-subfolders for each version that has been built and cached.
Will clearing the cache break my existing Xcode projects?
No. Your project-level Carthage/Build folder (which links into Xcode) is separate from the shared cache. However, if you later need to run carthage bootstrap again, it will take longer the first time because cached binaries will need to be rebuilt.
How much space can I expect to recover?
It varies by how many projects and dependencies you have, but 5–20 GB is typical on a machine that has been doing iOS development for a year or more. Run du -sh ~/Library/Caches/org.carthage first to get an exact number before deleting.
Does Carthage cache also store downloaded archives or just built binaries?
Both. Carthage can cache pre-built binary frameworks downloaded directly (when a GitHub release provides them) as well as frameworks it builds locally from source. All of these live under ~/Library/Caches/org.carthage and are safe to delete.