# Move Claude Code chat history to a new computer

> Copy ~/.claude/projects to the new computer and keep each project at its old path, or rename its folder to match. Then log in, and /resume finds them.

Source: https://shuriken.sh/guides/move-claude-code-history-to-new-computer

Copy ~/.claude/projects to the new computer and open each project from the same absolute path, or rename its folder to the new path's name. Bring CLAUDE.md, settings.json, agents, commands and skills too, then log in again: your login stays behind.

By Shuriken Updated 27 October 2026 6 min read

**Contents**

You transfer Claude Code history to a new computer by copying one folder, ~/.claude/projects, and opening each project from the same absolute path it had before. Claude Code files every session under a folder named after that path, and claude --resume lists it only from there. If the path changed, rename the folder to match. The login doesn't travel, so log in again.

Paths and commands on this page are from Anthropic's docs on [sessions](https://code.claude.com/docs/en/sessions), [the .claude directory](https://code.claude.com/docs/en/claude-directory) and [authentication](https://code.claude.com/docs/en/authentication), read on 24 October 2026.

## Where Claude Code keeps your chat history #

A session is a JSONL file on the computer that ran it: ~/.claude/projects/<project>/<session-id>.jsonl. It lives nowhere else, which is why Claude Code on a new Mac opens with an empty /resume list. The <project> part is the working folder's absolute path with every character that isn't a letter or a digit replaced by -.

| Working folder | Its folder under ~/.claude/projects/ |
| --- | --- |
| /Users/anna/code/shop (macOS) | -Users-anna-code-shop |
| /home/anna/code/shop (Linux) | -home-anna-code-shop |
| C:\Users\anna\code\shop (Windows) | C--Users-anna-code-shop |

A name longer than 200 characters is cut at 200 and gets a hash of the full path on the end. Anthropic says Claude Code stores sessions per project directory, and the picker starts with the sessions of the directory you're in, so the same transcripts under another folder name don't show up there.

Each session's subagent transcripts sit beside it in that folder. So does the project's auto memory in memory/, Claude's own notes about the project, named after the git repository's root so every subfolder of a repo shares one. Copying projects brings those notes along; [what Claude Code remembers between sessions](https://shuriken.sh/guides/claude-code-memory-between-sessions) explains how a new session loads them.

## What to copy, and what to leave #

| Path | What it is | Copy it? |
| --- | --- | --- |
| ~/.claude/projects/ | Every transcript, subagent transcripts, auto memory | Yes: this is the history |
| ~/.claude/CLAUDE.md , ~/.claude/rules/ | Your instructions for every project | Yes |
| ~/.claude/settings.json | Permissions, hooks, env vars, model defaults, cleanupPeriodDays | Yes, before the first launch |
| ~/.claude/agents/ , commands/ , skills/ , output-styles/ , workflows/ | Your subagents, slash commands, skills, output styles and workflow scripts | Yes, except skills/synced/ |
| ~/.claude/agent-memory/ | Your subagents' own memory | Yes |
| ~/.claude/keybindings.json , themes/ | Your shortcuts and colour themes | If you made any |
| ~/.claude/history.jsonl | Prompts you typed, for up-arrow and Ctrl+R recall | Optional |
| ~/.claude/file-history/ | Snapshots behind checkpoint rewind | Optional |
| ~/.claude.json (in your home folder) | Account details, app state, project trust, your personal MCP servers | No: add the MCP servers again with claude mcp add ( --scope user for the ones every project used) |
| Your login | The macOS Keychain; .credentials.json in ~/.claude on Linux and Windows | No: log in on the new computer |

Plugins, and the skills and connectors that already follow your claude.ai sign-in, are in [moving Claude Code to a new computer](https://shuriken.sh/guides/migrate-claude-code-to-new-computer); this page stays with the history. If you ran Claude Code with CLAUDE_CONFIG_DIR, every ~/.claude row lives in that folder instead.

Files inside a repository (its CLAUDE.md, .claude/settings.json, .mcp.json) come with the repository when they're committed. CLAUDE.local.md and .claude/settings.local.json usually aren't, because they belong in .gitignore. Copy those two by hand.

## Steps: the project keeps the same path #

This is the easy case: same username, code in the same folders.

- Quit every Claude Code session on the old computer, background ones in claude agents too, so nothing writes a transcript during the copy.
- Pack what you're taking:

bash
cd ~/.claude
tar czf ~/claude-history.tgz --exclude skills/synced projects CLAUDE.md settings.json rules agents commands skills output-styles workflows agent-memory history.jsonl file-history

tar complains about any of these you don't have and packs the rest. skills/synced/ stays out because Claude Code downloads your claude.ai account's skills into it again once you log in.

- Move claude-history.tgz to the new computer over AirDrop, scp or a USB stick you keep. Treat it like a password file: transcripts are plain text, and Anthropic's docs say anything a tool read, a .env file included, can be in them.
- Put each repository at its old absolute path, for example git clone into /Users/anna/code/shop.
- Unpack it before you run claude there for the first time:

bash
mkdir -p ~/.claude
tar xzf ~/claude-history.tgz -C ~/.claude

This replaces a settings.json or CLAUDE.md already on the new computer, so merge by hand if you've started one.

- Install Claude Code, cd into a project, run claude and log in.
- claude --continue reopens the latest session in that folder, and claude --resume lists the rest. Ctrl+A in the picker shows every project on the computer.
- Keep claude-history.tgz until your sessions open on the new computer.

On Windows the folder is %USERPROFILE%\.claude; copy the same items with Explorer or robocopy.

Step 5 comes before the first launch because Claude Code deletes transcripts older than cleanupPeriodDays, 30 days unless you set it. If you raised it on the old computer and settings.json arrives late, copies older than 30 days can go in the first clean-up. The setting itself is in [why Claude Code deletes chats after 30 days](https://shuriken.sh/guides/claude-code-history-deleted-after-30-days).

## Steps: the project path changed #

A new username, or code that moved from ~/code to ~/dev, gives the project a new folder name. You can rename the folder, or move sessions one at a time the way Anthropic documents.

### Rename the folder: every session at once #

bash
mv ~/.claude/projects/-Users-anna-code-shop ~/.claude/projects/-Users-anna-dev-shop

mv, not cp: with a hand-copied duplicate, Anthropic's docs say, claude --resume <session-id> reports the session as not found instead of picking one of the two. Each transcript still has the old path written inside it. We leave that alone, because the format is internal to Claude Code and changes between versions.

Anthropic doesn't document this rename. We rely on two things the docs do say: sessions are stored per project directory, and the picker starts with the directory you're in. If the picker still comes up empty after the rename, press Ctrl+A in it, or use /cd, the documented route.

### Move one session with /cd #

From the new project folder, resume the session by its ID. Claude Code looks in the current project first, then in every other project on the computer, so it finds the session under its old folder name:

bash
cd ~/dev/shop
claude --resume <session-id> # or the full path to its .jsonl file

Inside the session, run /cd /Users/anna/dev/shop. Anthropic says /cd moves the session to the new directory's project storage, and from then on it shows up in that folder's picker. For a session that still won't resume, the by-hand fixes are in [our resume guide](https://shuriken.sh/guides/resume-claude-code-session).

Shuriken runs your coding agents on your own computers and keeps them going when an account hits its limit.

[Download](https://shuriken.sh/download)

## /export makes a readable copy, not one you can resume #

/export writes the current conversation as plain text, to the clipboard or to a file (/export shop-refactor.txt), with messages and tool output laid out for reading. It makes a good record, and a good summary to paste into a fresh session. claude --resume won't take it: it wants a session ID, a name or the path of a .jsonl transcript. Copy the transcript to carry the conversation on.

## Can you sync Claude Code history between machines? #

Not with anything built in. Anthropic's docs describe local sessions as files on the computer that ran them, and nothing that keeps two computers' projects folders in step. Point a file-sync tool at ~/.claude/projects and three things happen:

- The .jsonl files copy across.
- They show up in the picker only where every project has the same path on both machines.
- When two computers write to one transcript, the tool keeps one version or saves a second copy beside it.

We'd copy one way when switching computers, or keep the work on one machine and reach it from the other over SSH.

## How Shuriken handles chat history #

Shuriken is a harness that runs Claude Code, Codex and other coding agents on your own computers and servers. A chat's history stays on the computer that ran it, not in our cloud, the same as in the terminal. A new computer starts with the copy above.

On the new computer, Add project › Import from… lists the Claude Code and Codex projects whose folders are on that computer and brings each one in with its past chats. Clone the repositories and copy the history first. Each imported chat remembers the folder it ran in, so put the projects back at their old paths, as in the first set of steps, before you import.

- The newest 10 chats go in the project's sidebar and the older ones in Archived chats.
- Shuriken reads the CLI's transcript and never writes to it. Continuing an imported chat forks the session at its first message, so claude --resume still finds the original as it was.
- Sign-ins aren't imported. A Claude login already on that computer is offered on the Sources page instead.

A chat in Shuriken doesn't need these steps. [Run it on another of your computers](https://shuriken.sh/blog/run-chat-on-another-computer), when you start it or later, and that computer gets the repository and carries on with the same chat while you follow it from the laptop or a browser.

Once the copy is done, [download Shuriken](https://shuriken.sh/download) on the new computer and import your projects.

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fmove-claude-code-history-to-new-computer&text=Move%20Claude%20Code%20chat%20history%20to%20a%20new%20computer)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fmove-claude-code-history-to-new-computer)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fmove-claude-code-history-to-new-computer&t=Move%20Claude%20Code%20chat%20history%20to%20a%20new%20computer)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fmove-claude-code-history-to-new-computer&title=Move%20Claude%20Code%20chat%20history%20to%20a%20new%20computer)[E-mail](mailto:?subject=Move%20Claude%20Code%20chat%20history%20to%20a%20new%20computer&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fmove-claude-code-history-to-new-computer)

## Sources

- [Claude Code docs: Manage sessions](https://code.claude.com/docs/en/sessions) (accessed 24 October 2026)
- [Claude Code docs: Explore the .claude directory](https://code.claude.com/docs/en/claude-directory) (accessed 24 October 2026)
- [Claude Code docs: Authentication (credential management)](https://code.claude.com/docs/en/authentication) (accessed 24 October 2026)
- [Claude Code docs: How Claude remembers your project](https://code.claude.com/docs/en/memory) (accessed 24 October 2026)
- [Claude Code docs: Commands (/cd, /export, /plugin)](https://code.claude.com/docs/en/commands) (accessed 24 October 2026)
- [Claude Code docs: Connect to tools via MCP (where scopes are stored)](https://code.claude.com/docs/en/mcp) (accessed 24 October 2026)

## Frequently asked questions

**Where does Claude Code store chat history?**

In ~/.claude/projects/<project>/<session-id>.jsonl on the computer that ran the session, where <project> is the working folder's absolute path with every character that isn't a letter or digit turned into a dash: /Users/anna/code/shop becomes -Users-anna-code-shop. With CLAUDE_CONFIG_DIR set, the whole folder lives there instead.

**Why are my Claude Code sessions not showing after migration?**

Usually the project sits at a different path on the new computer, so the folder name under ~/.claude/projects no longer matches it. Rename the folder to the new path's name, or resume the session by ID and run /cd. Two copies of one session can also make claude --resume <id> report it as not found.

**Can I resume a conversation from an /export file?**

No. /export writes plain text for a person to read, and claude --resume takes a session ID, a name or the path of a .jsonl transcript. Copy the transcript if you want the conversation to go on.

**Do I have to log in again on the new computer?**

Yes. The login isn't in the copy: macOS keeps it in the Keychain, and Linux and Windows in ~/.claude/.credentials.json, which the tar command on this page leaves out. Run claude in a project and log in, or type /login.

**Does Claude Code sync local sessions between my computers?**

No. Each computer keeps its own transcripts in its own ~/.claude/projects, and nothing built in keeps them in step. Copy the folder one way when you switch machines, with every project at the same path on both, or keep the work on one machine and connect to it.

Shuriken

The harness for your coding agents.

Run Claude Code, Codex and Gemini CLI on your own computers, move chats to your next account at a limit, and follow every chat from any device.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [Claude Code and Codex in one project: Story 27 Oct 2026 3 min read How to use Claude Code and Codex together on one project: a chat per agent, one set of MCP servers for both, and each agent on its own sources.](https://shuriken.sh/blog/claude-and-codex-together)
- [How to change the model in Claude Code: Guide 27 Oct 2026 3 min read Change the model in Claude Code with /model, claude --model, an environment variable or settings.json. /model wins; Enter in its picker sets your default.](https://shuriken.sh/guides/change-model-in-claude-code)
- [Claude Code API Error 400 on tool_use: what to do: Guide 27 Oct 2026 4 min read A Claude Code API Error 400 about tool use means the saved history has a tool call out of step with its result. Update, then rewind past the broken turn.](https://shuriken.sh/guides/claude-code-api-error-400-tool-use)
- [Claude Code custom slash commands: make your own: Guide 27 Oct 2026 3 min read Make your own Claude Code slash commands: one Markdown file in .claude/commands or a skill, with arguments, shell output and allowed tools. With examples.](https://shuriken.sh/guides/claude-code-custom-slash-commands)
- [Claude Code thinking and effort levels, explained: Guide 27 Oct 2026 4 min read Claude Code's effort levels, low to max, set how much Claude thinks before it acts. What each level is for, the defaults, ultrathink, and how to set it.](https://shuriken.sh/guides/claude-code-effort-levels)
- [Claude Code hooks not working? Why they don't fire: Guide 27 Oct 2026 6 min read A Claude Code hook that never fires is either not loaded (missing from /hooks) or loaded with a matcher that matches nothing. The causes and their fixes.](https://shuriken.sh/guides/claude-code-hooks-not-working)
- [Claude Code keyboard shortcuts and commands cheat sheet: Guide 27 Oct 2026 5 min read Every Claude Code keyboard shortcut worth knowing, for Mac and Windows, plus the slash commands that matter. One page, checked against Anthropic's docs.](https://shuriken.sh/guides/claude-code-keyboard-shortcuts)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
