IntelliJ/JetBrains plugin: IDE UI freezes — EDT blocked by DiagnosticTools synchronous VFS refresh requiring a write lock while MCP tool runs

Status Open
Reported on v2.1.222
Maintainer reply None cached
Activity 0 comments · opened Aug 5, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Note: this is the same root cause as #53637 (closed as "not planned"/stale by the bot, now locked) and is related to #62767. The bot on #53637 explicitly asked to file a new issue referencing it, so I'm re-reporting because it still reproduces on the current plugin (0.1.14-beta) and CLI 2.1.222.

IntelliJ IDEA freezes intermittently (UI/EDT hangs, "please wait" overlay) after the IDE has been open for a while, especially while Claude Code is processing and making tool calls (e.g. opening diffs / validating files).

A thread dump captured during a freeze shows the AWT event thread blocked inside the Claude Code JetBrains plugin's DiagnosticTools:

  • AWT-EventQueue-0 is parked in com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1.invokeSuspend$lambda$1(DiagnosticTools.kt:96), which calls VirtualFile.refresh() -> VFS RefreshSessionImpl.fireEvents -> ApplicationImpl.runWriteActionWithNonCancellableProgressInDispatchThread -> NestedLocksThreadingSupport.upgradeWritePermit. It is waiting to acquire the write lock (SuvorovProgress.showNiceOverlay paints the freeze overlay).
  • The MCP request-handler coroutine worker is at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1.invokeSuspend(DiagnosticTools.kt:81) -> ApplicationImpl.invokeAndWait, blocked waiting for that EDT computation to finish.
  • Meanwhile many background threads hold read locks (numerous NestedLocksThreadingSupport.tryRunReadAction frames), so the EDT cannot upgrade to the write lock and the UI hangs.

Likely root cause: DiagnosticTools performs a synchronous VirtualFile.refresh() on the EDT via invokeAndWait that needs a write action; under read-lock contention this deadlocks/hangs the UI thread. A background/async VFS refresh (asynchronous = true), or avoiding the blocking write-action on the EDT, would likely fix it.

What Should Happen?

The plugin's diagnostic/file-refresh operation should run off the EDT (e.g. asynchronous VFS refresh) so the IDE UI never blocks while Claude Code processes tool calls. File operations should complete without freezing the UI thread, even under read-lock contention.

Error Messages/Logs

"AWT-EventQueue-0" prio=0 tid=0x0 nid=0x0 waiting on condition
   java.lang.Thread.State: TIMED_WAITING
	at jdk.internal.misc.Unsafe.park(Native Method)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:271)
	at com.intellij.openapi.progress.util.SuvorovProgress.showNiceOverlay(SuvorovProgress.kt:216)
	at com.intellij.openapi.progress.util.SuvorovProgress.dispatchEventsUntilComputationCompletes(SuvorovProgress.kt:153)
	at com.intellij.platform.locking.impl.NestedLocksThreadingSupport$ComputationState.upgradeWritePermit(NestedLocksThreadingSupport.kt:382)
	at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runWriteActionBlocking(NestedLocksThreadingSupport.kt:995)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithNonCancellableProgressInDispatchThread(ApplicationImpl.java:1120)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEvents(RefreshSessionImpl.kt:247)
	at com.intellij.openapi.vfs.VirtualFile.refresh(VirtualFile.java:702)
	at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1.invokeSuspend$lambda$1(DiagnosticTools.kt:96)

"MCP request handler (coroutine worker)"
   java.lang.Thread.State: (parked)
	at com.intellij.util.concurrency.Semaphore.waitFor(Semaphore.java:114)
	at com.intellij.openapi.application.impl.LaterInvocator.invokeAndWait(LaterInvocator.java:152)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:667)
	at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1.invokeSuspend(DiagnosticTools.kt:81)
	at io.modelcontextprotocol.kotlin.sdk.server.Server.handleCallTool(Server.kt:395)
	at com.anthropic.code.plugin.mcp.WebSocketMcpServerTransport$start$2$1.invokeSuspend(WebSocketMcpServerTransport.kt:69)

(Dump also shows ~9 JobScheduler FJ pool threads BLOCKED and many background threads in NestedLocksThreadingSupport.tryRunReadAction holding read locks. JBR: java.base@25.0.2.)

Steps to Reproduce

  1. Open a project in IntelliJ IDEA with the Claude Code [Beta] plugin active, and leave the IDE running for a while.
  2. Use Claude Code (CLI in the integrated terminal) and let it process tool calls that touch files (diffs / diagnostics / file refresh).
  3. While it is processing, the IDE UI freezes (the "please wait" overlay) for several seconds, sometimes longer.

The freeze is intermittent and more likely the longer the IDE has been open (more accumulated read locks). The attached/pasted thread dump was captured during one of these freezes and shows the EDT blocked in DiagnosticTools.kt:96.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.143 (Claude Code) when the dump was captured; still reproduces after updating to 2.1.222. JetBrains plugin: Claude Code [Beta] 0.1.14-beta. JBR Java 25.0.2, win32-x64.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

Environment: IntelliJ IDEA on Windows, Claude Code [Beta] plugin 0.1.14-beta, CLI installed via npm-global. Directly connected to the Anthropic API. Full thread dump available on request; the two relevant stacks are pasted in Error Messages/Logs above. Same root cause as the now-closed/locked #53637 and related to #62767.

View original on GitHub ↗