Preflight Checklist
What's Wrong?
When a project directory is moved or renamed on the filesystem, all previous Claude Code sessions become inaccessible in the VS Code extension. Sessions still exist on disk under ~/.claude/projects/ but are orphaned because Claude Code uses the absolute filesystem path as the project identifier.
After reorganizing ~134 repos on my machine, I lost access to 63+ sessions across 10+ projects. The data is still there but invisible.
Example:
~/.claude/projects/C--Users-User-Desktop-my-project/ <- 15 old sessions here (orphaned)
~/.claude/projects/C--Users-User-Projects-my-project/ <- new empty dir created after move
What Should Happen?
Sessions should follow the project when it's moved or renamed. At minimum, there should be a way to migrate/link old sessions to the new path. Ideally, Claude Code would use git remote URL as a secondary identifier so repo identity persists across moves.
Steps to Reproduce
- Open a project at
C:\Users\User\Desktop\my-project in VS Code
- Have several Claude Code sessions/conversations in that project
- Close VS Code
- Move the project folder to
C:\Users\User\Projects\my-project
- Open the project from the new path in VS Code
- Open Claude Code sidebar — previous sessions are gone, history is empty
Is this a regression?
I don't know
Claude Code Version
2.1.72 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Common real-world triggers:
- Repo reorganization / filesystem cleanup
- Renaming a folder
- Moving repos between directories
Suggested solutions:
- Session migration command: e.g.,
/migrate-sessions <old-path>
- Git-based identity: Use git remote URL as project identifier instead of only filesystem path
- Manual linking: Let users associate old project paths with new ones in settings
Preflight Checklist
What's Wrong?
When a project directory is moved or renamed on the filesystem, all previous Claude Code sessions become inaccessible in the VS Code extension. Sessions still exist on disk under
~/.claude/projects/but are orphaned because Claude Code uses the absolute filesystem path as the project identifier.After reorganizing ~134 repos on my machine, I lost access to 63+ sessions across 10+ projects. The data is still there but invisible.
Example:
What Should Happen?
Sessions should follow the project when it's moved or renamed. At minimum, there should be a way to migrate/link old sessions to the new path. Ideally, Claude Code would use git remote URL as a secondary identifier so repo identity persists across moves.
Steps to Reproduce
C:\Users\User\Desktop\my-projectin VS CodeC:\Users\User\Projects\my-projectIs this a regression?
I don't know
Claude Code Version
2.1.72 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Common real-world triggers:
Suggested solutions:
/migrate-sessions <old-path>