[BUG] Desktop: SSH sessions from different saved connections with the same folder path share one sidebar project group
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-ain/workspaceand a session onhost-bin/workspacesit in one sidebar group. - The group is labelled with
host-b's repository name. Thehost-asession was created about two hours before thehost-bone, so the label isn't taken from the first session in the group. - Before the
host-bsession existed, I didn't notice thehost-asession 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
- On one machine, run two containers with sshd on different ports, both with user
devand a git repo at/workspace, using different repositories. - In
~/.ssh/config, add aliaseshost-aandhost-bpointing to the same hostname with those two ports. Save both as SSH connections in the desktop app. - Start a Code session on
host-ain/workspace. - Start a Code session on
host-bin/workspace. - 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.
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!