Skip to content

Open / resume any past session in any profile (cross-profile session port) #17

Description

@nitin-1926

Summary

Let any past Claude Code session be opened/resumed in any profile, not just the profile it was created in. Today, resume only works inside the originating profile because each profile has an isolated config dir and claude --resume <id> only sees that profile's transcripts under the current cwd.

Use case: a conversation started in the personal profile should be resumable in work (different account, skills, MCPs, billing) without losing the history.

Mechanism

"Open session X in profile B" = port the transcript, then resume:

  1. Copy the session file <profileA>/projects/<encoded-cwd>/<session>.jsonl into <profileB>/projects/<encoded-cwd>/ (same encoded-cwd subpath). Copy, not move — the original stays in profile A (fork semantics, non-destructive).
  2. Launch claude --resume <session-id> in profile B, in the original cwd.
  3. The conversation continues under profile B's account, skills, MCP servers, and billing.

Do not symlink — both profiles would append to one file and corrupt it. Copy = a clean fork.

Acceptance criteria

  • Spike first: verify a hand-ported transcript is actually resumable under another profile via claude --resume <id>. Confirm whether Claude Code also requires the session to appear in that profile's ~/.claude.json history or validates the recorded cwd — if so, replicate that too. Do not build UI until this is proven.
  • From the History browser (History: transcript reader + full-text search #4), "Open in profile…" action lets you pick a target profile.
  • Porting copies (never moves) the transcript into the target profile under the same encoded-cwd.
  • Resume launches in an embedded terminal (Embedded terminal (v1) #8) in the correct profile + original cwd.
  • Handles: target profile already has a session with that id (skip/dedupe), missing cwd, unknown profile — all without crashing.
  • Optional CLI counterpart, e.g. ccpm session port <id> --from <A> --to <B> (nice-to-have, decide during impl).

Dependencies

Risks / open questions

  • Claude Code may index sessions outside the raw .jsonl (config history) — covered by the spike.
  • Cross-account continuation: the ported conversation will be billed to and shaped by the target profile. That's the intended behavior, but call it out in the UI so it isn't surprising.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions