Claude Sync: Sync Your Claude Code Sessions Across All Your Devices Simplified
Source: Dev.to
Introduction
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, preferences, and conversation history.
- Then you switch to another device and everything is gone—custom agents, project memory, and history are missing, forcing you to start from scratch.
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 are encrypted with age before upload.
- 🔑 Passphrase‑based keys – The same passphrase generates the same key on any device.
- ☁️ Multi‑cloud support – Works with Cloudflare R2, AWS S3, or Google Cloud Storage.
- 🆓 Free‑tier friendly – Operates within typical free storage limits.
- ⚡ Simple CLI – Just
pushandpull.
Directory Structure Synchronized
Claude Sync mirrors everything Claude Code stores locally:
~/.claude/
├── projects/ # Session files, auto‑memory for each project
├── history.jsonl # 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
Installation
npm (recommended)
npm install -g @tawandotorg/claude-sync
npx (one‑time use)
npx @tawandotorg/claude-sync init
Basic Usage
# Upload changes
claude-sync push
# Download changes
claude-sync pull
Typical workflow:
# Start of day (or when switching devices)
claude-sync pull
# ... use Claude Code normally ...
# End of day (or before switching devices)
claude-sync push
Shell Integration (Optional)
Add the following to ~/.zshrc or ~/.bashrc for automatic syncing:
# 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
Project Links
- GitHub:
- Documentation:
Contributing
If you find bugs, have feature ideas, or want to contribute, please open an issue or pull request on GitHub.