SiftMac
Is it safe to delete? · Package caches · Updated 21 November 2026

Is it safe to delete Swift Package Manager’s caches?

By Mohit Nippanikar, who makes SiftMac

The short answer
On this page
  1. Where SwiftPM keeps things
  2. Where they are
  3. How big they get
  4. How to clear them
  5. What happens afterwards
  6. Questions

1. Where SwiftPM keeps things

Xcode projects that use Swift packages keep their checkouts and build products in the project’s DerivedData folder instead, which clears the way the DerivedData guide describes.

2. Where they are

~/Library/Caches/org.swift.swiftpm
~/Library/org.swift.swiftpm
~/Projects/MyPackage/.build

The --cache-path, --config-path and --scratch-path options point a single command elsewhere; .build is the default scratch path.

3. How big they get

du -sh ~/Library/Caches/org.swift.swiftpm
du -sh ~/Projects/MyPackage/.build

The shared cache keeps repository copies for the packages you’ve resolved, so its size follows how many packages you use and how long their Git histories are. A package’s .build grows with its dependencies and every configuration you’ve built.

4. How to clear them

SwiftPM has one command for each level:

CommandWhat it removes
swift package cleanBuild artifacts in .build; dependency checkouts stay
swift package resetThe package’s complete cache and build directory
swift package purge-cacheThe global repository cache shared by all packages
cd ~/Projects/MyPackage
swift package purge-cache
swift package reset

In Xcode, the File › Packages menu has Reset Package Caches and Resolve Package Versions for the open project.

Leave ~/Library/org.swift.swiftpm in place. Deleting it frees little and throws away your SwiftPM configuration and the fingerprint records it checks packages against.

5. What happens afterwards

Questions

What’s the difference between swift package clean and reset?

clean deletes build artifacts and keeps dependency checkouts, so the next build recompiles without fetching anything. reset empties the package’s whole cache and build directory, so the next build fetches dependencies too.

Is ~/Library/org.swift.swiftpm a cache?

No. It’s SwiftPM’s configuration and security folder. The cache is ~/Library/Caches/org.swift.swiftpm.

Will purge-cache change my package versions?

No. Package.resolved pins them; purging only means they’re fetched again.

Does deleting DerivedData clear Swift packages for Xcode projects?

For that project, yes: Xcode keeps its package checkouts in DerivedData and fetches them again when you next open and build the project.

How SiftMac handles it. Its App caches category lists ~/Library/Caches/org.swift.swiftpm as Swift packages with a Rebuilds verdict and clears what’s inside, keeping the folder. Under Developer files it lists .build folders next to a Package.swift in projects unchanged for 1, 3 or 6 months, and Xcode DerivedData for projects you haven’t opened in that time.

Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works