Session history not visible when workspace is on a mapped network drive (Windows)

Resolved 💬 3 comments Opened Mar 24, 2026 by jobanpreetsingh681-hub Closed May 3, 2026

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

  1. Patched extension.js with console.log at key points (listSessions, getProjectConfigDir, realpath resolution, readdir)
  2. Filtered DevTools console for the debug prefix
  3. Observed:
  • realpath resolves Y:\...\192.168.x.x\share\...
  • readdir attempts to scan ~/.claude/projects/--192-168-x-x-share-...ENOENT (directory does not exist)
  • listSessions returns 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:

  1. Always use the original path (as provided by VS Code's workspaceFolder.uri.fsPath) without resolving symlinks/mounts
  2. Normalize mapped drives by checking if a path is on a mapped drive and using the drive letter form consistently
  3. On Windows, skip realpathSync for network/mapped drives (detect via path.parse() or GetDriveType equivalent)
  4. 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"

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗