claude-code - 💡(How to fix) Fix [BUG] claude -r fails on Windows due to case-sensitive path comparison on case-insensitive filesystem [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#48218Fetched 2026-04-15 06:29:51
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Root Cause

claude -r reports "This conversation is from a different directory" even when the user is in the correct directory. Root cause is a case-sensitive string comparison between the stored session path and the current working directory path. On Windows, NTFS is case-insensitive — C:\users\Tucker\CWD and C:\Users\Tucker\CWD are the same path, but Claude Code treats them as different.

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?

Environment: - OS: Windows 11

  • Shell: PowerShell 5.1 (conhost) - Claude Code CLI

Description:

claude -r reports "This conversation is from a different directory" even when the user is in the correct directory. Root cause is a case-sensitive string comparison between the stored session path and the current working directory path. On Windows, NTFS is case-insensitive — C:\users\Tucker\CWD and C:\Users\Tucker\CWD are the same path, but Claude Code treats them as different.

Steps to reproduce:

  1. Start a session in a directory where the path contains mixed case (e.g., C:\Users\Tucker\CWD)
  2. Close and reopen the terminal — path may resolve with different casing
  3. Run claude -r
  4. Claude reports wrong directory despite being in the correct location

Secondary defect:

The generated resume command uses && for command chaining (cd '...' && claude --resume <id>). && is not valid in PowerShell 5.1. The command fails immediately on copy-paste, which is its only intended use.

Expected behavior:

  • Path comparison should be case-insensitive on Windows
  • Generated resume command should use PowerShell-compatible syntax (; instead of &&) when running in a PowerShell context

What Should Happen?

Expected behavior:

  • Path comparison should be case-insensitive on Windows
  • Generated resume command should use PowerShell-compatible syntax (; instead of &&) when running in a PowerShell context

Error Messages/Logs

Steps to Reproduce

Steps to reproduce:

  1. Start a session in a directory where the path contains mixed case (e.g., C:\Users\Tucker\CWD)
  2. Close and reopen the terminal — path may resolve with different casing
  3. Run claude -r
  4. Claude reports wrong directory despite being in the correct location

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.105 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

To fix the issue, modify the Claude Code to perform case-insensitive string comparisons for session paths on Windows and update the generated resume command to use PowerShell-compatible syntax.

Guidance

  • Modify the path comparison logic in Claude Code to use case-insensitive string comparison on Windows, considering the case-insensitivity of NTFS.
  • Update the generated resume command to use ; instead of && for command chaining when running in a PowerShell context.
  • Verify the fix by reproducing the issue with the modified code and checking if the "This conversation is from a different directory" error persists.
  • Test the generated resume command in PowerShell to ensure it works as expected.

Example

# Before
cd 'C:\Users\Tucker\CWD' && claude --resume <id>

# After (PowerShell-compatible syntax)
cd 'C:\Users\Tucker\CWD'; claude --resume <id>

Notes

The provided information does not include the exact code responsible for the path comparison and resume command generation. Therefore, the suggested modifications are based on the issue description and may require additional investigation to implement correctly.

Recommendation

Apply the workaround by modifying the Claude Code to perform case-insensitive string comparisons and update the generated resume command to use PowerShell-compatible syntax, as this addresses the identified issues and provides a clear path forward.

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