# Is it safe to delete CocoaPods’ cache and a project’s Pods folder?

Is it safe to delete? · Package caches · Updated 21 November 2026. By Mohit Nippanikar, who makes SiftMac.

## The short answer

- **Yes**, all three come back with `pod install`. The cache is downloads, `~/.cocoapods/repos` is spec indexes, and `Pods` is what `pod install` set up for one project. Keep `Podfile` and `Podfile.lock`.
- **What it costs you:** the project won’t build until you run `pod install`, which downloads whatever is no longer cached.
- **Does it come back?** Yes, at the versions recorded in `Podfile.lock`.
- SiftMac’s verdict: Rebuilds

## 1. Three different folders

- **`~/Library/Caches/CocoaPods`** is the download cache: a copy of every pod version CocoaPods fetched, so another project using the same pod installs without downloading it.
- **`~/.cocoapods/repos`** holds spec repositories, the indexes CocoaPods resolves pods from. Since CocoaPods 1.8 the default source is the CDN, called `trunk`, and the old `master` specs repo, a full Git clone, is no longer needed.
- **`Pods`** sits in each project next to the `Podfile`: the pods installed for that project and the generated `Pods.xcodeproj`, which your app builds against through its `.xcworkspace`.

`Podfile.lock` records the version of each pod that was installed, and `pod install` downloads exactly those versions without checking for newer ones. That’s what makes a deleted `Pods` folder come back as it was.

## 2. Where they are

```
~/Library/Caches/CocoaPods
~/.cocoapods/repos
~/Projects/MyApp/Pods
```

`CP_CACHE_DIR`, `CP_HOME_DIR` and `CP_REPOS_DIR` move the first two. `pod cache list` shows the cache pod by pod, and `pod repo list` lists your spec repos.

## 3. How big they get

```
du -sh ~/Library/Caches/CocoaPods ~/.cocoapods/repos/*
du -sh ~/Projects/MyApp/Pods
```

The cache grows with every pod version any project installed. If `~/.cocoapods/repos/master` exists, it’s the full Git clone that CocoaPods’ own 1.8 announcement called huge, and nothing needs it once your projects use the CDN.

## 4. How to clear each one

### The download cache

```
pod cache clean --all
```

Without a pod name, `--all` is required, so the whole cache can’t be emptied by accident. `pod cache clean <name>` removes a single pod.

### The old master specs repo

If `pod repo list` shows `master` and your `Podfile` uses the CDN source or names no source at all, remove it:

```
pod repo remove master
```

### A project’s Pods folder

Close the workspace in Xcode, then check Git. CocoaPods recommends keeping `Pods` under source control, so in many projects Git tracks it: deleting it shows up as changes, and `git restore Pods` brings it back. If it’s ignored, delete it and reinstall:

```
rm -rf ~/Projects/MyApp/Pods
cd ~/Projects/MyApp
pod install
```

## 5. What happens afterwards

- Until `pod install` runs, Xcode can’t find the pods and the build fails with missing modules or files.
- `pod install` restores the versions in `Podfile.lock`, from the cache where it can and from the network for the rest.
- Emptying the cache only costs download time on the next install; projects that still have `Pods` keep building.
- Removing `master` changes nothing for projects that resolve from the CDN.

## Questions

### Is it safe to delete Podfile.lock?

Don’t. It pins every pod to the version you built and tested with. Without it, `pod install` resolves versions from the `Podfile` again and may pick newer ones. CocoaPods says to always commit it.

### Should I run pod deintegrate to free space?

No. `pod deintegrate` removes every trace of CocoaPods from your Xcode project. To free space, delete `Pods` or clean the cache; both come back with `pod install`.

### What is ~/.cocoapods/repos/trunk?

The CDN spec source CocoaPods uses by default since 1.8. It’s an index of pod specs, not the pods themselves, and `pod repo list` shows it.

## How SiftMac handles it

Its App caches category clears `~/Library/Caches/CocoaPods` with a Rebuilds verdict. Under Developer files it lists `Pods` folders that sit next to a `Podfile`, in projects you haven’t changed for 1, 3 or 6 months, as CocoaPods packages that `pod install` brings back; none is ticked until you tick it.

Download: https://siftmac.com/SiftMac.dmg (scanning is free, and so is the first 2 GB of cleaning).

## Sources

- [CocoaPods: command-line reference (pod cache, pod repo, pod deintegrate)](https://guides.cocoapods.org/terminal/commands.html)
- [CocoaPods Guides: Using CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
- [CocoaPods Guides: pod install vs. pod update](https://guides.cocoapods.org/using/pod-install-vs-update.html)
- [CocoaPods blog: CocoaPods 1.8 beta, the CDN as default](https://blog.cocoapods.org/CocoaPods-1.8.0-beta/)
- [CocoaPods source: default cache and repos folders](https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/config.rb)

## Related

- [Is it safe to delete Swift Package Manager’s caches?](https://siftmac.com/safe-to-delete/swift-package-manager-cache)
- [Is it safe to delete Xcode’s DerivedData folder?](https://siftmac.com/guides/xcode-deriveddata)
- [Is it safe to delete Xcode’s Archives folder?](https://siftmac.com/safe-to-delete/xcode-archives)
- [What fills an iOS or Mac developer’s Mac, and what Xcode makes again](https://siftmac.com/for/ios-developers)
- [Xcode DerivedData, node_modules and Docker: what’s safe to delete on a developer’s Mac](https://siftmac.com/guides/developer-files-on-mac)

Canonical: https://siftmac.com/safe-to-delete/cocoapods-cache
