Session history not visible when workspace is on a mapped network drive (Windows)
Environment
- OS: Windows 11
- Claude Code Extension: v2.1.81
- Drive: Mapped network drive (e.g.
Y:\→\<NAS_IP>\<share>)
Problem
The Claude Code sidebar panel shows only the active session. All previous sessions (with valid .jsonl files) are not listed in the session history.
Root Cause
The extension resolves the workspace path using realpathSync(), which on Windows follows mapped network drives to their UNC path:
Y:\path\to\project
→ \192.168.x.x\share\path\to\project
The session directory name is derived by sanitizing this resolved path. The sanitizer (tW() in the minified code) converts it to:
--192-168-x-x-share-path-to-project
However, sessions were originally created when the workspace was accessed via the drive letter, so they are stored under:
y--path-to-project
This mismatch means the extension looks for sessions in a directory that doesn't exist (~/.claude/projects/--192-168-x-x-...), while the actual session files live in ~/.claude/projects/y--path-to-....
How I confirmed this
- Patched
extension.jswithconsole.logat key points (listSessions,getProjectConfigDir,realpathresolution,readdir) - Filtered DevTools console for the debug prefix
- Observed:
realpathresolvesY:\...→\192.168.x.x\share\...readdirattempts to scan~/.claude/projects/--192-168-x-x-share-...→ ENOENT (directory does not exist)listSessionsreturns 0 sessions
Workaround
Create a directory junction (Windows equivalent of symlink) from the UNC-based directory name to the drive-letter-based one:
New-Item -ItemType Junction `
-Path "$env:USERPROFILE\.claude\projects\--192-168-x-x-share-path-to-project" `
-Target "$env:USERPROFILE\.claude\projects\y--path-to-project"
After reloading VS Code, all historical sessions appear correctly.
Note: mklink /J may fail with _"local NTFS volumes required"_ — use PowerShell New-Item -ItemType Junction instead.
Suggested fix
The extension should use a consistent, stable identifier for the project directory, rather than relying on realpathSync() which resolves differently depending on how the path is accessed. Options:
- Always use the original path (as provided by VS Code's
workspaceFolder.uri.fsPath) without resolving symlinks/mounts - Normalize mapped drives by checking if a path is on a mapped drive and using the drive letter form consistently
- On Windows, skip
realpathSyncfor network/mapped drives (detect viapath.parse()orGetDriveTypeequivalent) - Fall back: if the resolved-path directory doesn't exist, also check the original-path directory before returning 0 sessions
Related issues
- #22215 — "Past Conversations not showing despite valid sessions"
- #21280 — "Conversation History Lost on Reconnect Due to Path Resolution"
- #24465 — "/resume fails with subst/mapped drives on Windows"
- #25756 — "Duplicate CLAUDE.md due to drive letter casing"
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗