Make conversations portable across directory moves

Resolved 💬 3 comments Opened Mar 22, 2026 by tomgosling Closed Mar 26, 2026

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/myproject creates 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

View original on GitHub ↗

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