# cargo-sweep

> A cargo subcommand for cleaning up unused build files generated by Cargo

Source: https://talira.ai/catalog/cargo-sweep-4ba8ja0v
Every listing: https://talira.ai/catalog.md

Status: cargo-sweep looks abandoned: it isn't maintained, though its makers haven't said it has ended. Its README says cargo-sweep is currently unmaintained. Source: https://github.com/holmgr/cargo-sweep

- 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: MIT
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes

cargo-sweep deletes old or unused build artifacts from Rust target directories without a full cargo clean: by age, by toolchains no longer installed, or until a target directory is under a size limit, across many projects at once. The README currently marks it as unmaintained and points to cargo-clean-all.

## Links

- GitHub: https://github.com/holmgr/cargo-sweep

## Problems it solves

- my Rust target folder is 40GB and cargo clean throws away everything
- delete build artifacts older than 30 days but keep recent ones
- clean out artifacts from Rust toolchains I've uninstalled
- shrink the target directory before caching it in CI
- clean every Rust project under ~/code in one go
- keep target/ below a size limit automatically
- nightly toolchain updates leave gigabytes of stale build files behind
- preview which build files would be deleted before removing them

## Features

- clean by age
- clean artifacts from uninstalled toolchains
- size limit
- recursive across projects
- dry run

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.12 out of 1.
Signals: maintenance 0.00, adoption 0.60, momentum 0.32, community 0.58, backing 0.00, extensibility 0.20.

- latest release v0.8.0 13 months ago
- 1.0k GitHub stars
- 28 contributors

Warnings:

- abandoned: not maintained
- last commit 6 months ago

## Alternatives

- [npkill](https://talira.ai/catalog/npkill-4hc2q493.md): Easily find and remove old and heavy node_modules, artifacts, caches and dev leftovers
- [Kondo](https://talira.ai/catalog/kondo-xpxt13es.md): Cleans dependencies and build artifacts from your projects.
- [Mr Boxington (mbx)](https://talira.ai/catalog/mr-boxington-mbx-5hc8kes0.md): A shared cache for Cargo builds
- [cargo-cache](https://talira.ai/catalog/cargo-cache-qtjjnc5p.md): manage cargo cache (${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively
- [Kache](https://talira.ai/catalog/kache-j5q2h9jj.md): Build once. Reuse the work.
- [Mole](https://talira.ai/catalog/mole-q6myyge7.md): Open-source Mac and PC cleaner. Keep your machine clean, light, and running like new.
