Migrate Claude Code to a new computer, settings and all

Install Claude Code on the new computer, copy ~/.claude across without the credentials file, and sign in again. Past sessions show up when each project sits at the same absolute path as before, because Claude Code files transcripts under a folder named after that path.

Contents

To migrate Claude Code to another computer, install it there, copy your ~/.claude folder across without the credentials file, and sign in again. Your history comes back when each project sits at the same absolute path as before, because Claude Code files every transcript under a folder named after that path. MCP servers you added yourself have to be added and signed in to again.

The Claude Code facts below come from Anthropic's docs, read on 24 October 2026: the .claude directory reference, sessions, settings, authentication and MCP. The tar commands we ran ourselves, with macOS's tar and with GNU tar.

What Claude Code keeps, and what to copy#

Two places hold almost everything: the folder ~/.claude and the file ~/.claude.json next to it in your home folder. On Windows the folder is %USERPROFILE%\.claude. If you set CLAUDE_CONFIG_DIR, everything in ~/.claude lives under that directory instead.

Path What it holds Copy it?
~/.claude/settings.json Permissions, hooks, env vars, default model, enabled plugins and their marketplaces Yes
~/.claude/CLAUDE.md, rules/ Instructions loaded in every project Yes
~/.claude/skills/, commands/, agents/, output-styles/, workflows/ Your skills, slash commands, subagents, output styles and workflows Yes, except skills/synced/
~/.claude/keybindings.json, themes/ Shortcuts and colour themes Yes
~/.claude/projects/ Transcripts (<session-id>.jsonl) and each project's auto memory (memory/) Yes, if you want your history
~/.claude/history.jsonl The prompts you typed, for up-arrow and Ctrl+R If you like
~/.claude/plugins/ Cloned marketplaces, installed plugin copies and their caches No, they come back from settings.json
~/.claude/.credentials.json Your login on Linux and Windows (a Mac uses the Keychain) No
~/.claude.json Account details, per-project state such as trust, your MCP servers No, take the MCP servers out by hand

A project's own .claude/settings.json, .mcp.json and CLAUDE.md live in the repository, so they arrive with git clone. .claude/settings.local.json and CLAUDE.local.md are usually gitignored, and stay behind unless you copy them yourself.

We leave ~/.claude.json out because Claude Code writes it for itself and it is full of the old machine: the account it was signed in with, and trust decisions and project-scoped MCP servers filed under each project's absolute path.

Why your history depends on the project path#

Claude Code saves each session at ~/.claude/projects/<project>/<session-id>.jsonl, where <project> is the working directory's path with every character that isn't a letter or digit replaced by -. A repository at /Users/anna/code/shop gets the folder -Users-anna-code-shop.

Clone the same repository to /home/anna/code/shop on a Linux box and Claude Code looks in -home-anna-code-shop instead. It finds nothing there, so claude --continue and the default claude --resume list come up empty, although every transcript was copied. Auto memory goes the same way: it sits in projects/<project>/memory/, and the memory docs call it "machine-local".

The easy fix is to make the paths match: the same user name and the same folder layout on both computers. When they can't match, the sessions are still there and the docs give you three ways to reach them:

  1. Run claude --resume in the project and press Ctrl+A, which lists sessions from every project on this machine. Pick one; when its old folder doesn't exist here, Claude Code resumes it in your current directory.
  2. Run claude --resume <session-id> from any folder. Claude Code searches the current project first, then every other project on the machine.
  3. Run claude --resume /full/path/to/<session-id>.jsonl to open one transcript file directly.

Inside a resumed session, /cd <path> moves it to another directory, and afterwards --resume from that directory finds it. The conversation itself still mentions the old paths in its earlier tool calls, so tell Claude where the project lives now. And keep one copy of each transcript: Anthropic notes that a hand-copied duplicate makes the search by session ID report not-found rather than pick one. Our guide to resuming a Claude Code session covers the other reasons a resume fails. If the history is all you are moving, the history-only steps are shorter than this page.

How to migrate Claude Code to another computer, step by step#

On the old computer:

  1. List your MCP servers with claude mcp list. Servers you added for all projects are the top-level mcpServers in ~/.claude.json, so jq '.mcpServers' ~/.claude.json prints them. Servers added for one project sit under that project's path: jq '.projects["/Users/anna/code/shop"].mcpServers' ~/.claude.json.
  2. Pack ~/.claude without the login, the plugin copies, the synced skills and the running-session files:
bash
cd ~
tar -czf claude-home.tgz \
  --exclude='.claude/.credentials.json' \
  --exclude='.claude/plugins' \
  --exclude='.claude/skills/synced' \
  --exclude='.claude/sessions' \
  .claude

Treat that archive like a secret. Transcripts are plain text, and the docs warn that anything a tool read, a .env file included, can be in them. Move it over SSH or AirDrop rather than a public share, and delete it once you're done.

On the new computer:

  1. Install Claude Code, but don't start it yet.
  2. Unpack: cd ~ && tar -xzf claude-home.tgz.
  3. If you want sessions older than a month, raise cleanupPeriodDays in ~/.claude/settings.json first, for example "cleanupPeriodDays": 365. Claude Code deletes transcripts older than that setting (30 days by default). The docs don't say which date the cleanup reads, and tar keeps each file's original date, so set it before the first start. (Why Claude Code deletes chats after 30 days has the rest of that setting.)
  4. Run claude and sign in in the browser. On a Mac the new login goes into the Keychain.
  5. Clone your repositories into the same paths as before, and copy over any settings.local.json and CLAUDE.local.md you had.
  6. Add your MCP servers back with claude mcp add-json <name> '<json>', one entry from step 1 of the old computer at a time. Add --scope user for the servers that were in every project; run the command without it, inside the project, for a server that belonged to one project. For a server that signs in with OAuth, run /mcp in a session or claude mcp login <name> in your shell.
  7. Most plugins come back by themselves. Your settings.json lists the marketplaces you added and the plugins you turned on for yourself, and after start Claude Code clones the missing marketplaces in the background and downloads those plugins. A marketplace you added from a local folder needs that folder on the new computer too. If a plugin is missing, the Errors tab in /plugin says why; one you installed for a single project shows as enabled in project settings but not installed here, and you install it again.
  8. Check settings.json for paths that name the old home folder (/Users/anna/...). A hook command that runs through the shell can use $HOME instead. A hook with an args list runs without a shell, and values in the env block aren't expanded either, so write those paths out in full.
  9. Open a project and run claude --resume.

What you don't copy: your login#

On a Mac, Claude Code keeps your login in the macOS Keychain, so a copied ~/.claude usually doesn't carry it anyway. (When the Keychain refuses the write, over SSH for example, Claude Code falls back to the same file Linux uses.) On Linux and Windows it is ~/.claude/.credentials.json, a file Claude Code manages through /login and /logout. Sign in fresh on the new machine instead. If you run several accounts with separate config folders (CLAUDE_CONFIG_DIR), each folder has its own login and its own projects/, so repeat the steps for each folder.

Keeping settings, skills and plugins in sync between devices#

Some things already follow your claude.ai sign-in. Since Claude Code v2.1.273, skills turned on for your claude.ai account download into ~/.claude/skills/synced/, and plugins turned on for the account load as <name>@synced. Connectors you added on claude.ai load in Claude Code too, as long as the active login is a claude.ai subscription and not an API key or a claude setup-token token. That is why the steps above leave skills/synced/ out: the new machine downloads it again.

Your own settings.json, CLAUDE.md, skills, agents and commands don't sync. The usual answer is a dotfiles repository: keep them in git and link them into ~/.claude on each computer. Link to a checkout you can write to, because Anthropic's settings docs say a change you make from inside Claude Code, such as a default model picked with /model, is lost when settings.json points at a read-only copy. Keep projects/ and history.jsonl out of that repository, for the same plain-text reason as the archive above.

We also wouldn't point a file-sync tool at a live projects/ folder on two computers that both run Claude Code. Both write to it while sessions run, and a transcript that ends up duplicated breaks resuming it by ID.

If what you want is to keep one conversation going from another device rather than move it, Remote Control does that: claude.ai/code or the Claude app becomes a window onto a session still running on your computer, which has to stay on. Cloud sessions work the other way round: claude --teleport pulls one into your terminal, but the CLI can't push a terminal session up to the cloud.

How Shuriken handles a new computer#

Shuriken is a harness that runs Claude Code, Codex and other coding agents on your own computers and servers, and in it a new computer starts from your account rather than from a copied folder.

When you link the new computer and sign in, your password opens your vault there: the subscription sign-ins and API keys you added as sources, and your MCP sign-ins. They pass through our cloud as ciphertext only. With Global MCPs, every chat on a computer is handed that computer's MCP list when it starts, in Claude Code, Codex, Gemini CLI and the other agents that take MCP servers, and an MCP sign-in from your vault works there without signing in again. The list itself is kept per computer: a server you add goes onto each of your computers that's online at the time, so check the list on the new one and add any server it's missing. Agent settings, queue settings and sleeping chats are set once for every computer and server; your account keeps them, so a computer you link later is brought up to date when it connects. The Free plan allows two linked devices, so the old computer and the new one fit side by side while you move.

A chat runs on one computer at a time, and your other devices open it from there. While the old computer stays linked and online, its chats are still in your list on the new one. To move one across, choose Run on… in the chat's menu: it goes with its history and uncommitted work and stays the same chat. A whole project can move too, with Move to another device: Shuriken copies the project and its chats to the new computer, checks the copy, then removes it from the old one.

To bring your Claude Code history itself across, copy ~/.claude and clone the repositories as above, then choose Add project › Import from… on the new computer and pick Claude Code. Shuriken lists the project folders Claude Code knows that exist on that computer and brings each one's past chats in. Import only reads Claude Code's files, and an imported chat you continue is forked, so the original transcript stays as it was. And for one long job you don't need to move anything: run the chat on another of your computers, which gets the repository and carries on there.

To set up the new computer that way, download Shuriken on it and link it to your account.

Sources

  1. Claude Code docs: Explore the .claude directory (accessed 24 October 2026)
  2. Claude Code docs: Manage sessions (accessed 24 October 2026)
  3. Claude Code docs: Settings files and precedence (accessed 24 October 2026)
  4. Claude Code docs: Authentication (accessed 24 October 2026)
  5. Claude Code docs: Connect Claude Code to tools via MCP (accessed 24 October 2026)
  6. Claude Code docs: Plugin loading reference (accessed 24 October 2026)
  7. Claude Code docs: Extend Claude with skills (accessed 24 October 2026)
  8. Claude Code docs: How Claude remembers your project (accessed 24 October 2026)
  9. Claude Code docs: Configure permissions (/cd) (accessed 24 October 2026)
  10. Claude Code docs: Remote Control (accessed 24 October 2026)
  11. Claude Code docs: Use Claude Code in the cloud (accessed 24 October 2026)

Frequently asked questions

Where does Claude Code store conversations?

On your own computer, as one JSONL file per session at ~/.claude/projects/<project>/<session-id>.jsonl. The <project> folder is the working directory's path with every character that isn't a letter or digit turned into a dash.

Can I transfer a Claude Code session to another computer?

Yes. Copy its .jsonl file to the other computer and run claude --resume with the file's full path. Keep the project at the same path, with the file in the same projects folder, and it shows up in the normal picker too.

Does Claude Code sync settings between devices?

Not your ~/.claude folder. What follows a claude.ai sign-in is the skills and plugins turned on for your account (Claude Code v2.1.273 or later) and claude.ai connectors. Settings, CLAUDE.md, MCP servers you add in Claude Code and transcripts stay on each machine.

Do I have to log in to Claude Code again on a new computer?

Yes. On a Mac the login normally sits in the Keychain, and on Linux and Windows in ~/.claude/.credentials.json, which you leave out of the copy. Run claude and sign in in the browser.

Why does claude --resume show nothing after I copied ~/.claude?

Usually the project is at a different path on the new computer, so Claude Code looks in a different projects folder. Press Ctrl+A in the picker to list every project's sessions, or resume one by its session ID. If the sessions are gone from Ctrl+A too, the first start may have deleted copies older than cleanupPeriodDays (30 days by default).

Free tools