All Ecosystems
🦀

Rust

Clean target directories and cargo caches from Rust projects. Recover gigabytes of space from compiled artifacts.

Avg. Space Saved

2-10 GB per project

Detection Files

2 files

Artifact Types

3 types

Cleanable Artifacts

Cluttered can safely clean these Rust build artifacts:

target/.cargo/registry/cache.cargo/git

Project Detection

Cluttered identifies Rust projects by looking for these files:

Cargo.tomlCargo.lock

Overview

Rust's compilation model creates some of the largest build artifacts in any ecosystem. A single project's target/ directory can easily exceed 10 GB, especially with multiple build profiles.

What Cluttered Cleans

ArtifactDescriptionTypical Size
target/Compiled artifacts, deps, debug info2-10 GB
target/debug/Debug build artifacts1-5 GB
target/release/Release build artifacts500 MB - 2 GB
.cargo/registry/cacheDownloaded crate archives500 MB - 2 GB

Why Rust Builds Are So Large

Rust's compilation strategy includes:

  • Incremental compilation data: Speeds up rebuilds but consumes space
  • Debug symbols: Essential for debugging but very large
  • Dependency builds: Each dependency is compiled separately
  • Multiple targets: Each target (debug, release, tests) has separate artifacts

Safety Considerations

Cluttered protects your Rust projects by:

  • Checking for uncommitted git changes
  • Detecting running cargo build or cargo run processes
  • Looking for recent Cargo.lock modifications
  • Identifying active editor sessions

Restoring After Cleanup

After cleaning, simply run:

cargo build

Rust will recompile your dependencies and project. First build after cleanup will take longer, but subsequent builds use incremental compilation.

Frequently Asked Questions

Will cleaning break my binaries?

If you clean target/release/, the compiled binary is removed. You'll need to rebuild. Your source code is always safe.

What about cargo install binaries?

Cluttered doesn't touch globally installed binaries in ~/.cargo/bin. Only project-local targets are cleaned.

Should I clean the registry cache?

The registry cache speeds up dependency downloads. Clean it if you need space; Cargo will re-download as needed.

Ready to clean your Rust projects?

Download Cluttered and reclaim your disk space in minutes.