claude-code - 💡(How to fix) Fix [BUG] /resume and --resume fail on Windows mapped drive to WSL (both CLI and VS Code extension) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48720Fetched 2026-04-16 06:52:52
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

Root Cause

Root cause: Same as #38186 and #33140 — realpathSync() resolves the mapped drive letter to the underlying UNC path (\\wsl.localhost\...), producing a different sanitized project directory name than what was used when the session was originally created.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When accessing a WSL directory via a Windows mapped drive letter (e.g., Z:\home\user\code\project mapped to \\wsl.localhost\Ubuntu\home\user\code\project), both the CLI (claude --resume) and the VS Code extension (/resume) fail to find any previous sessions.

Affects: CLI + VS Code extension (not just one of them)

Root cause: Same as #38186 and #33140 — realpathSync() resolves the mapped drive letter to the underlying UNC path (\\wsl.localhost\...), producing a different sanitized project directory name than what was used when the session was originally created.

  • Sessions created via Z:\... are stored under ~/.claude/projects/z--home-user-code-project/
  • On resume, realpathSync() resolves Z:\ to \\wsl.localhost\Ubuntu\..., so it looks in ~/.claude/projects/--wsl-localhost-Ubuntu-home-user-code-project/ — which doesn't exist

This affects every session, not just some — resume is completely broken in this setup.

Difference from existing issues

IssueScopeStatus
#38186VS Code extension only, NAS/network driveOpen
#33140VS Code extension only, SMB driveOpen
#26815CLI only, Google DriveClosed
This issueBoth CLI and VS Code extension, WSL mapped drive

The underlying bug is the same (realpathSync path mismatch), but this report confirms it affects the CLI as well, not just the VS Code extension. WSL mapped drives are a common Windows development setup.

Environment

  • OS: Windows 11 Pro (Build 26200)
  • Shell: Git Bash / PowerShell
  • WSL: Ubuntu (accessed via Z:\ drive mapping to \\wsl.localhost\Ubuntu\)
  • Claude Code: Latest version (VS Code extension + CLI)

What Should Happen?

  1. claude --resume in the CLI should find sessions regardless of whether the CWD is accessed via a drive letter or UNC path
  2. The VS Code extension's session list should show all previous sessions
  3. The project directory identifier should be stable — either always use the original path without resolving, or normalize both paths to the same form

Suggested Fix

Skip or normalize realpathSync() on Windows when the path is on a mapped/virtual drive. Use the path as provided by the user/VS Code workspace, not the resolved UNC path. See #38186 for a detailed analysis.

extent analysis

TL;DR

The issue can be fixed by skipping or normalizing realpathSync() on Windows when the path is on a mapped/virtual drive, to ensure consistent project directory identifiers.

Guidance

  • Verify that the issue is indeed caused by the realpathSync() function resolving the mapped drive letter to the underlying UNC path, by checking the project directory names in ~/.claude/projects/.
  • Consider implementing a check for Windows mapped drives and skipping realpathSync() in such cases, to prevent the path mismatch.
  • As a temporary workaround, try accessing the WSL directory directly via the UNC path (\\wsl.localhost\Ubuntu\...) instead of the mapped drive letter (Z:\...), to see if sessions are properly resumed.
  • Review the suggested fix in #38186 for a detailed analysis and potential implementation.

Example

No code snippet is provided, as the issue is more related to the underlying logic and path resolution rather than a specific code block.

Notes

The issue affects both the CLI and VS Code extension, and is not limited to a specific setup or environment. The suggested fix should be tested thoroughly to ensure it resolves the issue without introducing new problems.

Recommendation

Apply the workaround of accessing the WSL directory directly via the UNC path, until a proper fix is implemented that normalizes or skips realpathSync() on Windows mapped drives. This should allow for proper session resumption in the meantime.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING