Why Claude Code sessions break when you switch machines and how to fix it
Claude Code stores conversation history under ~/.claude/projects/, where each folder is named after the absolute path of the project with slashes replaced by hyphens. When a user moves to a new machine with a different username or directory structure, Claude Code cannot find the matching folder and shows an empty session history. Beyond the folder name, every transcript line also records the old working path internally, meaning sessions still reference files from the previous machine even after renaming. The fix involves manually renaming the project folder, rewriting the stored paths inside each .jsonl transcript, and updating the project map in .claude.json to reflect the new file system layout. Windows users face an additional complication since JSON double-escapes backslashes, so path-replacement commands must account for the difference between what appears on disk and what is typed in the terminal.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in