Apps

Cargo/Rust Cache

Cargo keeps a local registry cache under .cargo/registry with downloaded crate archive files in registry/cache and extracted crate source trees in registry/src so builds can reuse dependencies without fetching them again. These files accumulate as you switch projects, toolchains, targets, and crate versions, often leaving many old .crate archives and unpacked sources that are no longer needed. Kudu removes those cached crate downloads and extracted registry sources without touching your projects, Cargo configuration, credentials, or Rust toolchains.

Why clean Cargo/Rust Cache?

  • Old crate versions pile up across many projects, so the registry cache grows into multiple gigabytes and you notice low disk space even when your current workspace is small
  • A corrupted downloaded .crate archive can make cargo build or cargo fetch fail with checksum, unpacking, or unexpected EOF errors until the bad cache entry is removed and downloaded again
  • Interrupted extraction leaves incomplete source trees in registry/src, which can show up as build failures about missing files or malformed package contents for a dependency that should compile normally
  • Switching between many branches and projects leaves duplicate versions of the same crates in cache, making backup scans, antivirus indexing, and file search noticeably slower in your home directory
  • After a registry index change or a re-published dependency mirror issue, Cargo may keep reusing stale local crate downloads, and you see repeated dependency resolution or extraction problems that disappear after a fresh fetch
  • On shared CI runners or developer machines, leftover registry sources from older builds waste space and increase cleanup time between jobs, even though Cargo can simply re-download only the crates the next build actually needs
  • Large numbers of cached crate archives and extracted sources create lots of small files, which is especially noticeable on slower disks where cargo commands spend extra time traversing the registry cache before a build starts
What gets cleaned

Cache paths Kudu targets

Windows

~/.cargo/registry/cache
~/.cargo/registry/src

macOS

~/.cargo/registry/cache
~/.cargo/registry/src

Linux

~/.cargo/registry/cache
~/.cargo/registry/src
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.