hopsesh guide · Claude Code
How to move a Claude Code session to another computer
The manual copy and the exact errors that break it, what copying all of ~/.claude does, what teleport and Remote Control do instead, and the move in one step.
Where a Claude Code session lives
Claude Code saves each session as it goes, as a JSON Lines file:
~/.claude/projects/<project>/<session-id>.jsonl
<project> is the working directory’s path with every character that is not a letter or digit replaced by -. A session started in /Users/kim/git/app is in ~/.claude/projects/-Users-kim-git-app/. When that name would pass 200 characters, Claude Code cuts it to 200 and adds a hash of the full path. CLAUDE_CONFIG_DIR moves the whole tree somewhere other than ~/.claude.
Beside the transcript there can be a folder with the session’s id, holding subagent transcripts (subagents/) and large tool outputs (tool-results/). File checkpoints for rewind are in ~/.claude/file-history/<session-id>/, and the project’s auto memory is in ~/.claude/projects/<project>/memory/.
All of it is local. Claude Code’s own error reference says it plainly: transcripts are stored on the machine where the session ran, so that is where it resumes. claude --resume on your laptop can’t see a session that only exists on your desktop.
Resume a Claude Code session on a different machine: the manual way
-
Move the code first. The transcript is the conversation, not the work. Commit and push on the old computer, then pull or clone on the new one. Unpushed commits and uncommitted files stay behind otherwise.
-
Find the session id. The newest transcript is usually the one:
ls -t ~/.claude/projects/-Users-kim-git-app/. The file name without.jsonlis the id. -
Stop the session on the old computer. If it keeps running there, the two copies drift apart from the moment you copy.
-
Copy the transcript into the project folder named after where the repository lives on the new computer, plus the session’s side folder if it has one:
mkdir -p ~/.claude/projects/-Users-kim-git-app scp studio:.claude/projects/-Users-kim-git-app/<id>.jsonl ~/.claude/projects/-Users-kim-git-app/ -
Resume it from the repository:
cd ~/git/app && claude --resume <id>.
If both computers have the same username, the same home folder and the repository at the same path, that is all. When they don’t, read on.
Why it fails: the error messages and what they mean
“No conversation found with session ID”
claude --resume <id> prints No conversation found with session ID: <session-id> when no transcript on this computer matches. Since Claude Code 2.1.223 it searches the current project first, then every other project folder here, so a transcript in the wrong folder is still found by its id. Earlier versions only look in the current directory’s project folder and its git worktrees.
The wider search resolves an id only when exactly one other project holds it. Copy the session twice (into two folders, or over an earlier attempt) and Claude Code reports not-found rather than pick one. Keep exactly one copy.
“No conversation found to continue”
claude --continue reopens the most recent session in the current directory. If you copied the transcript into a folder named after the old computer’s path, the current directory’s project folder is empty, and Claude Code prints No conversation found to continue.
claude --resume doesn’t list the session
The picker shows sessions from the current worktree by default. Press Ctrl+W to widen it to every worktree of the repository, or Ctrl+A to every project on this computer. A session that only shows up under Ctrl+A is in a folder named for another path.
The session resumes, but in the wrong place
Every tool call in the transcript names absolute paths: the working directory, each file read and edited. Copied from /Users/kim/git/app to /home/kim/src/app, the session still believes it is in the old folder, and its first edits can aim at paths that don’t exist here. A search-and-replace over the file mostly works, with traps: on Windows the paths are JSON-escaped (C:\\Users\\kim), a short prefix such as /home/ki also matches /home/kim2, and ids and signed thinking blocks must not change.
The copy disappears a month later
Claude Code deletes transcripts after 30 days by default (cleanupPeriodDays). scp -p and rsync -a keep the old modification time, so the copy can be swept sooner than you expect.
Can I just copy ~/.claude to a new Mac?
You can, and for a new Mac that takes over from the old one at the same path, it is a reasonable start. Three cautions:
- Credentials. On macOS Claude Code keeps your login in the Keychain; on Linux and Windows it is
~/.claude/.credentials.json. Don’t carry a login between computers: sign in again with/login. - Paths. If your username or repository location changed, every transcript is filed under a project folder named after the old path, and the paths inside it are the old ones.
- Ongoing sync. Syncing all of
~/.claudebetween two computers you use at the same time copies everything all the time, including sessions that are open on both.
For one session, when you want it, moving the one file is cleaner.
What teleport, Remote Control and /export do instead
claude --teleportpulls a session from Claude Code on the web into your terminal, with its branch. It doesn’t move sessions between your own computers; that direction is covered in how to hand a Claude Code session to the cloud and bring it back.- Remote Control lets you drive a session from your phone or another browser while it keeps running on its own computer, with that computer’s files. The computer has to stay on, and it needs a Pro, Max, Team or Enterprise plan; API keys are not supported. hopsesh vs Remote Control compares the two.
/exportwrites the conversation as plain text to paste into a fresh session. It’s a summary to start over from, not a session you can resume. See export and import a Claude Code conversation.
If you want the session itself to continue on the computer in front of you, with its files, the transcript has to move and be fixed up.
Move a Claude Code session over SSH or Tailscale with hopsesh
hopsesh is a free, open-source command-line tool, terminal UI and app for macOS and Windows that does the steps above, for Claude Code and Codex. It finds your computers in Tailscale and ~/.ssh/config, connects only to the ones you allow, with your own ssh and keys, and needs nothing on the other computer beyond an SSH server.
hopsesh hosts # computers found in Tailscale and ~/.ssh/config
hopsesh hosts allow studio # let hopsesh connect to one
hopsesh trust studio # confirm its SSH host key
hopsesh # browse sessions and move one here
From a script: hopsesh plan studio:"fix flaky tests" shows the plan and changes nothing, and hopsesh pull studio:"fix flaky tests" --clone does it. In the app, pick the session and choose Bring to this Mac…. Before anything is written it shows a plan, and then it:
- finds the repository here by its git remote, or clones it, and recreates the worktree if the session ran in one;
- brings the code to the commit the session last saw, fetching it straight from the other computer if it was never pushed, and fast-forwards only a clean checkout: it never merges, rebases or stashes;
- rewrites the paths in one pass, JSON escaping and Windows separators included, without touching ids or signed thinking blocks, and lists any path it couldn’t map;
- installs the copy under the exact folder name Claude Code expects, sets other copies of the same id aside and gives the file a fresh modification time;
- leaves the copy on the other computer with its title and, by default, makes it refuse new prompts until you move the session back, so the two never drift apart;
- prints the
claude --resumecommand to continue.
To bring the session back later, run hopsesh pull <id> with no computer name: it takes the newest copy, and if both copies changed it stops and asks rather than merging. hopsesh undo reverses the newest move on every computer it touched. Uncommitted files stay on the other computer, and the plan says so.
Sessions go directly between your computers: there is no hopsesh server and no telemetry, and it never calls the Anthropic API. The same commands move Codex sessions (resume a Codex session on another machine), move a session to another folder on the same computer (Claude Code history after moving a project folder), and continue one in the other agent (continue a Claude Code session in Codex).
hopsesh is alpha software. It works end to end on macOS and Linux, and the Windows app and installer are tested in CI on Windows Server 2025. It is an independent project, not affiliated with Anthropic or OpenAI.
Moving Claude Code sessions
Where does Claude Code store sessions?
In ~/.claude/projects/<project>/<session-id>.jsonl, where <project> is the working directory with every character that is not a letter or digit replaced by a dash. Names over 200 characters are cut and given a hash. CLAUDE_CONFIG_DIR moves the whole tree.
Can I resume a Claude Code session on a different computer?
Yes, once its transcript is there. Copy the .jsonl into ~/.claude/projects on the other computer and run claude --resume with its id from the repository. If the username, home folder or repository location differs, the paths inside it need rewriting too, which hopsesh does for you.
Why does claude --resume say “No conversation found with session ID”?
No transcript on this computer matches the id, or more than one does. Claude Code looks in every project folder for an id, but resolves it only when exactly one holds it, so a second copy makes it report not-found. Versions before 2.1.223 only look in the current directory’s project folder.
Why does claude --continue say “No conversation found to continue”?
claude --continue reopens the newest session of the current directory only. A transcript copied into a folder named after the old computer’s path isn’t there. Resume it by id with claude --resume <id>, or press Ctrl+A in the picker to see every project on this computer.
Can I just copy ~/.claude to a new Mac?
For a new Mac that replaces the old one, with the same username and the repositories at the same paths, it mostly works. Sign in again rather than carrying a login across, and expect sessions to be filed under the old paths if anything changed. For one session, move just that file.
Does claude --teleport move a session between my computers?
No. Teleport brings a session from Claude Code on the web into your terminal. Remote Control lets you drive a session that keeps running on its own computer. Neither moves a session from one of your computers to another.
Do my unpushed commits move with the session?
Not with a manual copy: push from the old computer and pull on the new one first. hopsesh fetches the commit the session last saw, straight from the other computer if it was never pushed, and fast-forwards a clean checkout. Uncommitted files stay where they are, and the plan says so.
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
- With Homebrew the same app, from the roeehrl tap
brew install --cask roeehrl/tap/hopsesh-app
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