Apps

Cargo/Rust Cache

Cargo keeps a local cache of downloaded crate archive files in registry/cache, extracted crate source trees in registry/src, and working checkouts of git dependencies in git/checkouts so builds can reuse packages without fetching them again. Those copies accumulate across toolchains, projects, and dependency versions, and git dependency checkouts can drift from what a lockfile or updated revision expects. Kudu removes only these rebuildable Cargo caches and checkouts, not your Rust projects, Cargo.toml files, credentials, settings, or compiled artifacts in target directories.

Why clean Cargo/Rust Cache?

  • Old crate .crate archives pile up across many dependency versions, and the first thing you notice is .cargo consuming several gigabytes even after you delete old projects
  • Extracted sources in registry/src are duplicated for every resolved crate version, so disk usage keeps growing while builds appear to reuse code you no longer need
  • Stale git dependency checkouts can stop matching the revision in Cargo.lock, leading to fetch or checkout errors during cargo build and confusing failures after a branch or dependency update
  • A corrupted downloaded crate archive causes checksum mismatches or unpack errors, which shows up as cargo failing before compilation starts until the package is fetched again
  • Broken or partially written source trees in registry/src can produce missing file or parse errors for dependencies that previously built fine, especially after an interrupted download or disk issue
  • Cleaning git/checkouts removes outdated working trees that Cargo can recreate from its git database, which helps when a patched git dependency keeps building the wrong code after a revision change
  • Large Cargo caches make backups, antivirus scans, and home-directory sync noticeably slower because thousands of archived and extracted dependency files are scanned even though they can be re-downloaded
What gets cleaned

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
Frequently asked

Common questions about Cargo/Rust Cache

Free & open source

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.