[FEATURE] Cross-machine session resume — sync session state for CLI-to-CLI handoff

Status Open
Maintainer reply None cached
Activity 10 comments · opened Mar 8, 2026

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

Summary

  • Allow a Claude Code CLI session started on one machine to be resumed from another machine's CLI, enabling true cross-device session handoff without requiring SSH or shared filesystems.

Current Workarounds

  • SSH + tmux: SSH into the original machine and reattach to a tmux session. Works, but requires the original machine to stay on and accessible.
  • Remote Control via claude.ai/code: Lets you view/interact with a running CLI session remotely, but the CLI must remain running on the host and you can't detach it to run locally on the second machine.
  • --from-pr: Resumes from a PR's context, but doesn't carry over the full conversation history.

None of these provide a true "hand off and continue locally" experience.

Proposed Solution

Sync session state (conversation history, tool outputs, working directory context) to the cloud so that claude --resume <session-id> works from any authenticated machine. This could involve:

  1. Cloud-backed session storage — Opt-in sync of session data to Anthropic's servers (tied to the user's account)
  2. Session export/import — A simpler alternative: claude session export <id> produces a portable file, claude session import <file> loads it on another machine
  3. Hybrid approach — Cloud sync for conversation history, with a prompt to re-establish local context (working directory, file state) on the new machine

Considerations

  • Privacy: Session data may contain sensitive code/context — cloud sync should be opt-in with clear data handling policies
  • File state divergence: The working directory on machine B may differ from machine A — the resumed session should handle this gracefully (e.g., warn about missing files, re-read changed files)
  • Authentication: Should be scoped to the same Anthropic account

Environment

  • macOS (both machines)
  • Claude Code CLI

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

Use Case

  • I work across multiple machines (e.g., Mac Studio at my desk, MacBook Pro on the go). When I start a Claude Code session on one machine, I'd like to pick it up seamlessly on another — continuing the same conversation, context, and working state.

Additional Context

_No response_

View original on GitHub ↗

8 Comments

toroleapinc · 5 months ago

This is a real workflow gap. I regularly switch between my desktop and laptop mid-task and the SSH+tmux workaround gets old fast.

I've been working on claude-brain which handles the config/state sync side of this — skills, memory, agents, rules, and settings all sync across machines via Git. It doesn't do full session transcript handoff yet, but it means your Claude Code environment is identical on both machines so you can pick up where you left off with the right context already loaded.

True session resume (with conversation history) would be amazing to see natively — that's something that really needs Anthropic's involvement since session state lives server-side.

master-of-null · 4 months ago

bump. I run Claude Code on both a local work machine and a remote dev box (same account) and want to see/search all historical sessions in one place. Right now /resume is machine-local and Remote Control only works for live sessions. A unified session history across devices would be huge.

VirelNode · 4 months ago

Built this. Ships today.

session-roam — Cross-node Claude Code session continuity using Syncthing.

claude -c on any machine in your cluster picks up exactly where you left off on another. No cloud, no server, just P2P file sync of ~/.claude/projects/.

Discovered it by accident during a late-night cluster maintenance marathon — rebooted a node, typed claude -c on a different machine, and the session was just... there. Syncthing had been silently syncing the session files.

What it includes:

  • setup.sh — one-command Syncthing config for Claude Code session sync
  • 6 shell shortcuts (cr to continue, cs to browse all sessions, cf to search, cn to name, cfork to branch)
  • verify.sh — 8-dimension health check
  • .stignore template optimized for Claude Code (skip worktrees/caches, keep sessions)

Requirement: Same username and project paths across machines. If you're running a homelab or multi-workstation setup with consistent paths, this just works.

Tested across a 4-node cluster. 600 sessions syncing. All checks passing.

https://github.com/VirelNode/session-roam

NeoAcar · 4 months ago

Exactly this. Built a git-based workaround while waiting for native support: [https://github.com/NeoAcar/claude-handoff](url)

Exports the full session (transcript, subagent logs, memory) into .claude-shared/, scrubs secrets, rewrites absolute paths, reconstructs under the receiver's ~/.claude/projects/. claude --resume picks it up with the original title and full history.

Requires a git push/pull between machines but no SSH, no shared filesystem, no cloud sync. Works today.

npm i -g @neoacar/claude-handoff

achiii800 · 4 months ago

+1. Two angles I haven't seen yet in this thread or its neighbors that might be worth folding in:

Continuity for users without persistent compute. A class of users who'd benefit immediately from a portable export target: people who can't keep a laptop or VM on all the time. Students, anyone on a single shared device, anyone in a context where leaving a workstation running overnight isn't an option. Today, when they close the laptop, the session is gone in any practical sense — the JSONL is on disk, but loading it back means being at the same machine. A documented portable export format makes Claude Code something they can think with while not at compute, and pick up execution when they're back at a workstation. Not a power-user convenience — a different shape of user accessing the workflow at all.

The codec layer is solved in user space. achiii800/claude-snap is a ~500-LOC pure-stdlib Python codec that does this end-to-end on real ~/.claude/projects/ JSONLs:

  • Lossless structural codec — re-Reads of unchanged files and repeated identical Bash outputs become sha256 content-hash refs; conversational turns and Edit/Write payloads stay verbatim; mutation invalidates dedup.
  • Byte-identical roundtrip — parse → pack → write → read → unpack reconstructs the original event list with no diff after canonical re-serialization. Regression-tested on synthetic and real sessions.
  • Refs carry per-event metadata (uuid / parentUuid / timestamp / sessionId / requestId / sourceToolAssistantUUID) and patch it back on unpack, so each restored event is byte-identical to the original — not just "an event with the same content."
  • Output is still valid JSONL (refs are an additional event type in the same stream), so packed files remain greppable and streamable.

Distinct from the neighboring tools: cctrace transcribes (lossy md/xml + verbatim copy of the JSONL, no codec), claude-mem summarizes via the agent-sdk (lossy by design), claude-conversation-extractor emits markdown (lossy). claude-snap is the only one of these where pack→unpack roundtrips byte-for-byte.

So the wire format isn't the gating problem — what's missing is the official surface (claude --fork-session --export <path> and claude --import <path>) and the matching ingestion path on receiving Claude clients. Cite this if it helps with the codec/format discussion.

edwinhu · 3 months ago

+1, with an adjacent ask: alongside resume, a native cross-machine spawn would be huge. Concrete use case: I'm signed into the same account on a laptop and a desktop, and I want to fire off a long-running session on the desktop from the laptop CLI (e.g. claude --on <machine-id> "..." or claude bg --remote <machine-id>) without SSH or third-party wrappers. Today Remote Control only exposes sessions started locally — there's no way to start one on a peer machine the account already owns.

Two third-party products already ship this on top of CC: Happy (slopus/happy) and Vibe Companion (The-Vibe-Company/companion). Notably, Vibe Companion gets there by reverse-engineering an undocumented --sdk-url WebSocket protocol — which suggests the underlying primitive already exists internally and just needs an officially supported surface. Two independent teams building this is a strong signal of demand; pulling spawn-on-peer into the native CLI would let those projects focus on UX instead of reimplementing transport.

Kleptobyte · 3 months ago

Late to the party but if you're doing any kind of handoff, Envoy (my tool) is worth considering.

https://github.com/statecraft-protocol/envoy

PetePeter · 29 days ago

hi
my tool https://github.com/PetePeter/gamepad-cli-hub
works on mac and pc
it includes an mcp server so each Claude, or codex, or GitHub copilot can send messages to other cli instances in the same machine, or on other machines running the same tool

so last night, on the mac it's building the ios version of my app, while sending messages to claude on my pc to ensure the build still works etcetc

give it a go. it may alleviate your cross pc usage

Showing cached comments. Read the full discussion on GitHub ↗