> ~/.cargo/registry holds downloaded Rust crates on a Mac. Its cache and src folders are safe to delete and Cargo fetches them again. Keep ~/.cargo/bin.

[← All Mac folders](https://maczentra.com/mac-folders)Mac folder guide

# ~/.cargo/registry on Mac: Safe to Delete?

~/.cargo/registry

~/.cargo/registry is where Cargo keeps every crate it has downloaded for your Rust projects. The cache and src folders inside it are safe to delete, and Cargo downloads crates again on the next build. Leave ~/.cargo/bin alone.

Partly saferegistry is safe to clear, ~/.cargo/bin is not

## What is ~/.cargo/registry on a Mac?

Cargo stores each crate twice: the compressed .crate file in cache and the unpacked source in src. Across many projects and versions that adds up to gigabytes.

~/.cargo/git does the same for dependencies pulled straight from Git. Both are pure download caches.

## What’s inside

- index, the registry index
- cache, compressed .crate files
- src, unpacked crate sources

## How to clear ~/.cargo/registry safely

- Check the size with the first command below.
- Delete the registry cache and src folders, and ~/.cargo/git/checkouts if it is large.
- Build a project to confirm Cargo downloads what it needs.

Check (read only)

```
du -sh ~/.cargo/registry ~/.cargo/git
```

Clear (deletes the download cache)

```
rm -rf ~/.cargo/registry/cache ~/.cargo/registry/src
```

## When to keep it

- ~/.cargo/bin, which holds cargo itself and tools you installed
- Offline work: without the cache, builds need a connection

## Related guides

- [Other developer caches on a Mac](https://maczentra.com/blog/clear-homebrew-pip-gradle-caches-mac)
- [Clean Xcode DerivedData](https://maczentra.com/blog/clean-xcode-derived-data)
- [Clean up node_modules folders](https://maczentra.com/blog/node-modules-cleanup)

## Questions people ask

Is it safe to delete ~/.cargo/registry?+

Yes. It is a download cache. Cargo fetches crates again on the next build.

Can I delete the whole ~/.cargo folder?+

No. ~/.cargo/bin holds cargo and the tools you installed with it. Clear registry and git only.

Does this clear my project build folders?+

No. Each project’s target folder is separate. cargo clean inside a project removes that.

## See which folders fill your Mac

MacZentra, a [disk analyzer and storage cleaner for Mac](https://maczentra.com/), scans your disk locally and draws it as a Treemap or Sunburst, so a folder like this one shows up with its real size. Scanning and every visualization are free. Cleaning is a one-time $49.99 purchase, and anything you remove goes to the Trash, so it can be restored.

[Get MacZentra, ·$49.99](https://checkout.dodopayments.com/buy/pdt_0Np9H2vqU1gHOfkDwU7JZ?quantity=1)

macOS 13 Ventura or later · Apple silicon

Source: https://maczentra.com/mac-folders/cargo-registry-mac
