Cargo/Rust Cache
Cargo keeps several on-disk caches to avoid re-downloading dependencies on every build: compressed crate archives in registry/cache, extracted crate source trees in registry/src, and working checkouts of git dependencies in git/checkouts. Those copies speed up builds and dependency resolution, but they can accumulate old crate versions, stale extracted sources, and outdated git worktrees after lockfile changes or branch updates. Kudu removes those cached archives, extracted sources, and git checkouts while leaving your projects, Cargo.toml files, lockfiles, toolchains, credentials, and Rust settings untouched.
Why clean Cargo/Rust Cache?
- Old .crate archives from many dependency versions pile up in registry/cache and quietly consume gigabytes, which shows up as a surprisingly large ~/.cargo directory even after projects are deleted
- Extracted sources in registry/src remain after version upgrades and lockfile changes, so you keep duplicate copies of crates and notice disk usage growing faster than your actual codebases
- Stale git dependency checkouts can leave Cargo building from an outdated worktree until it refreshes, which appears as local builds not matching a recently pushed branch or tag
- Broken or partial downloads in the registry cache can trigger checksum mismatches or unpack failures, causing cargo build or cargo fetch to stop until the bad cache entry is replaced
- Interrupted git fetches or damaged checkout metadata can produce dependency update errors, with Cargo repeatedly failing on the same git-sourced crate until the checkout is removed
- Large caches slow down backup scans, antivirus indexing, and home-directory sync tools, so routine file operations feel heavier even though your Rust projects themselves are unchanged
- After lots of experimentation with branches and temporary projects, cached crate archives and extracted trees outlive the projects that needed them, leaving you with disk use that no longer reflects current development work
Cache paths Kudu targets
Windows
~/.cargo/registry/cache |
~/.cargo/registry/src |
~/.cargo/git/checkouts |
macOS
~/.cargo/registry/cache |
~/.cargo/registry/src |
~/.cargo/git/checkouts |
Linux
~/.cargo/registry/cache |
~/.cargo/registry/src |
~/.cargo/git/checkouts |
Common questions about Cargo/Rust Cache
Download Kudu and reclaim your disk space.
Available on Windows, macOS, and Linux. No account required, no feature gates, no telemetry without consent. All cleaning targets are open source and community-auditable.