Codonic

hopsesh guide · Claude Code

How to move a Claude Code session to another computer

The manual copy, the three things that break it, what teleport and Remote Control do instead, and how to do the whole move in one step.

A Claude Code session is a file on the computer where it ran. Moving one to another computer means moving that file, and fixing what the move breaks. Here is the manual way, the three things that make it fail, what claude --teleport and Remote Control do instead, and how hopsesh does the whole move for you.

Where a session lives

Claude Code writes each session as it goes to a JSON Lines file:

~/.claude/projects/<project>/<session-id>.jsonl

<project> is the working directory the session ran in, with every character that is not a letter or a digit replaced by -. A session started in /Users/alice/git/app lives in ~/.claude/projects/-Users-alice-git-app/. When that name would pass 200 characters, Claude Code cuts it to 200 and appends a hash of the full path. If CLAUDE_CONFIG_DIR is set, the whole tree is under that folder instead of ~/.claude.

Next to the .jsonl there can be a folder with the same session id, holding subagent transcripts and large tool results, and ~/.claude/file-history/<session-id>/ holds the file checkpoints. Each line of the transcript is one message, tool call or result, and many of them record absolute paths.

Nothing in there is shared between computers. claude --resume on your laptop cannot see a session that only exists on your desktop.

The manual way

  1. Get the code there 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.

  2. Find the session id. The newest file is usually the one you want: ls -t ~/.claude/projects/-Users-alice-git-app/. The file name without .jsonl is the id.

  3. Copy the transcript into the project folder for where the repository lives on the new computer, creating it if needed, plus the session’s side folder if it has one:

    mkdir -p ~/.claude/projects/-home-alice-src-app
    scp desktop:.claude/projects/-Users-alice-git-app/<id>.jsonl ~/.claude/projects/-home-alice-src-app/
  4. Resume it from the repository: cd ~/src/app && claude --resume <id>.

If both computers have the same username, the same home folder layout and the repository at the same path, that is all it takes. Most pairs of computers are not like that.

The three things that break it

Paths inside the transcript

Every tool call in the file names absolute paths: the working directory, every file read and edited, every command’s location. Copied from /Users/alice/git/app to /home/alice/src/app, the resumed session still believes it is in the old folder, and its first edits can go to paths that do not exist here.

A search-and-replace over the file sounds like the fix, and mostly is, with traps. On Windows the paths are JSON-escaped, so C:\Users\alice appears as C:\\Users\\alice and the separators differ from macOS and Linux. A short prefix such as /home/al also matches /home/alice2. Session and message ids must not change. And some entries are signed thinking blocks, which a blanket replace can alter.

The project folder name

The folder name comes from the real path of the working directory, so a symlinked or renamed checkout gets a different folder, and past 200 characters the hash cannot be worked out by hand. Since Claude Code 2.1.223, claude --resume <id> also searches every other project folder on the computer, so a wrongly named folder no longer hides a session from an id lookup. Earlier versions only look in the current directory’s folder and its git worktrees, and the session picker still lists sessions by folder.

Duplicate session ids

That wider search only resolves an id when exactly one other project folder holds it. Copy the same session twice, into two folders or on top of an earlier attempt, and Claude Code reports No conversation found with session ID rather than guess. Keep exactly one copy.

Two smaller things are worth knowing. Claude Code deletes transcripts older than 30 days by default (cleanupPeriodDays), so a copy made with rsync -a or scp -p, which keep the old modification time, can be cleaned up sooner than you expect. And if the session is still running on the old computer, the two copies drift apart from the moment you copy it, so stop it there first.

What teleport and Remote Control do instead

  • claude --teleport brings a session from Claude Code on the web down to your terminal. It does not move sessions between your own computers.
  • Remote Control lets you drive a session from another device while it keeps running where it is, with that computer’s files and tools. It needs the original computer on and reachable, and Claude Code signed in with a claude.ai subscription rather than an API key.
  • /export writes a readable copy of the conversation to paste into a fresh session. It is a summary to start over from, not a session you can resume.
  • Syncing all of ~/.claude copies everything all the time, and the paths inside each transcript are still the old computer’s.

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.

Doing it with hopsesh

hopsesh is a free, open-source command-line tool, terminal UI and macOS app that does the steps above. It finds your computers in Tailscale and ~/.ssh/config, connects only to the ones you allow over your own SSH, and needs nothing installed on the other computers beyond an SSH server.

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
hopsesh                       # browse sessions and move one here

Or in one line from a script: hopsesh pull desktop:"fix flaky tests" --clone. Before anything is written it shows a plan, and then:

  • finds the repository on this computer by its git remote, or clones it, and recreates the worktree if the session ran in one;
  • warns about unpushed commits and uncommitted files left on the other computer;
  • rewrites the paths in one pass, JSON escaping and Windows separators included, without touching ids or signed thinking blocks, and lists any path it could not map;
  • installs the copy under the exact folder name Claude Code expects, sets aside other copies of the same id, and gives the file a fresh modification time;
  • if the session is still live on the other computer, copies it and asks the old session to stop, or with --fork lets both continue;
  • prints the claude --resume command, whose first message tells Claude the session was moved and asks it to check that nothing is missing, and can start it with Remote Control on.

hopsesh undo <id> reverses a move. Sessions go directly between your computers: there is no hopsesh server, no telemetry, and it never calls the Anthropic API. It does not bring unpushed commits or uncommitted changes along yet, which is why it warns about them.

hopsesh is alpha software. It works end to end on macOS and Linux, and Windows support is built but less tested. It is an independent project, not affiliated with Anthropic.

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 on that computer. Copy the .jsonl into ~/.claude/projects there and run claude --resume with its id. If the username, home folder or repository location differs, the paths inside the transcript also need rewriting for the new computer.

Why does claude --resume say "No conversation found" after copying a session?

Either the transcript is not on this computer, or there is more than one copy of it. Claude Code resolves an id across project folders only when exactly one holds it, so a duplicate makes it report not-found. Versions before 2.1.223 also only look in the current directory’s project folder.

Does claude --teleport move a session between my computers?

No. Teleport brings a session from Claude Code on the web to 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?

No. The transcript is the conversation, not the code. Push from the old computer and pull on the new one first. hopsesh warns about unpushed commits and uncommitted files before it moves a session.

Use the method

Try it with hopsesh

Open-source CLI and Mac app that finds your Claude Code sessions on your other machines and moves one here over SSH, with its repo, worktree and paths.

See everything hopsesh does →
Install the CLI Terminal macOS and Linux · Command line and terminal UI curl -fsSL https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.sh | sh Checks the download against the release’s checksums.txt and its signature. hopsesh update installs later releases with the same checks.
Install the CLI Terminal Windows, in PowerShell · Command line and terminal UI irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex Same checks as the macOS and Linux script. Windows support is built but less tested than macOS and Linux.
hopsesh for Mac .dmg macOS app · macOS 13 or later · Apple silicon and Intel Download Signed and notarized by BlueGuru LLC. The same engine as the CLI, with a preflight screen for each move. Linux packages and all files GitHub Latest release · .deb, .rpm and .apk for amd64 and arm64, plus archives Open on GitHub Release notes, checksums and every build of the current version. Source on GitHub GitHub Apache-2.0 · Go 1.26 or later to build Open on GitHub From source: go install github.com/roeehrl/hopsesh/cmd/hopsesh@latest