Skip to content

Is it safe to delete sbt target folders?

Build output that sbt creates in each Scala project, such as compiled classes, packaged JAR files, caches and documentation.

Safe

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

~/**/target

  • Only next to build.sbt or plugins.sbt
  • Never inside ~/Library

What it is

sbt writes generated files, including compiled classes, packaged JAR files, caches and documentation, into target folders in the project and in its project folder. It creates them again the next time you build, and your source code isn't affected.

If it's removed

The next build of each project is a full, slower build. Packages 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.