claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Parallel Diff Window Mismatch in JetBrains Claude Integration

Open bjonnh opened this issue 7 months ago • 6 comments

Bug Description Claude code Jetbrains integration (last version of both CLI and plugin), if you run several sessions (different project windows) in parallel sometimes the diffs will open in the wrong project window (so you can have a python project that will suddenly open a Java file from another project where CC was running).

Environment Info

  • Platform: linux
  • Terminal: pycharm
  • Version: 1.0.3
  • Feedback ID: d35256ed-950a-48ac-b9d8-8ca88fa1bf58

Errors Unrelated to the issue at hand

bjonnh avatar May 27 '25 02:05 bjonnh

Thanks for the report!

If you see this happen again, can you check whether or not Claude Code is connected to the right IDE? We've noticed a bug that Claude Code is connecting to the wrong IDE (so the cwd of Claude Code doesn't match that of the project root directories).

Wanted to see if it's related to this issue

hackyon-anthropic avatar May 28 '25 01:05 hackyon-anthropic

I checked and each instance of CC (started with the button in the toolbar) was showing the right project path. But it would still open in the wrong IDE window. Project 1 opens its diff in the right window Project 2 opens in project 1 window

The claude code instance CWD for both projects in /proc/[pid]/cwd points to the right directory as well.

Looking at ~/.claude/ide files:

➜  ide jq < 38079.lock 
{
  "workspaceFolders": [
    "<project2>"
  ],
  "pid": 8507,
  "ideName": "IntelliJ IDEA",
  "transport": "ws"
}
➜  ide jq < 38647.lock 
{
  "workspaceFolders": [
    "<project1>"
  ],
  "pid": 8507,
  "ideName": "IntelliJ IDEA",
  "transport": "ws"
}

So my guess is that it should remember which window of which project?

bjonnh avatar May 28 '25 14:05 bjonnh

Note that my two projects are indeed running in the same IDE, just two different project sessions.

bjonnh avatar May 28 '25 14:05 bjonnh

For the bug I reported between PyCharm and IntelliJ, indeed it may have been started in the wrong directory.

I guess we are talking about two different bugs now?

bjonnh avatar May 28 '25 14:05 bjonnh

Ah cool, thanks for the info!

  1. If it's between pycharm and intellij, then it's a different bug. I assume you used the /ide command to connect, and not through the button in the top right toolbar? It may be the case that the wrong ide was selected

  2. For the multiple project instances in pycharm, what exactly do you mean by that? Are they separate windows? Or are you using the full screen mode to fit multiple tabs in the same full screen session?

hackyon-anthropic avatar May 31 '25 13:05 hackyon-anthropic

I can reproduce in both pycharm and intellij (each running all by themselves).

open two projects in intellij (or two in pycharm they both do that) open claude code in each window. exit claude code in one of the window and reopen it now you have increased chances of new diff tabs opening in the wrong project .

it is not happening all the time so it is a bit weird.

let me know if I can ask CC about details of which window it is connected to, happy to help debug that.

bjonnh avatar May 31 '25 13:05 bjonnh

hey @bjonnh. We have submitted a fix for this in the 0.1.7-beta version of the plugin, which has been out for ~1 week now. When convenient, can you please update to the latest version and see if this is still happening to you?

hackyon-anthropic avatar Jun 13 '25 14:06 hackyon-anthropic

This has not been happening for a while so I consider it fixed. Thanks for the quick turn-around and the great product.

bjonnh avatar Jun 13 '25 16:06 bjonnh

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 10 '25 14:08 github-actions[bot]