# cargo-cache

> manage cargo cache (${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively

Source: https://talira.ai/catalog/cargo-cache-qtjjnc5p
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool
- Categories: [developer tools / disk cleanup](https://talira.ai/categories/developer-tools/disk-cleanup), [languages / rust](https://talira.ai/categories/languages/rust)
- Platforms: linux, macos, windows, cli
- Licence: Apache-2.0 OR MIT
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- Creator: Matthias Krüger (matthiaskrgr)

cargo-cache shows how much space Cargo's home directory (~/.cargo) uses, broken down into installed binaries, registry index, crate archives, source checkouts and git repos, and cleans it selectively: autoclean of checkouts, removing items older or younger than a date, recompressing git repos, or dropping entries not used by a given crate. It can also report [sccache](https://talira.ai/catalog/sccache-3e1w9xr3.md) cache sizes.

## Links

- GitHub: https://github.com/matthiaskrgr/cargo-cache

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/cargo-cache>[^1]

## Problems it solves

- ~/.cargo is taking up several gigabytes and I don't know what's safe to delete
- clean old crate downloads and git checkouts from the cargo registry
- which crates take the most space in my cargo home
- shrink the cargo registry before caching it in CI
- remove cached crates I haven't used in months
- see how big my sccache directory has grown
- recompress the git dependencies cargo has cloned
- trim the cargo cache to only what one project needs

## Features

- size breakdown of ~/.cargo
- autoclean
- remove older/younger than
- git gc
- regex query
- top cache items
- clean-unref
- sccache stats
- dry run

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.26 out of 1.
Signals: maintenance 0.06, adoption 0.60, momentum 0.30, community 0.38, backing 0.20, extensibility 0.20.

- 996 GitHub stars
- 8 contributors
- created by Matthias Krüger (matthiaskrgr)

Warnings:

- last commit 3.5 years ago

## Alternatives

- [cargo-sweep](https://talira.ai/catalog/cargo-sweep-4ba8ja0v.md): A cargo subcommand for cleaning up unused build files generated by Cargo
- [Kondo](https://talira.ai/catalog/kondo-xpxt13es.md): Cleans dependencies and build artifacts from your projects.
- [npkill](https://talira.ai/catalog/npkill-4hc2q493.md): Easily find and remove old and heavy node_modules, artifacts, caches and dev leftovers
- [DevCleaner for Xcode](https://talira.ai/catalog/devcleaner-for-xcode-4ck1ve1r.md): If you want to reclaim tens of gigabytes of your storage used for various Xcode caches - this tool is for you!

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
