Cross-device fork: portable export target for --fork-session
Motivation
--fork-session already gives lossless local fork semantics: pick up where I left off in a new shell, with the full conversation, all the file states the model has seen, every edit it's made. The semantic primitive is exactly right. What's missing is a destination: today the fork stays on the laptop. I'd like it to be loadable elsewhere — a Claude chat on my phone during a commute, a colleague's machine for a handoff, a git commit for archival.
The concrete pain: I'm in flow on my laptop, I close it, I want to keep thinking on my phone for 20 minutes. Today the only options are summarizer-based (thedotmack/claude-mem) which throws away the chain-of-changes I care about, or raw-dump tools (jimmc414/cctrace, ZeroSumQuant/claude-conversation-extractor) which blow the context window because real sessions are full of redundant Read/Bash bytes.
Proposed UX
claude --fork-session --export <path>
Writes the session as a portable artifact at <path>, in a documented schema, that any Claude client (mobile, claude.ai, another claude CLI instance) can ingest as live context. Inverse:
claude --import <path>
…attaches the imported session as the starting context for a new conversation, the same way --fork-session does locally today.
Why this is small
Fork semantics are already documented and lossless. This issue isn't asking for a new context primitive — it's asking for the existing one to have a portable destination. The wire format is solved in user space: achiii800/claude-snap is a ~500-LOC pure-stdlib codec with byte-identical roundtrip on real session JSONLs, demonstrating the encoding/decoding side is tractable. The neighboring ecosystem (cctrace, claude-mem, claude-conversation-extractor) is evidence the demand exists; each is wallpapering over this gap from a different angle.
Related
This is the CLI primitive. The product UX for a normal user is a checkbox or setting, not a flag — see #55473 for that framing. The two are interlinked: the flag is the API the UX layer calls into.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗