Is that robust? Depending on the system, libc, compiler, some includes may be unused while others may be needed.

iwyu is Google's project originally. It has worked for them for more than a decade on their ginormous monorepo.

Sometimes it gets some things wrong, so you have these escape hatches to control it: https://github.com/include-what-you-use/include-what-you-use...