The workshop · Edition No. 47 · 11 Oct 2026

holmgr/cargo-sweep

Deletes old build files from one project folder or a whole disk, by age, toolchain or size.

← The workshopRead the whole edition →
08

holmgr/cargo-sweep

💎 hidden gem

995 stars · MIT, read from /blob/master/LICENSE, plain and unmodified, 'Copyright (c) 2018 Viktor Holmgren' · v0.8.0 (2025-10-11) — THE YEAR TRAP, and a new shape of it. /releases/latest read '11 Oct', which is the day and month of this run, so the past-or-future heuristic would have given 2026-10-11 and been wrong by exactly one year. crates.io dates the same version 2025-10-11T05:31:31Z and settled it · Track this in Scout

Deletes old build files from one project folder or a whole disk, by age, toolchain or size.

▶Repo detailsthe review · specs · pros & cons · install

What it does

It reads a project's target folder, which is where the Rust build tool keeps its intermediate files, and the list of toolchains you currently have installed. It then deletes build files by one of three rules: older than a number of days, not built by a currently installed toolchain, or whatever is needed to bring the folder under a size you name. With --recursive it walks a whole directory tree and does the same to every project it finds. --stamp writes a marker file so a later run can use that moment as the cut-off. It has ten documented options, and --dry-run prints what it would delete without deleting it. What it does not do is state any limits at all: there is no section in the README saying what it will not handle, and no size or speed figures. The example values in the documentation, 30 days and 10 gigabytes, are examples rather than measurements.

Why it matters

Who it suits. Anyone with more than two or three Rust projects on a machine that keeps running out of disk. It is read-only until you choose a rule, so the trial costs nothing. Skip it if you write no Rust, because it does nothing for any other language, and think twice if you want a tool somebody is maintaining.

Verdict. Worth two minutes today, and the gem of the three in this part, but read the front page first. The README says plainly: "cargo-sweep is currently unmaintained" and "The project has issues and is lacking a dedicated maintainer". It is not archived and it is not dead by any measure this report uses — code landed on 26 May 2026, well inside the eighteen-month line — but the author points readers to dnlmlr/cargo-clean-all as the alternative, and that project took code on 30 August 2026. A tool this small and this frozen still works, and for a job as simple as deleting old files that is often fine. Always run --dry-run first: every real mode deletes without confirming, and there is no undo. One more thing, recorded because it nearly caught this report out: the release page showed "11 Oct" with no year, which is today's own day and month, and the real date is 11 October 2025. The registry settled it.

Stars995
LicenceMIT, read from /blob/master/LICENSE, plain and unmodified, 'Copyright (c) 2018 Viktor Holmgren'
Latestv0.8.0 (2025-10-11) — THE YEAR TRAP, and a new shape of it. /releases/latest read '11 Oct', which is the day and month of this run, so the past-or-future heuristic would have given 2026-10-11 and been wrong by exactly one year. crates.io dates the same version 2025-10-11T05:31:31Z and settled it
Good
  • One command, seconds to run, and --dry-run shows the whole list before anything is deleted.
  • Three different rules, including a size ceiling, so a disk can be brought under a number rather than emptied.
  • MIT licence, read from the file, plain and unmodified, and the crate has over a million downloads.
Watch for
  • Its own README says it is unmaintained and names a replacement. Code last landed on 26 May 2026.
  • Every mode deletes files with no confirmation and no undo, and the README carries no warning about that.
  • The release is from 11 October 2025, a year old, and the version is 0.8.0, still before 1.0.
Similar repositories
Install
cargo install cargo-sweep
# See what would go, change nothing
cargo sweep --dry-run --time 30
# Then, for real
cargo sweep --time 30              # delete anything older than 30 days
cargo sweep --installed            # delete anything not built by a current toolchain
cargo sweep --maxsize 10GiB        # trim the folder down to 10 GiB
cargo sweep --recursive --all ~/code --time 30   # every project under one folder

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.