hopsesh guide · Claude Code
How to use Claude Code sessions on two computers (laptop and desktop)
Drive it remotely, sync the folder, or move the session when you switch. What goes wrong with file sync, and round trips between two computers without drift.
Why sessions don’t follow you
Claude Code saves each session as a file on the computer where it runs, ~/.claude/projects/<project>/<session-id>.jsonl. Nothing uploads it. Start a session on your desktop, sit down at your laptop, and claude --resume there doesn’t know it exists. Codex is the same, with its sessions in ~/.codex/sessions.
So “using Claude Code on two computers” means choosing one of three things: keep the session on one computer and reach it from the other, keep the files in sync, or move the session when you switch.
Option 1: leave it on the desktop and drive it remotely
Claude Code’s Remote Control connects a running session to claude.ai/code or the Claude app. On the desktop, run /remote-control in the session (or start it with claude --remote-control), then open the link on the laptop.
- Good for: checking in, answering a prompt, giving the next instruction. Claude keeps running on the desktop, with the desktop’s files.
- Limits: the desktop has to stay on with
clauderunning, it needs a claude.ai subscription (Pro, Max, Ultra, Team or Enterprise; no API keys), and every edit lands on the desktop, not in your laptop’s checkout.
The same idea without Anthropic in the middle is SSH plus tmux on the desktop. hopsesh vs Remote Control compares the two approaches in detail.
Option 2: sync ~/.claude with a file-sync tool
Syncthing, Dropbox or an rsync script can keep ~/.claude/projects the same on both computers. It works best when both have the same username and the repositories at the same absolute paths. The problems:
- Paths. If the laptop is
/Users/aliceand the desktop/home/alice, sessions are filed under folders named after the other computer’s path, and the paths inside them point there too. - Conflicts. A transcript is appended to as you work. Open the same session on both computers and the sync tool sees two versions of one file; you get a conflict copy or a lost half.
- Duplicates. When an id turns up in two other project folders, Claude Code won’t pick one, so a stray copy makes
claude --resume <id>sayNo conversation found with session ID. - Too much. Don’t sync logins: on Linux and Windows Claude Code keeps yours in
~/.claude/.credentials.json. Sign in on each computer.
If you go this way, sync only ~/.claude/projects, keep repositories at the same paths, and never have one session open on both computers at once.
Option 3: move the session when you switch
Move the one session you’re working on, when you switch computers:
- Commit and push on the desktop; pull on the laptop.
- Quit the session on the desktop.
- Copy its
.jsonl(and its side folder, if there is one) into the project folder for the repository’s path on the laptop. - Fix the paths inside if they differ, and run
claude --resume <id>.
Then do it all again in the other direction tomorrow. Move a Claude Code session to another computer has every step and error.
Move it back and forth with hopsesh
hopsesh is a free, open-source command-line tool, terminal UI and app for macOS and Windows that does option 3 for Claude Code and Codex, over your own SSH. Set it up once on the laptop:
hopsesh hosts # computers found in Tailscale and ~/.ssh/config
hopsesh hosts allow desktop # let hopsesh connect to one
hopsesh trust desktop # confirm its SSH host key
Then, each time you switch:
hopsesh # browse sessions on both computers
hopsesh pull desktop:"fix flaky tests" # bring one here
The plan comes first. hopsesh finds the repository on the laptop or clones it, brings the code to the session’s commit (fetching it from the desktop if you never pushed), rewrites the paths and prints the claude --resume command.
Round trips without drift
- The copy you left is blocked. By default the desktop’s copy refuses new prompts until you move the session back, so you can’t end up with two diverging conversations by accident.
- Bringing it back is one command. On the desktop,
hopsesh pull "fix flaky tests"with no computer name takes the newest copy, wherever it is, into the folder it came from. - It never merges. If both copies changed anyway, hopsesh stops and asks:
--keep-bothbrings the incoming copy in as a separate session,--replacesets the copy here aside, andhopsesh undobrings it back. - One row per session. Listings combine the copies across computers, and the copy left behind shows where the session went.
To send a session from the computer that has it instead, run hopsesh receive on on the one that receives and hopsesh push <id> laptop on the one that has it; both need hopsesh.
Or keep it where it is
With hopsesh set up on the desktop too (hopsesh hosts setup desktop), hopsesh terminals run desktop --resume <id> continues the session on the desktop in a terminal you use from the laptop. And hopsesh shows whether Remote Control reaches each running Claude Code session, so you can pick per session.
Uncommitted files stay on the computer they’re on; the plan says so. hopsesh has no server and no telemetry. It is alpha software, and an independent project, not affiliated with Anthropic or OpenAI.
Two computers, one session
Does Claude Code sync sessions between my computers?
No. Each session is a file in ~/.claude/projects on the computer where it ran, and nothing uploads it. Remote Control lets another device drive it, but it keeps running on the original computer.
Can I sync ~/.claude with Dropbox or Syncthing?
You can sync ~/.claude/projects if both computers have the same username and repository paths, and you never have one session open on both. Otherwise sessions are filed under the other computer’s paths, and conflict copies make claude --resume report “No conversation found”. Don’t sync your login.
How do I move a session back and forth without two versions?
Quit it on one computer before you copy it to the other. hopsesh does this for you: the copy you left refuses new prompts until you move the session back, hopsesh pull <session> with no computer name brings the newest copy back, and if both changed it stops and asks instead of merging.
Do both computers need hopsesh?
No. hopsesh pull needs only an SSH server on the other computer. hopsesh there is needed to push a session to it, or to continue a session there from here with hopsesh terminals run.
Use the method
Try it with hopsesh
Open-source CLI and desktop app: move a Claude Code or Codex session to another computer, into the other agent, or to the cloud, with undo built in.
See everything hopsesh does →brew install roeehrl/tap/hopsesh Without Homebrew: curl -fsSL https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.sh | sh, which checks the download against the release’s checksums and signature.irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex Same checks as the macOS and Linux script. The Windows app installs this command as well.More ways to install
- Installer for Arm64 Windows 10 or 11 on Arm
- Portable .zip x64 or Arm64, no install, on the release page
- Command line with Scoop from the roeehrl bucket, without the app
scoop bucket add roeehrl https://github.com/roeehrl/scoop-bucket; scoop install hopsesh - Command line only in PowerShell, without the app
irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex