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

[BUG] Desktop: SSH sessions from different saved connections with the same folder path share one sidebar project group

Open paat opened this issue 2 weeks ago • 1 comments

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?

In the desktop app's Code tab, with the sidebar grouped by project, SSH sessions from two different saved SSH connections end up in the same project group when both sessions use the same folder path.

My setup: two saved SSH connections, host-a and host-b. They are two Docker dev containers on the same machine. Each ~/.ssh/config alias points at the same hostname and the same user, dev, on a different port. Each container has a different git repository checked out at /workspace, with a different origin remote.

What I see:

  • A session on host-a in /workspace and a session on host-b in /workspace sit in one sidebar group.
  • The group is labelled with host-b's repository name. The host-a session was created about two hours before the host-b one, so the label isn't taken from the first session in the group.
  • Before the host-b session existed, I didn't notice the host-a session being misfiled. I haven't confirmed which group it was in then.

What the stored session records show (claude-code-sessions/<org>/<user>/local_*.json):

field host-a session host-b session
sshConfig.sshHost host-a host-b
cwd / originCwd /workspace /workspace
gitAnchors, gitAnchorsFolderRealpath, folderPlace null null
startedFromEnvironmentId null null

So the app does record the correct host for each session. Neither record has git anchors or a folder place, which leaves sshHost + cwd as the only identifying data. The grouping seems to ignore sshHost here. It may key on the folder path alone, or on the resolved hostname/user plus path without the port. I can't tell which from the outside, because in my setup both hosts share the hostname and user.

Related but different: #102344 (project groups replaced by environments) and #102255 (environment stuck on a moved folder's old path).

What Should Happen?

Sessions from different saved SSH connections should never share a project group, even when the folder path, resolved hostname or user match. Each group should be labelled with its own project.

Error Messages/Logs

No errors. The session just appears in the wrong group.

Steps to Reproduce

  1. On one machine, run two containers with sshd on different ports, both with user dev and a git repo at /workspace, using different repositories.
  2. In ~/.ssh/config, add aliases host-a and host-b pointing to the same hostname with those two ports. Save both as SSH connections in the desktop app.
  3. Start a Code session on host-a in /workspace.
  4. Start a Code session on host-b in /workspace.
  5. With the sidebar grouped by project, both sessions appear in one group labelled with host-b's repository.

Not yet tested: whether two genuinely different machines with the same path also collide. That would show whether the key is the path alone or the hostname plus path.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.322 (Claude Code); Claude desktop 5.11492.2

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

A minor related gap: the session management tool's get_session returns isRemote: true and cwd, but not the SSH host. So from inside a session you can't tell which host another session ran on, even though the stored record has it.

paat avatar Nov 16 '26 10:11 paat

This has been fixed, so we're closing this issue. If you disagree, let us know here and we can re-open it. Thanks for reporting!

bpasero-ant avatar Nov 29 '26 18:11 bpasero-ant