Skip to content

Session identity should be path-independent, not tied to project directory #41630

Description

@Sets

Problem

Claude Code currently ties session identity to the project directory path. This means that whenever the path changes — for any reason — you lose access to session history, `/resume`, `/rewind`, and all other session-based features.

Affected scenarios

This is not just a single edge case. The same root cause breaks the workflow in multiple situations:

  • Renaming or moving a project folder — session history is gone even though nothing about the project actually changed
  • Cloning the same repo on a different machine — new path, new session, lost context
  • Continuing work on another computer — even with the same repo, same branch, same everything, sessions don't transfer
  • Different users on the same machine — same project, different home directory, disconnected sessions

What should change

Session identity should be tied to something stable and portable rather than the filesystem path. Some concrete options:

  • Git remote URL — a natural stable identifier already present in most projects
  • Project UUID in .claude/ — Claude Code already uses this directory; a .claude/project-id file would be low-friction and work for non-git projects too
  • Hybrid — prefer git remote URL when available, fall back to a generated UUID stored in .claude/

This would unlock:

Current workarounds

  • SSH into the original machine and use tmux to reattach (works, but defeats the purpose of portability)
  • Maintaining detailed CLAUDE.md files to preserve project context (helps with context, not with history)

Why this matters

Right now, session portability is blocked at the architectural level, not the feature level. Bidirectional teleport, cross-machine continuity, and folder-move resilience are all symptoms of the same underlying issue: sessions are identified by path rather than by project.

Fixing the root cause would make all of these naturally solvable — and would also complement context continuity solutions like those proposed in #11455, #6553, and #9171, which address what Claude remembers between sessions but not the portability of the session itself.

Related issues

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