Session resume fails when working directory is accessed via symlink/junction

Resolved 💬 3 comments Opened Feb 8, 2026 by MoorAE Closed Feb 12, 2026

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:\SS is a Windows junction/symlink pointing to C:\Users\STATESMAN SERVICES

Why the symlink exists

The symlink was created to solve two real problems:

  1. Long pathC:\Users\STATESMAN SERVICES is excessively long for daily CLI use
  2. 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

  1. Create a symlink/junction: mklink /J C:\SS "C:\Users\Username With Spaces"
  2. Start a Claude Code session from C:\SS
  3. End the session
  4. Attempt to resume using /resume or claude --resume <id> from C:\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

View original on GitHub ↗

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