Skip to content

Sessions should survive project directory renames #37954

Description

@Raznak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions