Skip to content

Is it safe to delete Rust target folders?

Build output that Cargo creates in each Rust project, including compiled code, binaries and documentation.

Safe

Its owner recreates it by itself when it needs it, and nothing you made is lost.

~/**/target

  • Only next to Cargo.toml
  • Never inside ~/Library

What it is

Cargo writes everything it builds for a project, such as debug and release builds and generated documentation, into a target folder at the root of the project or workspace. It creates the folder again the next time you build, and your source code isn't affected. Target folders grow as dependencies, toolchains and build settings change, and can reach many gigabytes for large projects.

If it's removed

The next build of each project is a full, slower build. Programs you built are removed until you build them again.

How it's removed

Moved to the Trash, where you can restore it.

PRO

The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It starts checked in the Cleanup checklist, except inside Documents or Desktop.

Sources

Last checked on 26 Sep 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.