How to disable "refreshing files" after build


I have a really HUGE repo, and I work with relatively small library inside this repo. CMakeLists.txt is small it lists only files of my library and doesn't include external files.


Sometimes after build is complete CLion starts process of "Refreshing files" that cannot finish in 20-30  minutes (I quit CLion after this time). I'm not exactly sure, but it looks like CLion walks through each file of the repo.


Can I somehow tune refreshing files to skip files and directories not related to my library or completely disable it?


Hi Dmitry,

CLion is synchronising its internal state to properly reflect the files that might appear after the build (i.e. newly generated headers, executable files that participate in Run Configurations, etc). Unfortunately, "Excluded" state doesn't prevent it from happening, as it only controls content indexing by code insight engine. We'll see what could be done here, please follow the ticket: Feel free to comment or upvote.

In addition, could you please enable additional logging by adding `#com.intellij.openapi.vfs.newvfs.RefreshSession` and `#com.intellij.openapi.vfs.newvfs.RefreshQueueImpl` options into `Help | Debug Log Settings`, reproduce the problem and add idea.log (`Help | Show Log in ...`) to the ticket? Do not forget to disable debug logging after that. It would help us to understand the problem better.


It's terrible -- I spent 75% of my day waiting on "Refreshing Files".  Please make it stop!


Completely agreed. I have to switch to a terminal for the subsequent build. I am in a moderately-sized repo, but the build system is bazel, which wants to know all its inputs locally, and so links them under "bazel-out". This is fine and good, and I have those dirs excluded from Clion.

CMake is being eclipsed as a build system, and as a paid product, Jetbeans needs to adapt CLion. Its a fantastic editor, but its ties to CMake is holding it back.

Please fix, and thanks to OP for pointing out.


Federico Sacerdoti besides CMake CLion already supports Gradle (only the new Gradle C/C++ projects), JSON compilation database, GNU Makefiles -

Bazel is not supported natively (, but is supported via the plugin maintained by Google -

As for the refreshing: in CLion 2020.2 we introduced new registry key (accessible through Find Action -> Registry). Turning on this registry key will make FS refresh after build not required for build to finish. This should help you in case refreshing takes too much time. However, there are several important notes:

  • Refresh will still be invoked after build is finished. Difference is that it'll not block running/debugging from starting immediately.
  • You might start experiencing some inconsistencies in UI (especially project view) and debugger - this is the main trade-off.

Thanks Anna for the reply, and that sounds like great progress with support for modern build systems. 

I'll try that registry entry, thanks for pointing it out. Regarding the need to ignore the excluded directories, since the "Run configurations" knows the executables it needs, should be quick to check them without a full scan. Regarding generated headers, if bazel was fully supported, would be easy to check those directly.

I looked for the bazel plugin, unfortunately it seems unsupported (and has been for 6mo or so). While Google is a reputable company with ferocious engineering, given their slow updates to the CLion plugin, it would be great for Jetbrains to take the lead on Bazel. 


I think should be the default. CLion used to be pretty fast here, but since 2021.1 it has been chugging for no good reason. 


Please sign in to leave a comment.