Sessions should survive project directory renames

Resolved 💬 2 comments Opened Mar 23, 2026 by Raznak Closed Mar 23, 2026

Problem

Sessions are keyed by the absolute path of the project directory. If a user renames or moves their project folder, all previous sessions become unresumable — claude --resume <session-id> cannot find them.

Reproduction

  1. Start a Claude Code session in /path/to/my-project, give it a name
  2. Rename the directory: mv my-project my-project-v2
  3. cd my-project-v2 && claude --resume <session-id> → session not found

The session .jsonl files remain in ~/.claude/projects/-path-to-my-project/ but Claude Code now looks in ~/.claude/projects/-path-to-my-project-v2/ and finds nothing.

Expected behavior

Sessions should be recoverable after a project rename/move. Possible approaches:

  • Allow --resume <session-id> to search across all projects, not just the current directory
  • Provide a way to migrate sessions to a new project path
  • Key sessions by something more stable than the absolute path (e.g., git remote URL or a project UUID)

Current workaround

Create a symlink from the old path to the new one, then resume from the old path. Works but fragile.

Environment

  • Claude Code 2.1.81
  • macOS

---
Generated by Claude

View original on GitHub ↗

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