Fix for the VS Code Claude Code extension showing empty "Past Conversations" on virtual/mapped drives.
Affected: Windows users with rclone mounts, subst drives, mapped network drives, or WinFsp/FUSE mounts.
Related: anthropics/claude-code#12872 (30+ affected users)
The Claude Code VS Code extension computes a project directory name from your workspace path. For example, workspace Z:\ maps to ~/.claude/projects/z--/.
However, the extension calls fs.realpath() on the workspace path before computing the directory name. On virtual drives, realpath resolves to the underlying path:
| Drive Type | Workspace | realpath resolves to | Extension looks in |
|---|---|---|---|
| rclone SFTP | Z:\ |
\\server\share\ |
--server-share- |
| subst | Z:\ |
C:\Users\me\project |
C--Users-me-project |
| Network | Z:\ |
\\nas\data\ |
--nas-data- |
The CLI stores sessions in z-- but the extension looks in --server-share- (or similar). Mismatch = empty Past Conversations.
The CLI's claude --resume still works because it uses the raw path without realpath.
python fix_sessions.py Z:\This creates an NTFS directory junction linking the extension's expected directory to the CLI's actual session directory.
# Fix a specific drive
python fix_sessions.py Z:\
# Diagnose only (no changes)
python fix_sessions.py Z:\ --diagnose-only
# Scan all drives for mismatches
python fix_sessions.py --scan
# Group sessions by topic/project (preview)
python fix_sessions.py --group z-- --diagnose-only
# Group sessions by topic/project (apply titles)
python fix_sessions.py --group z--
# Auto-detect and group all projects
python fix_sessions.py --group=== Claude Code Session Fix Diagnostic ===
1. Workspace path: Z:\
CLI directory name: z--
CLI directory exists: True
Sessions in CLI dir: 23 .jsonl files
2. Resolved path: \\server\hgcc_workspace\
Extension directory name: --server-hgcc-workspace-
Extension directory exists: False
3. MISMATCH DETECTED!
CLI uses: z--
Extension uses: --server-hgcc-workspace-
Sessions are in CLI dir (23 files), extension dir is empty/missing.
4. FIX: Creating directory junction...
SUCCESS! Junction created.
5. Now reload VS Code: Ctrl+Shift+P -> 'Developer: Reload Window'
Then check Past Conversations in Claude Code extension.
- Reload VS Code:
Ctrl+Shift+P-> "Developer: Reload Window" - Click Past Conversations in the Claude Code extension
- Your sessions should now appear
- The junction persists across reboots -- you only need to run this once
- If you change your rclone/mount configuration, re-run the script
- Make sure the virtual drive is mounted before opening VS Code
- No admin rights needed (NTFS junctions don't require elevation)
- Requires Python 3.6+ (no external dependencies)
When you have many sessions about the same project (e.g., 10 Centromere sessions), they appear as separate entries in Past Conversations. The --group feature auto-detects which sessions belong together and applies numbered custom titles:
Before: After:
iridescent-conjuring-rocket Project3_NicheQTL [1/1]
reactive-spinning-walrus Project2.1_NUMT_Fu_reproduce [1/1]
proud-rolling-teapot Project1_Centromere [1/8]
tidy-conjuring-cloud Project1_Centromere [2/8]
curious-jumping-key Project1_Centromere [3/8]
... ...
The script uses three layers of evidence from ~/.claude/, falling back automatically:
-
search.dbfile_changes (strongest) -- SQLite database tracks which files each session edited. File paths reveal the project folder (e.g.,z:/Project1_Centromere/src/Snakefile->Project1_Centromere). -
file-history/hash overlap -- Sessions that modified the same files (matching content hashes) are grouped together via connected-component clustering. -
First prompt path extraction (fallback) -- Extracts project folder names from file paths referenced in the session's first user message.
This works for any user without configuration -- it reads data Claude Code already stores locally.
- Takes your workspace path (e.g.,
Z:\) - Computes the CLI's directory name:
z-- - Resolves the real path via
os.path.realpath():\\server\share\ - Computes the extension's expected directory name:
--server-share- - Creates an NTFS junction:
~/.claude/projects/--server-share-->~/.claude/projects/z--
Both the CLI and VS Code extension now read/write to the same session directory.
MIT