Xcode glossary

What is ModuleCache.noindex in DerivedData? Is it safe to delete?

Quick answer

~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex holds compiled modules (.swiftmodule and .pcm files) shared by all your projects, so frameworks like Foundation don't get recompiled for every build. It's safe to delete; the cost is that each project's next build rebuilds the modules it needs.

What it is

Unlike the <Project>-<hash> folders, ModuleCache.noindex isn't tied to one project. On our test Mac it was 588 MB of files like _Concurrency-…swiftmodule and _Builtin_float-….pcm. The .noindex suffix tells Spotlight not to index it.

Why it grows

Each SDK version, Swift version and set of build settings can produce its own copies, and old ones aren't removed when you update Xcode.

Can I delete it?

Yes. Quit Xcode first, then:

rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex

It's also a classic fix for builds that fail with module or "could not build module" errors after an Xcode update.

Questions

Will deleting ModuleCache.noindex break my projects?

No. Xcode rebuilds the modules on the next build. Expect slower first builds.

Why is it called .noindex?

Folders ending in .noindex are skipped by Spotlight, so the thousands of cache files don't slow down search.