kondo

Cleans build artefacts from your projects — scans for target/, node_modules/, .gradle/ and more across your entire filesystem and frees the space.

kondo is a tool for cleaning up build artefacts and dependency directories across your projects. If you have ever run du -sh ~/Projects and been horrified by the result, kondo is the cure. It walks a directory tree, identifies project types by their marker files, and shows you exactly how much space is being consumed by artefacts you can safely delete — then deletes them on request.

It supports a wide range of project types out of the box, from Rust's target/ to Node's node_modules/ to Gradle's .gradle/ cache.

Features

  • Multi-ecosystem — recognises Rust, Node.js, Python, Java (Maven/Gradle), Ruby, Swift, Dart/Flutter, Unity, Haskell, and more
  • Safe by design — shows what it will delete and asks for confirmation; never deletes source files
  • TUI mode — an interactive terminal UI for browsing and selectively cleaning projects
  • Size reporting — shows the size of reclaimable artefacts per project before committing to deletion
  • Fast walk — parallelised directory traversal handles large trees quickly
  • Dry run — preview what would be cleaned without actually deleting anything

Supported project types

Project typeDirectories cleaned
Rusttarget/
Node.jsnode_modules/
Python__pycache__/, .venv/, dist/, *.egg-info/
Java (Maven)target/
Java (Gradle).gradle/, build/
Rubyvendor/bundle/
Swift / Xcode.build/, DerivedData/
Dart / Flutter.dart_tool/, build/
Haskell.stack-work/, dist-newstyle/
UnityLibrary/, Temp/, Obj/
CMakebuild/
Zigzig-cache/, zig-out/

Installation

cargo install kondo

Or via your package manager:

# macOS
brew install kondo

# Arch Linux (AUR)
paru -S kondo

# Nix
nix-env -iA nixpkgs.kondo

# Debian / Fedora
# Pre-built Linux binaries are available on the
# [releases page](https://github.com/tbillington/kondo/releases).

Usage

# Scan the current directory and report reclaimable space
kondo

# Scan a specific directory
kondo ~/Projects

# Launch the interactive TUI
kondo --interactive ~/Projects

# Delete artefacts without prompting (non-interactive)
kondo --all ~/Projects

# Only show projects with more than 500MB of artefacts
kondo --older 0 ~/Projects

Interactive TUI

Running kondo --interactive opens a navigable list of all discovered projects, showing the reclaimable size for each. Use the arrow keys to select projects and Space to mark them for cleaning, then press Enter to delete the marked artefacts.

This is the recommended mode when you want to be selective — for example, keeping node_modules/ in the project you are actively working on while cleaning everything else.

Example output

/home/user/Projects/my-rust-app          rust    1.3 GB
/home/user/Projects/old-node-app         node    423 MB
/home/user/Projects/android-thing        gradle  891 MB
/home/user/Projects/ml-experiments       python  2.1 GB
────────────────────────────────────────────────────────
Total reclaimable: 4.7 GB

Why not just use find + rm?

You could write something like find . -name node_modules -type d -prune -exec rm -rf {} +, but you would need a separate command for every project type, risk deleting things you did not intend to, and get no size summary before committing. Kondo handles all ecosystems uniformly, gives you a clear picture of what is taking up space, and makes selective cleanup easy through the interactive TUI.