Safe to Delete

Elixir Mix Build & Deps Folders (_build & deps)

Quick Answer: The _build and deps folders store compiled Erlang BEAM files and Elixir dependencies. Deleting them is safe and restores clean build states.

Bottom Line: It is 100% safe to delete _build and deps folders in Elixir and Phoenix projects. Running mix clean or wiping these folders will not delete your .ex source files.


What are the _build and deps Folders?

Located inside Elixir and Phoenix Framework projects, _build and deps are created by the Mix build tool.

  • deps/: Contains local copies of Hex packages and Git dependencies downloaded by Mix.
  • _build/: Stores compiled Erlang BEAM bytecode (.beam), protocol consolidations, and static assets for dev, test, and prod environments.

If you work on multiple Elixir projects, _build artifacts and deps repositories can accumulate gigabytes of obsolete build clutter.


Can You Delete _build and deps?

✅ Yes, it is completely safe to delete.

  • Zero code loss: Your Elixir code, Phoenix templates, mix.exs, and mix.lock remain untouched.
  • Auto-rebuilt: Running mix deps.get and mix compile will re-fetch dependencies and compile a fresh _build folder.

How to Safely Clean Up Elixir Build Folders

To clean compiled BEAM build files for the current environment:

mix clean

To clean build files across all environments (dev, test, prod):

mix clean --all

Method 2: Manual Directory Wipe

To force a complete dependency and build reset:

# macOS / Linux
rm -rf _build deps

# Windows (PowerShell)
Remove-Item -Recurse -Force _build, deps

Discussion

Loading authentication...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files