[BUG] claude --resume fails when switching terminals despite session files being accessible

Resolved 💬 4 comments Opened Mar 3, 2026 by nicholsonrl Closed Mar 31, 2026

Preflight Checklist

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

What's Wrong?

● Bug Report: claude --resume fails when switching terminals despite session files being accessible

---
Environment: - OS: Windows with WSL Debian (single distro, single user account: ronn)

  • IDE: Visual Studio 2026 with integrated WSL terminal - Claude Code version: 2.1.63

Steps to Reproduce:

  1. Start a Claude Code session from within Visual Studio 2026's integrated WSL terminal (/mnt/c/Repos/... project folder)
  2. End the session cleanly with /exit — session ID is output (e.g. 5250755c-d7cc-4a1b-aab4-0873e00dffbd)
  3. Open a standalone WSL Debian terminal (same distro, same user, same $HOME=/home/ronn)
  4. Navigate to the same project folder
  5. Run claude --resume 5250755c-d7cc-4a1b-aab4-0873e00dffbd

Expected: Session resumes normally

Actual: No conversation found with session ID: 5250755c-d7cc-4a1b-aab4-0873e00dffbd

Additionally: Running claude --resume (no args) in the new terminal reports no sessions at all, even though the session files are confirmed visible at the correct path.

Investigation:

  • Confirmed same $HOME in both terminals
  • Confirmed same Claude Code version (2.1.63) in both terminals
  • Confirmed session files exist and are readable from the new terminal:

/home/ronn/.claude/projects/-mnt-c-.../5250755c-....jsonl

  • Found a ~/.claude/session-env/5250755c-... file that appears to capture the environment at session start — suspected to contain Visual Studio 2026-specific environment

variables (VSAPPIDDIR, VSLANG, etc.) that are not present in a standalone WSL terminal, causing the resume check to fail

Root cause hypothesis: --resume validates the current environment against the captured session-env snapshot. Sessions started inside Visual Studio's integrated terminal cannot
be resumed from any other terminal due to missing IDE-injected environment variables.

Suggested fix: Either make --resume environment-agnostic, or provide a meaningful error message explaining why the resume is being rejected (e.g. "session was started in a
different environment").

What Should Happen?

Environment: - OS: Windows with WSL Debian (single distro, single user account: ronn)

  • IDE: Visual Studio 2026 with integrated WSL terminal - Claude Code version: 2.1.63

Steps to Reproduce:

  1. Start a Claude Code session from within Visual Studio 2026's integrated WSL terminal (/mnt/c/Repos/... project folder)
  2. End the session cleanly with /exit — session ID is output (e.g. 5250755c-d7cc-4a1b-aab4-0873e00dffbd)
  3. Open a standalone WSL Debian terminal (same distro, same user, same $HOME=/home/ronn)
  4. Navigate to the same project folder
  5. Run claude --resume 5250755c-d7cc-4a1b-aab4-0873e00dffbd

Expected: Session resumes normally

Error Messages/Logs

No conversation found with session ID: 5250755c-d7cc-4a1b-aab4-0873e00dffbd

Steps to Reproduce

Steps to Reproduce:

  1. Start a Claude Code session from within Visual Studio 2026's integrated WSL terminal (/mnt/c/Repos/... project folder)
  2. End the session cleanly with /exit — session ID is output (e.g. 5250755c-d7cc-4a1b-aab4-0873e00dffbd)
  3. Open a standalone WSL Debian terminal (same distro, same user, same $HOME=/home/ronn)
  4. Navigate to the same project folder
  5. Run claude --resume 5250755c-d7cc-4a1b-aab4-0873e00dffbd

Expected: Session resumes normally

Actual: No conversation found with session ID: 5250755c-d7cc-4a1b-aab4-0873e00dffbd

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.63 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

Started Session in Visual Studio 2026 Professional. Wanted to switch a normal terminal window. Closed Claude code properly, tried to open the session in the new window. The 'What happened' box has the claude code synopsis of what happened and the steps take.

View original on GitHub ↗

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