Session resume fails when working directory is accessed via symlink/junction
Bug Description
Claude Code fails to resume sessions when the working directory is accessed via a symlink or Windows junction point. The session resume performs a strict string comparison on directory paths instead of resolving symlinks to their canonical path first.
Environment
- OS: Windows 10 (CYGWIN_NT-10.0-22631)
- Claude Code: Latest version as of 2026-02-08
- Setup:
C:\SSis a Windows junction/symlink pointing toC:\Users\STATESMAN SERVICES
Why the symlink exists
The symlink was created to solve two real problems:
- Long path —
C:\Users\STATESMAN SERVICESis excessively long for daily CLI use - Space in path — The space between "STATESMAN" and "SERVICES" actively breaks tools, scripts, and CLI operations across bash, git, Python, Node.js, etc.
C:\SS eliminates both problems. This is a common and necessary Windows pattern.
Steps to Reproduce
- Create a symlink/junction:
mklink /J C:\SS "C:\Users\Username With Spaces" - Start a Claude Code session from
C:\SS - End the session
- Attempt to resume using
/resumeorclaude --resume <id>fromC:\Users\Username With Spaces(or vice versa)
Expected Behavior
Claude Code should resolve symlinks/junctions to their canonical (real) path before comparing directories. Both paths point to the same physical directory and should be treated as equivalent.
Actual Behavior
Claude Code displays:
This conversation is from a different directory.
To resume, run:
cd 'C:\Users\STATESMAN SERVICES' && claude --resume 386ee0b9-...
The /resume slash command inside Claude Code also triggers the same error.
Suggested Fix
Resolve both paths before comparison:
const fs = require('fs');
const canonicalSessionDir = fs.realpathSync(sessionDir);
const canonicalCurrentDir = fs.realpathSync(process.cwd());
if (canonicalSessionDir === canonicalCurrentDir) {
// Allow resume — same physical directory
}
Impact
- Forces users to remember which exact path string started each session
- Punishes users for using symlinks — a standard practice to work around Windows path issues
- Disrupts workflow continuity, which is the core value of session resume
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗