- The terminal version of Claude Code has no built-in cloud sync. Conversations are local only.
- Turn ~/.claude/projects into a private GitHub repository.
- Use Git LFS for large files (GitHub blocks files over 100MB).
On one real machine we tested, we found 1,388 Claude Code conversations totaling about 968MB across 40 projects, all stored locally only, with no cloud copy by default. Delete the folder, reformat the drive, or have your laptop stolen and every last conversation is gone with no way to recover it.
Claude Code saves all your conversations locally on your machine only. There is no built-in cloud sync. The solution: turn the conversations folder ~/.claude/projects into a private GitHub repository, use Git LFS for large files, and sync everything with a single command, claude-sync. On a new machine, run clone and pick up exactly where you left off. This guide covers every step, full automation, security rules, and fixes for every common problem.
In short (TL;DR)
- The terminal version of Claude Code has no built-in cloud sync. Conversations are local only.
- Turn
~/.claude/projectsinto a private GitHub repository. - Use Git LFS for large files (GitHub blocks files over 100MB).
- Sync with one command:
claude-sync, with an option for full automation. - On a new machine:
clone+git lfs pull, then continue as normal withclaude --resume.
Where does Claude Code store my conversations?
The short answer: All conversations are saved locally on your machine, in the folder ~/.claude/projects/. There is no cloud copy by default.
Inside that folder, each conversation is a separate .jsonl file, grouped by the working directory in which it was created. For example, on one real machine there were 1,388 conversations taking up approximately 968MB across roughly 40 projects.
What is a Claude Code .jsonl file? A text log of a single conversation in JSON Lines format: each line is one event (a message, a tool call, a result). Claude Code reads it to restore a conversation with
claude --resume. If the file exists in the folder, the conversation can be continued. If it does not, the conversation is gone.
New to Claude Code? A good place to start is the beginners' guide and how to install it.
Folder structure: how conversations are organized
The short answer: Each project gets its own subfolder inside ~/.claude/projects/, named after the working directory path with hyphens replacing slashes. Inside it, one .jsonl file per conversation.
Here is what it looks like in practice:
~/.claude/
├── projects/ ← this is the folder you sync
│ ├── -Users-me-my-website/
│ │ ├── 4bb68372-...-11fa00d1.jsonl ← conversation 1
│ │ └── a394e9f5-...-09b364.jsonl ← conversation 2
│ └── -Users-me-another-project/
│ └── 7e4f1302-...-c41529.jsonl
├── settings.json ← settings (do not sync)
└── .credentials.json ← auth tokens (never sync, under any circumstances)
A critical security point: Sync only ~/.claude/projects, not all of ~/.claude. The parent folder also contains settings and sometimes authentication tokens. Those should never go into Git, not even in a private repository.
Does Claude Code have built-in cloud sync?
The short answer: No. The terminal version currently has no feature that uploads local history to the cloud and lets you continue it from another machine. That is why you sync manually.
The most reliable approach is a private GitHub repository. It gives you backups, version history (you can roll back to yesterday's snapshot), and full control over when you push and pull, with no risk of the automatic conflicts you get from transparent sync folders.
Why do you need Git LFS and not plain Git?
The short answer: Because GitHub blocks individual files over 100MB (source: GitHub Docs) and starts warning at 50MB. Long Claude Code conversations easily cross that threshold, and a regular push will fail with a file is too large error.
What is Git LFS? Git Large File Storage is a Git extension that stores large files on a separate server and keeps only a small "pointer" in the repository in their place. The repository stays lean, and the large files are still synced automatically.
With Git LFS, large files remain real, live files on disk, so on a new machine everything just works after clone, with no manual restore step.
Step-by-step guide: setting up the backup (one time only)
The short answer: Run the following commands on your primary machine. They set up a private repository, enable LFS, and push all your conversations. The whole thing takes a few minutes.
1. Install Git LFS
brew install git-lfs
(On other systems: sudo apt install git-lfs on Linux, or the installer from git-lfs.com on Windows.)
2. Turn the conversations folder into a repository with LFS
cd ~/.claude/projects
git lfs install --local
git init
git lfs track "*.jsonl"
git add -A
git commit -m "backup: initial snapshot of all Claude Code conversations"
Tip: The command
git lfs track "*.jsonl"creates a.gitattributesfile that tells Git to handle all.jsonlfiles through LFS. That file is included in the commit, so on a new machine the rules are already there.
3. Create a private repository and push to the cloud
Using the GitHub CLI (gh). The first push uploads all the data through LFS and may take a few minutes.
gh repo create claude-history --private --source=. --remote=origin
git branch -M main
git push -u origin main
⚠️ Privacy warning: Conversation files contain everything you discussed with the agent: code, file paths, and sometimes secrets that came up. Make sure the repository is marked Private (the
--privateflag), and never push it to a public repository under any circumstances.
How to continue your conversations on a new machine
The short answer: Three one-time steps, then work as normal. Clone the repository into the Claude folder and pull the LFS files.
brew install git-lfs
git clone https://github.com/<user>/claude-history.git ~/.claude/projects
cd ~/.claude/projects
git lfs pull
From there, open claude in any project, run claude --resume, and pick the conversation you want to continue, exactly as on your original machine.
What is the difference between
--resumeand--continue?claude --resumeopens a list of all conversations in the project so you can choose one.claude --continue(orclaude -c) automatically continues the most recent conversation. After syncing from another machine,--resumeis preferable because it also shows the conversations that just came down from the cloud.
Important: If the folder ~/.claude/projects already exists on the new machine (with its own local conversations), do not run clone on top of it. It will fail. In that case, skip ahead to the "Working from multiple machines" section below.
The claude-sync command: your daily workflow
The short answer: To avoid remembering a sequence of commands every time, build a single two-way sync command. Create a script file in a directory on your PATH (for example /opt/homebrew/bin/claude-sync):
#!/usr/bin/env bash
set -euo pipefail
cd ~/.claude/projects
git add -A
if ! git diff --cached --quiet; then
git commit -qm "backup: sync $(date '+%Y-%m-%d %H:%M')"
fi
git pull --rebase --no-edit origin main
git lfs pull
git push -q origin main
echo "Conversations synced with GitHub."
Make it executable, and from that point on you sync everything with one word:
chmod +x /opt/homebrew/bin/claude-sync
claude-sync
What does claude-sync do? The command saves new conversations (commit), pulls changes from other machines (
pull --rebase), downloads LFS files, and pushes everything to the cloud, all in one safe operation you can run from any machine.
Recommended habit: Run claude-sync at the start of your workday (to pull the latest) and at the end (to push what you did).
An additional shortcut: a shell alias
If you would rather not keep a separate file on your PATH, add a line to ~/.zshrc (or ~/.bashrc):
alias csync='cd ~/.claude/projects && git add -A && git commit -qm "sync $(date +%F_%H:%M)" 2>/dev/null; git pull --rebase --no-edit && git lfs pull && git push -q'
Reload with source ~/.zshrc, and from that point csync does exactly the same thing.
Automation: syncing automatically without thinking about it
The short answer: Anyone who does not want to run claude-sync manually can run it automatically on a fixed schedule through cron, or in the background through launchd on a Mac.
The simplest approach: cron that runs a sync twice a day (morning and evening). Open crontab -e and add:
0 9,19 * * * /opt/homebrew/bin/claude-sync >> ~/.claude/sync.log 2>&1
This runs the sync every day at 09:00 and 19:00, and writes a log to ~/.claude/sync.log.
An important warning about automation: Automatic sync is safe only if you are working on one machine at any given time. If two machines are syncing automatically and you are working on both on the same day, you will get conflicts. For multi-machine work, prefer manual sync (next section) so you control exactly when each machine pushes and pulls.
Working from multiple machines: the right workflow
The short answer: The only rule that matters is one machine at a time. Finish on machine A, push, and only then switch to machine B, pull, and start.
The exact routine that prevents all conflicts:
- On machine A, at the end of your session:
claude-sync(pushes what you did). - Switch to machine B. Before touching Claude Code:
claude-sync(pulls what machine A pushed). - Work on machine B.
- At the end:
claude-syncagain, and repeat.
If you forgot to sync and did work on two machines in parallel, it is not a disaster. The git pull --rebase inside claude-sync will attempt to merge. In the rare case of a conflict on the same conversation file, Git will ask for manual intervention. Because each conversation is a separate file, this only happens if you continued the exact same conversation on two machines, a situation that is easy to avoid.
Fixing common problems
The short answer: Most problems involve the LFS quota, a rejected push, or a file that crossed 100MB before LFS was enabled. All of them are fixable in a few lines.
this exceeds GitHub's file size limit of 100.00 MB: A file entered plain Git before you enabled LFS. Fix it with:
git lfs migrate import --include="*.jsonl" --everything
git push --force origin main
Updates were rejected because the remote contains work that you do not have: Another machine pushed before you. Just pull first:
git pull --rebase --no-edit origin main && git push
batch response: This repository is over its data quota: You have exceeded the free LFS quota (1GB). Your options are to purchase a data pack for $5 per month, or to remove very old conversations from the history.
The clone on a new machine brought small "pointer" files instead of conversations: You forgot git lfs pull. Run it inside the folder and you are done.
Limits and Quotas Worth Knowing
The short answer: Everything is free in most cases, but there are two limits worth knowing about: the LFS bandwidth quota, and the "one machine at a time" rule.
- Free LFS quota: Approximately 1 GB storage and 1 GB bandwidth per month (source: GitHub Docs). The first
cloneon a new machine consumes almost the entire monthly bandwidth quota in one shot. - Growth: If your history exceeds 1 GB, GitHub offers a data pack for around $5 per month for 50 GB storage + 50 GB bandwidth.
- Not simultaneously: Do not work on two machines at the same time against the same sync. It creates conflicts. One machine at a time.
- This is not Claude Code Web: This guide syncs your local terminal history, not claude.ai/code sessions.
- Only
projects/, not all of~/.claude: Do not sync settings or authentication tokens.
Alternatives: When to Choose Something Else?
The short answer: GitHub + LFS gives you the best control and backup, but requires running claude-sync. Here is the full comparison:
| Method | Advantage | Main Disadvantage | Best For |
|---|---|---|---|
| Private GitHub + LFS | Backup, versioning, full control | Requires running claude-sync | Anyone who also wants historical backup |
| iCloud/Dropbox + symlink | Transparent, automatic sync | Conflict risk across 2 machines | Single machine + passive backup |
| Claude Code Web | Fully cloud-based, accessible from any browser | Does not import existing local conversations | Anyone starting fresh in the cloud |
| rsync to a private server/NAS | Complete privacy, no third party | Requires a server and maintenance | Anyone already managing a server |
Note on iCloud/Dropbox: You can move
~/.claude/projectsinto a sync folder and create a symlink in the original location. It works and it is convenient, but these sync services do not understand merging. If two machines write simultaneously, one "wins" and the other may lose changes. That is why GitHub is preferable when working across multiple machines.
Security and Privacy: Three Rules
The short answer: Conversation files contain sensitive information. Three rules cover most of the risk: private repo, no syncing of credentials, and consider encryption if secrets are involved.
- Private repo only. Never public. Conversations contain paths, code, and sometimes secrets you mentioned in passing.
- Only
projects/. Do not sync~/.claude/settings.json, and certainly not the credentials file. - Encryption for those who need it. If you work on especially sensitive projects, you can encrypt the folder with
git-cryptbefore pushing, so even if someone reaches the repo, the contents are encrypted. For anyone who mentioned a real secret in a conversation, the general recommendation is always: rotate the secret, because it has already been written to a file.
The Bottom Line
Claude Code does not sync conversations to the cloud on its own, but with a few minutes of one-time setup you turn ~/.claude/projects into a cloud-synced backup with full version history, and you pick up those same conversations from any machine with a single command: claude-sync. Add a cron job for automatic sync, remember the "one machine at a time" rule, and never sync your credentials, and your history is protected forever.
Want to learn how to work with Claude Code in depth, from installation to building agents and complete systems? There is the free courses at the Academy, a guide to building a full website with Claude Code, the MCP guide in Hebrew, and for anyone who wants personal guidance, a private 1-on-1 lesson.

