Session health
Continue a Claude Code session on another computer
Copy the transcript, push the code, fix the paths. What Claude Code, Codex and OpenCode move to another computer, Mac to Linux, and how to carry it safely.
Kifah Abbad Published Last verified 12 min read
The short answer. A Claude Code session can continue on another computer, but what you move is one transcript file, not your work. Copy the file into the matching folder, push your code, and resume it there; Codex works the same way in outline, and OpenCode has a documented export and import. Your login does not come along, and a session from a Mac continues on Linux only if you deal with the folder paths written inside it. I ran none of this for this post: it is what the vendors document and what others report, and every claim says which.

Why this matters. If you swap laptops, work from a second desk or hand a half-finished task to a colleague, the agent’s picture of the work sits in a file on the first computer. Move the wrong thing and you lose the context. Carry the right file carelessly and you leave a plain-text record of your prompts, and of any secret the agent read, in a place you do not control.
What you get. The route each tool documents, what a resumed session restores and what it leaves behind, the traps when you go from a Mac to Linux, and a checklist you can finish in ten minutes.
Who needs this
Possible scenario. On Friday you leave a refactor half done on your work Mac. On Saturday you want to carry on at a Linux desktop at home. The code is on GitHub, but the conversation, the decisions you agreed and the agent’s grasp of the codebase sit in a file on the Mac. You open Claude Code at home and the session list is empty.
| Role | What changes for them |
|---|---|
| Junior software engineer | Knows the history is one file, and that the code and the login do not travel with it. |
| DevOps or platform engineer | Picks one route (copy, cloud or export) and a safe way to carry plain-text transcripts. |
| CTO or engineering lead | Sees which routes need a paid cloud plan and which need only a file copy. |
Table: who gains what, my reasoning, not measured. I did not measure time saved for any role.
The problem, in the vendors’ words
Claude Code saves a session locally as you work. Its own page says --resume “reopens a conversation from this machine’s local history and doesn’t list cloud sessions” (documented, cloud sessions page, read 20 November 2026). A feature request filed in April 2026 puts it more bluntly: “Sessions can’t be continued on a different machine today” (issue 51337, a report, closed as stale). It adds that the folder name under ~/.claude/projects/ comes from the working directory, so even syncing ~/.claude does not reliably carry a session unless the repository sits at the same path on both computers (reported).
The routes that exist
| Tool | The documented way | What it needs |
|---|---|---|
| Claude Code | Copy the .jsonl file, then claude --resume <path> | The code on the other computer |
| Claude Code, cloud | claude --teleport pulls a cloud session into the terminal | A paid plan, and a session that started in the cloud |
| Codex | codex resume <id>; copying a rollout file is reported, not documented | The code on the other computer |
| OpenCode | opencode session export, then opencode session import | OpenCode on both |
Table: what each vendor’s documentation offers for another computer, read 20 November 2026 (Claude Code docs current that day, Codex CLI 0.170.0 and OpenCode 2.3.2 installed here). Documented, except where a row says reported.
Claude Code: copy the file
Claude Code stores each session as a JSON Lines file at ~/.claude/projects/<project>/<session-id>.jsonl. <project> is the working directory with every character that is not a letter or digit replaced by - (documented, sessions page). So /Users/you/code/app on a Mac becomes -Users-you-code-app, and the same project at /home/you/code/app on Linux needs a folder called -home-you-code-app (the rule applied by hand: assumed).
The vendor documents resuming from a path: claude --resume accepts the absolute path of a .jsonl file. Two third-party guides describe the copy over SSH, in this shape (reported; I did not run it):
scp old-mac:.claude/projects/-Users-you-code-app/<id>.jsonl \
~/.claude/projects/-home-you-code-app/
cd ~/code/app && claude --resume <id>
On a current version --resume <id> finds a transcript in another project folder when exactly one folder holds it (documented). On 2.1.173 it did not: I tested that on one computer, and the resume page has the table. A third-party guide puts the change at 2.1.223 (reported).
Two copies, one session. If the old computer keeps writing to the session, the copies drift apart from the moment you copy. The vendor warns that resuming one session in two terminals writes to one transcript and messages can go missing, and says to add --fork-session (documented). Stop the session first, or fork.
What a resumed session restores (documented): the conversation, including the last compaction’s summary; the model it was using; the agent; the permission mode, when you resume from a terminal; an active goal. What it does not (documented): launch flags such as --mcp-config, --plugin-dir, --add-dir, --settings and --fallback-model, which you pass again; background shell tasks. Your project instructions and settings are files, not part of the transcript, so I expect the new computer to read its own copies: commit the project ones to git and carry the personal ones in your dotfiles (assumed; the restore list does not mention them). Rewind snapshots are kept in a separate file-history folder; the vendor says checkpoints are saved “with the conversation”, and I do not know whether a copied transcript brings them (not tested).
Claude Code in the cloud
claude --cloud "<task>" starts a new cloud session from your current repository. It clones your GitHub remote at your current branch, not your local checkout, so push first. claude --teleport pulls a cloud session into your terminal. From the command line the handoff is one way: you cannot push an existing terminal session to the cloud, though the Desktop app can send a local one from its Open in menu (all documented). Cloud sessions are available on Pro, Max, Ultra and Team plans, and to Enterprise users with certain seats (documented).
Remote Control is not a transfer. It lets a phone or a browser steer a session that keeps running on your own machine, which has to stay on (documented).
Codex: a file, an index and a directory prompt
Codex keeps its state under CODEX_HOME, which is ~/.codex unless you set it (documented, config page). Each session is one rollout file under sessions/YYYY/MM/DD/: I read that layout on my own install, and the session formats page has it. codex resume scopes its “most recent” choice to the current directory unless you pass --all, and when your directory differs from the one saved in the session it asks which to use. tui.resume_cwd = "current" or "session" remembers your answer (documented, CLI reference). The installed help text for codex resume --all says it disables the folder filter and shows the folder column (read here, version 0.170.0).
Two third-party guides, from December 2025 and October 2026, say a copied rollout file shows up in codex resume on the new computer (reported). One of them adds three cautions (reported): a thread name you gave with /rename sits in a separate index and may not come along; the reasoning is stored encrypted for the account that made it, so a different account cannot use that part; and the SQLite files in ~/.codex describe that computer’s own sessions, so do not copy them.
The conflicting report is an open issue from August 2026 (Codex CLI 0.149.1, Windows 11). Backed-up rollout files were restored, codex doctor reported them as missing from the state database, and codex migrate-rollouts --apply failed with “is missing its SQLite metadata” (issue 40426). The two reports may differ because of version or setup. I do not know which, and I did not test either.
--remote is a different idea: it connects codex resume to an app server on another host (documented). I read that as working on a session where it lives and not moving it, which I did not confirm (assumed).
OpenCode: export, then import
OpenCode keeps sessions in one SQLite database, not one file per session, so there is nothing small to copy. The documented route is opencode session export <id> > session.json on the first computer, then opencode session import session.json --directory <folder> on the second (CLI commands). Import also accepts a URL, and there is a --sanitize flag for the export (documented).
A project that moves OpenCode sessions between sandboxes reports what the import does (its design note, a report, OpenCode version not stated): it keeps the session id, and it moves the session to the importing folder, so directory and projectID become the new repository’s. It rejected copying the whole database, because that database holds every session of every project and copying it overwrites the target’s.
On one computer I saw the opposite without an import: resuming by id from another folder stayed tied to the original folder (tested on 2.3.2; see the resume page).
Mac to Linux, and Windows
Assumed, not tested. No vendor page I read ties a session file to an operating system, so I expect a Mac session to continue on Linux (assumed). What breaks is the paths.
- The folder name and the paths inside. The project folder name derives from the old path. Every tool call in a Claude Code transcript also names absolute paths, so a session copied from
/Users/kim/appto/home/kim/app“still believes it is in the old folder” and its first edits can aim at folders that do not exist (reported). Codex asks which directory to use (documented). OpenCode’s import sets the new folder (reported). - The login. Claude Code keeps it in the macOS Keychain, and in
~/.claude/.credentials.jsonon Linux and Windows (documented). Sign in on each computer; do not copy it. - Windows.
~/.claudeis%USERPROFILE%\.claude(documented). A Windows path is stored in JSON with doubled backslashes, which breaks a plain search or replace of the old path (tested for a search in the sanitize post). The session formats page has the folders for all three tools.
Carry it safely
A transcript is plain text, not encrypted. The vendor says that if a tool reads a .env file or a command prints a credential, the value is written into the transcript (documented, .claude directory page). So:
- Copy over SSH, not through chat, email or a shared folder.
- If a cloud folder or a USB stick is the only route, encrypt the file first; the restore post shows
gpg --symmetricon a database copy (tested there). - OpenCode’s
--sanitizehides prompts and outputs, but left error messages and file names readable in my test (post). Treat the file as sensitive anyway. - Delete the copy when you are done, and keep it out of git.
- A copy keeps its old modification time if you use
scp -porrsync -a, and Claude Code’s 30-day cleanup may count that time (assumed; the 30-day page has the details). Touch the file after copying.
What would be better, and is not available today
A session should be found by the repository it belongs to, not by the path it started in. One command would move the transcript, the notes and the branch to another computer, encrypted, and ask nothing about folders. The request in issue 51337 describes the same thing: a project identifier taken from the git remote, in place of the path (reported). It is a request, closed as stale, not a feature.
What to do on Monday
- Commit and push the code on the old computer. A transcript is the conversation, not the work.
- Stop the session, or plan to use
--fork-session. - Find the session id: the file name under
~/.claude/projects/<project>/(Claude Code) or the rollout file name (Codex). - Copy it over SSH into the folder that matches the new path (Claude Code), the same date folder (Codex), or export and import (OpenCode).
- Sign in on the new computer, pass your launch flags again, and resume from the repository folder.
- Delete the copy, and check where it landed.
If you used our app
AgentsOfMine is our product, and this section is about it. If you had synced a session with the collector, the app holds a readable copy that you can open on any device, search, and attach lessons (your notes) to. That is a way to read a session and keep notes on another computer, not a way to continue it: the app is read-only and cannot put a session back into Claude Code, Codex or OpenCode. Its export (Settings → Export my data) is a JSON file in our own format per project, and I did not try to feed it to any agent, so do not expect to resume from it.
The workable use is a handover note. Read the session in the app, write the final decisions and your lessons into a first message by hand, and start a fresh session on the new computer. It is a poor substitute for the real history, because the collector uploads at most 150 messages per session (not for Codex) and shortens tool output to 500 characters, and its secret removal is best effort (what the collector reads and uploads). It is not a backup. To start: npm install -g agentsofmine, then aom pair.
What I did not test
- Any command in this post. I ran none of them for it. The commands are the vendors’ or third-party guides’, labelled as such. My own tests are the ones linked, all on one computer.
- A transfer between two computers, in either direction, for any of the three tools.
- The versions. Claude Code’s documentation was current on 20 November 2026; the third-party guides and issues name their own dates. I did not check which Codex or OpenCode version changed any behaviour they describe.
- Codex’s desktop app hand-off to a remote host. A guide mentions it, and I did not find the vendor’s page.
- Third-party tools that move sessions between computers. They exist, and I did not try any.
- Windows. Nothing here was run on Windows.