Make conversations portable across directory moves
Problem
Claude Code conversations are tied to the absolute path of the working directory. If you move or rename the project folder, all previous conversations become inaccessible (or corrupted if manually copied to the new project directory).
This is a common scenario — reorganising repos into subdirectories, renaming folders, moving projects into monorepos, etc.
Current behaviour
- Conversations are stored under
.claude/projects/keyed by the full absolute path (e.g.-Users-foo-tools-myproject/) - Moving
/Users/foo/tools/myproject→/Users/foo/src/tools/myprojectcreates a new, empty project directory - Old conversations are orphaned under the old path key
- Copying the JSONL files to the new directory results in broken/corrupted conversations, likely due to absolute paths embedded in the conversation state
Suggested improvement
Use paths relative to the project root (e.g. the git repo root) within conversation state rather than absolute paths. This would make conversations survive directory moves without breaking.
The project directory lookup could still use absolute paths for indexing, but the conversation content itself should be path-agnostic so it can be migrated or relinked when the project moves.
Alternatively, provide a claude conversations migrate command or similar mechanism to update paths when a project is moved.
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗