Cleaning Go Modules, Ruby Gems, Flutter Pub Cache, and Maven Repository
Last updated: 2026-04-06
Beyond the major toolchains, developers using Go, Ruby, Flutter, or Maven accumulate their own caches. Go module cache at ~/go/pkg/mod and build cache at ~/.cache/go-build, Ruby gem installations at ~/.gem plus rbenv and RVM paths, CocoaPods cache, Flutter's Dart pub cache at ~/.pub-cache, and Maven's local repository at ~/.m2/repository. Each of these grows silently over months of development and is safe to clean.
Go module and build cache
Go stores downloaded modules at ~/go/pkg/mod (or $GOPATH/pkg/mod) and compiled build cache at ~/.cache/go-build. The module cache grows with every unique dependency version across all your Go projects. The build cache stores compiled packages to speed up rebuilds. Both can be cleaned with `go clean` commands.
Ruby gems, rbenv, and RVM
Ruby stores gems at ~/.gem or within rbenv/RVM-managed paths. rbenv keeps multiple Ruby versions under ~/.rbenv/versions. RVM stores versions and gemsets under ~/.rvm. CocoaPods (used by iOS developers for dependency management) caches pod specs and downloads. All of these are safe to clean since gems and Pods will be re-downloaded when needed.
Flutter pub cache
Flutter stores Dart packages at ~/.pub-cache. This includes all packages used across your Flutter and Dart projects. You can clean it with `flutter pub cache clean`, but CodeCleaner detects it automatically as part of its developer tool scan.
Maven local repository
Maven stores downloaded artifacts in ~/.m2/repository. For Java and Kotlin developers, this repository grows with every dependency across all projects. Old versions of artifacts are kept indefinitely. CodeCleaner detects the Maven repository and shows its total size.
Manual steps (Terminal)
You can do this manually with these commands, or use CodeCleaner to automate the process with a visual interface and safety checks.
go clean -cache -modcachegem cleanupflutter pub cache cleanrm -rf ~/.m2/repositorypod cache clean --allOr use CodeCleaner
CodeCleaner automates all of this with a native macOS app. It auto-detects your installed tools, scans the relevant paths in parallel, shows per-item sizes, and lets you clean safely with one click. Free scan, no account required.