Cross-node session continuity for Claude Code. Sync conversations across machines using Syncthing and resume from any node in your cluster.
Claude Code stores conversations as .jsonl files in ~/.claude/projects/. session-roam syncs that directory peer-to-peer across your machines, enabling seamless session handoff between nodes.
Core workflow: exit a session on one machine, walk to another, type cr, and continue where you left off.
- Two or more machines running Claude Code
- Matching usernames and project paths across machines
- Ubuntu/Debian or macOS
- Network connectivity (LAN, Tailscale, or internet)
# First machine
git clone https://github.com/VirelNode/session-roam.git
cd session-roam
./setup.sh
# Second machine — use the device ID printed by the first
./setup.sh --device-id <FIRST_MACHINE_DEVICE_ID>
# Back on the first machine — add the second
./setup.sh --device-id <SECOND_MACHINE_DEVICE_ID>
# Both machines — install shortcuts and verify
./install-aliases.sh
source ~/.bashrc
./verify.shRepeat for additional nodes. Each machine needs the device IDs of its peers.
| Command | Description |
|---|---|
cr |
Resume most recent session (with namespace and staleness checks) |
cr --force |
Resume immediately, skip all checks |
cs |
Browse past sessions interactively |
cf "keyword" |
Search sessions by keyword |
cn "name" |
Start a new named session |
cfork ID |
Fork a past session (original stays unmodified) |
crf |
Fork the most recent session |
- Syncthing syncs
~/.claude/projects/peer-to-peer with a 2-second file watcher delay claude -creopens the most recent.jsonlsession file for the current directoryclaude -rprovides an interactive session browser across all namespacescrwrapsclaude -cwith a 2-second delay (for sync propagation), namespace validation, and stale session warnings
No central server. No cloud dependency. Peer-to-peer only.
| File | Purpose |
|---|---|
setup.sh |
Install Syncthing, configure the shared folder, pair devices |
install-aliases.sh |
Install shell aliases and .stignore patterns |
verify.sh |
Health check across 9 dimensions (service, API, folder, peers, sessions, ignore, conflicts, shortcuts, agent isolation) |
cr.sh |
Smart resume wrapper with namespace and staleness checks |
stignore.template |
Syncthing ignore patterns (skip worktrees and caches, keep sessions and memory) |
CONVENTIONS.md |
Session namespacing conventions for multi-agent setups |
- One writer at a time. Always exit a session before resuming on another machine. Two nodes writing the same
.jsonlconcurrently will produce Syncthing conflict files. - Context window limits still apply. Long sessions compact older context when resumed.
- Resolve conflicts promptly. If
verify.shreports.sync-conflict-*files, compare versions and keep the one with the data you need.
"No conversation to continue"
- Session file may not have synced yet. Wait a few seconds and retry.
- Run
verify.shto check peer connectivity.
Sync conflicts detected
- Conflict files are named
.sync-conflict-YYYYMMDD-HHMMSS. - Compare the conflict file with the original. Keep the better version, delete the other.
No peers connected
- Confirm Syncthing is running on both machines (
verify.shchecks this). - Ensure device IDs have been exchanged: run
setup.shon both nodes. - Behind NAT, Syncthing uses relay servers automatically.
Sessions not appearing on other nodes
- Verify both machines use the same working directory (e.g., both use
~/Desktop). - Run
verify.shon both nodes and compare session counts. - Check connectivity with
syncthing cli show connections.
- Does not sync memory databases (sqlite-vec, Qdrant, etc.) — those require separate infrastructure.
- Does not manage context window compaction.
- Requires the same OS username on all machines.
- LAN/Tailscale only by default. Internet sync is possible but you are responsible for securing it.
MIT