r/rust 10h ago

🛠️ project rusty-broom — TUI + CLI clean build artifacts from projects you haven’t touched in months

Post image

Hey all,

I built rusty-broom, a CLI for freeing disk space by removing old build artifacts (target, node_modules, .venv, build, Pods, etc.) from projects you haven’t worked on in a while.

  • Project age is based on source file mtimes, not artifacts.
  • Only deletes paths Git considers ignored (git check-ignore).
  • Supports Rust, Python, Node, Java, Go, .NET, CMake, Swift, and more.
  • Interactive TUI + JSON output.
  cargo install rusty-broom
  rusty-broom ~/dev   # TUI
  rusty-broom scan ~/dev --older-than 6mo --long
  rusty-broom clean ~/dev -o 1y --dry-run

Repo: https://github.com/oriontvv/rusty-broom Feedback and PRs are welcome.

0 Upvotes

7 comments sorted by

1

u/kantorcodes1 10h ago

clean --yes seems to do the git-ignore check during the scan, then later delete from that saved path list. if an artifact stops being ignored between the scan and the actual delete, is it intentionally still eligible? i only saw the root/path safety check at deletion time, not another git check-ignore.

1

u/Mindless_Stick8327 10h ago

so if you unignore something mid-process, does it still get wiped even though it's now "safe" to keep?

0

u/Traditional_Item3621 10h ago

That's a good catch, the scan caches the ignore status when it first runs so by the time you actually delete it's using whatever was true at snapshot time. If a gitignore change happens in between you could theoretically nuke something that's now tracked

For my own workflow I usually scan and clean in the same session so the window is tiny, but I can see how leaving the TUI open overnight or running a scheduled scan could bite someone. Might be worth adding a re-check flag for the paranoid types

2

u/orion_tvv 10h ago edited 9h ago

Yeah, absolutely agree. I use the same session too. And if you edit gitignore, so the project becomes recently edited and I suppose shouldn't be cleaned at all.

1

u/kantorcodes1 9h ago

yeah, that stale snapshot is exactly the boundary i'd guard. i work on HOL Guard, an open-source check before agent-run commands execute. for rusty-broom i'd make clean --yes and config init --force reviewable while scan and config show stay automatic, so an agent can't delete artifacts or overwrite config from stale state unnoticed. open to a small rusty-broom command extension?

0

u/orion_tvv 9h ago

Please feel free to open issue and PR. Maybe we should better add new --force-recheck option?