Local sessions list empty for workspaces on a mapped network drive (native realpath != session-write path on Windows)
Version: 2.1.210 (VSCode extension), Windows 11
Summary
When a VSCode workspace is opened on a mapped network (SMB) drive (e.g. Z:\ mapped to \\SERVER\share), the Local sessions tab always shows "No sessions yet", even though sessions exist and claude --resume from a terminal lists/loads them fine.
Root cause
Sessions are stored under ~/.claude/projects/<encoded-cwd>/. There's an inconsistency in how the cwd is resolved:
- Session writer / CLI: uses the raw cwd
Z:\→fs.realpathSync('Z:\\')returnsZ:\→ folderZ--. Sessions are written here. - Extension session lister (
listSessions→Gse): resolves the path withfs.realpathSync.native(), which on Windows resolves the mapped drive to its UNC target\\SERVER\share→ folder--SERVER-share. This folder doesn't exist, soreaddirthrows and the list is empty.
Reproduction of the divergence:
fs.realpathSync('Z:\\') // => 'Z:\\' (folder Z--)
fs.realpathSync.native('Z:\\') // => '\\\\SERVER\\share' (folder --SERVER-share)
Steps to reproduce
- Map a network share to a drive letter (
net use Z: \\SERVER\share). - Open
Z:\as a VSCode workspace, run a Claude Code session. - Session file is written under
~/.claude/projects/Z--/. - Open the Sessions panel → Local → "No sessions yet" (CLI
claude --resumefromZ:\shows it correctly).
Impact
All local session history is invisible in the extension UI for any workspace on a mapped network drive.
Suggested fix
Use the same path-resolution strategy for listing as for writing (avoid realpathSync.native for the projects-folder key, or apply the same resolution in both places).
Workaround
Junction the folder the lister expects to the real one:
mklink /J "%USERPROFILE%\.claude\projects\--SERVER-share" "%USERPROFILE%\.claude\projects\Z--"This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗