Mac storage basics · Developer tools

How do I clear Rust, Go and other language build caches?

Short answer: Use cargo clean for Rust target folders, go clean -cache and -modcache for Go, conda clean --all for Conda, and delete old .venv folders. All are regenerated later.

Most toolchains have a cleanup command:

  • Rust: cargo clean in a project removes its target folder, often the biggest item.
  • Go: go clean -cache clears build cache; go clean -modcache clears downloaded modules.
  • Conda: conda clean --all removes package caches and unused packages.
  • Python virtual environments: delete .venv folders in inactive projects and recreate them later.

Everything here is regenerated by the next build or install.

Last reviewed

Also available as Markdown and JSON.