[FEATURE] Transfer session to another claude code instance
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Feature Request: Portable / transferable sessions between Claude Code instances
Summary
Provide a first-class way to transfer a Claude Code CLI session: its full transcript, resumability, and associated project memory from one machine to another, so that claude --resume <session-id> works on a different host than the one the session started on.
Problem
Session transcripts are stored as machine-local JSONL files under ~/.claude/projects/<path-derived-dir>/<session-id>.jsonl, with no built-in sync or export/import. The existing machine-independence features don't cover the common infra-team workflow:
- Cloud sessions /
--remote/--teleportmove execution onto Anthropic's cloud sandbox â^@^T unusable when the work requires the local environment (GPUs, mounted NFS datasets, internal APIs reachable only from the pod). - Remote Control (
--remote-control) only steers a running local session from a browser/phone; it dies with the original machine. CLAUDE_CONFIG_DIRpointed at shared storage is undocumented/partially implemented (GH #25762, #3833, #30538) and unsafe over NFS.- The only workaround today is hand-tarring
~/.claudebetween hosts â^@^T which is fragile, unofficial, and dangerous by default because~/.claudealso contains live credentials (.credentials.json); a naive copy to shared storage or S3 leaks auth tokens.
Proposed Solution
claude session export <session-id> [--out file]produces a self-contained, credential-free archive (transcript, project memory, optionally plans/file-history).claude session import <file>on another machine egisters it soclaude --resume <session-id>just works (validating/re-mapping the working-directory path).
Alternative Solutions
opt-in encrypted session sync via the user's Anthropic account, keeping execution local.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
I run long, stateful engineering sessions with Claude Code on ephemeral GPU dev pods (Kubernetes). Mid-project, the pod gets replaced e.g. moving from a 1-gpu H100 pod to an 8-gpu^WH100 pod to scale up a training run. The repo, shared NFS, and datasets all carry over; the session — hours of accumulated context: architectural decisions, verified numerical results, in-flight experiment state, agent memory — does not. Losing it means re-explaining the project or relying on hand-written handoff docs, which are lossy compared to the actual transcript. Pods are never concurrent, so this is a pure migrate-and-resume scenario, not a sync problem.