DEV Community

Cover image for Claude Sync: Sync Your Claude Code Sessions Across All Your Devices Simplified
Tawan C
Tawan C

Posted on

Claude Sync: Sync Your Claude Code Sessions Across All Your Devices Simplified

If you use Claude Code (Anthropic's official CLI), you've probably experienced this frustration:

You're deep into a coding session on your work laptop. Claude remembers your project context, your preferences, your conversation history. Everything is flowing perfectly.

Then you switch to your personal MacBook... and it's all gone.

Claude doesn't know what you were working on. Your custom agents? Gone. Your project memory? Vanished. You have to start from scratch.

I built Claude Sync to fix this.


What is Claude Sync?

Claude Sync is an open-source CLI tool that synchronizes your ~/.claude directory across devices using encrypted cloud storage.

Key Features:

  • πŸ” End-to-end encryption - Files encrypted with age before upload
  • πŸ”‘ Passphrase-based keys - Same passphrase = same key on any device
  • ☁️ Multi-cloud support - Cloudflare R2, AWS S3, or Google Cloud Storage
  • πŸ†“ Free tier friendly - Works within free storage limits
  • ⚑ Simple CLI - Just push and pull
# That's literally it
claude-sync push   # Upload changes
claude-sync pull   # Download changes
Enter fullscreen mode Exit fullscreen mode

What Gets Synced?

Everything Claude Code stores locally:

What Why It Matters
projects/ Session files, auto-memory for each project
history.jsonl Your command history
agents/ Custom agents you've created
skills/ Custom skills
plugins/ Installed plugins
rules/ Custom rules
settings.json Your preferences
CLAUDE.md Global instructions for Claude

Quick Start Guide

Install Claude Sync

Choose your preferred method:

# npm (recommended - works everywhere)
npm install -g @tawandotorg/claude-sync

# Or use npx for one-time use
npx @tawandotorg/claude-sync init

Enter fullscreen mode Exit fullscreen mode

Daily Workflow

Once set up, your workflow is simple:

# Start of day (or when switching devices)
claude-sync pull

# ... use Claude Code normally ...

# End of day (or before switching devices)
claude-sync push
Enter fullscreen mode Exit fullscreen mode

Pro Tip: Automate It

Add to your ~/.zshrc or ~/.bashrc:

# Auto-pull on shell start
if command -v claude-sync &> /dev/null; then
  claude-sync pull -q &
fi

# Auto-push on shell exit
trap 'claude-sync push -q' EXIT
Enter fullscreen mode Exit fullscreen mode

Get Started

npm install -g @tawandotorg/claude-sync
claude-sync init
claude-sync push
Enter fullscreen mode Exit fullscreen mode

GitHub: github.com/tawanorg/claude-sync

Documentation: tawanorg.github.io/claude-sync


Feedback Welcome!

This is an open-source project. If you:

  • Find bugs πŸ›
  • Have feature ideas πŸ’‘
  • Want to contribute 🀝

Open an issue or PR on GitHub!


Have you struggled with syncing Claude Code across devices? What solutions have you tried? Let me know in the comments!

Top comments (2)

Collapse
 
chayan-1906 profile image
PADMANABHA DAS

Hey, nice idea and clean execution! I was genuinely excited reading through this β€” the push/pull workflow is elegant.

But I have one concern that I think is pretty critical. Claude Code stores project sessions under ~/.claude/projects/, and from what I understand, it indexes them by the project's file-system path. So if I have a project at /Users/me/Downloads/my-app on machine1 and /Users/me/Documents/my-app on machine2, Claude Code would treat those as two completely separate projects internally.

That means even after syncing, claude --resume or claude --continue for a specific project won't actually pick up where I left off on the other machine β€” because the paths don't match. And continuing project sessions across devices was kind of the main selling point of the article, right?

The global stuff that does sync β€” CLAUDE.md, settings.json, agents, skills, rules β€” those are definitely useful to have everywhere. But honestly, those can be synced pretty easily with a simple Git repo or even a dotfiles setup. No encryption or cloud bucket needed.

So my question is: does the tool handle path remapping somehow, or is this a known limitation? Because if project session continuity doesn't work across different paths, the core use case feels significantly weaker.

Not trying to be negative β€” the encryption approach with age + passphrase-derived keys is genuinely well thought out. Just think this path issue deserves some attention if the tool is going to deliver on its promise. Would love to hear your thoughts!

Collapse
 
tawanorg profile image
Tawan C • Edited

Thank you for your questions, and you raised an excellent point.

The tool does sync ~/.claude/projects/, but there's no path remapping logic. Claude Code indexes project sessions by absolute
filesystem path, so:

  • /Users/me/Downloads/my-app β†’ ~/.claude/projects/-Users-me-Downloads-my-app/
  • /Users/me/Documents/my-app β†’ ~/.claude/projects/-Users-me-Documents-my-app/

These are treated as completely different projects. After syncing, claude --resume on machine2 won't find the session from machine1
because it looks for a different path.

the core "continue sessions across devices" use case is significantly limited by
Claude Code's path-based indexing. I normally use same Consistent Path Structure .

I can find workaround for the next release maybe create symlinks to unify paths. thanks!