Sync your Claude Code sessions across multiple machines. Run claude --resume on any machine and pick up exactly where you left off.
Claude Code stores all session data locally in ~/.claude/. If you work across multiple remote machines, there's no built-in way to resume a session started elsewhere.
claude-sync uses a private git repository as the sync backend. It commits and pushes your ~/.claude/ data (sessions, memory, history, settings) to a remote you control, and pulls it down on any other machine before resuming.
Machine A Git Remote Machine B
~/.claude/ ──push──▶ github.com/you/sessions ◀──pull── ~/.claude/
| Path | Description |
|---|---|
projects/*/ |
Session transcripts (the core data) |
history.jsonl |
Command history / resume picker index |
todos/ |
Per-session task state |
CLAUDE.md |
Global instructions |
settings.json |
Preferences |
skills/ |
Custom skills |
Machine-local files (sessions/, cache/, telemetry/, etc.) are excluded automatically.
git clone https://github.com/ayushag-nv/claude-sync
cd claude-sync
cargo install --path .Requires Rust and git on your PATH.
1. Create a private repository on GitHub/GitLab to store your sessions. Keep it private — it will contain your conversation history.
2. On each machine, run:
claude-sync init git@github.com:you/claude-sessions.gitThis initializes a git repo inside ~/.claude/, sets the remote, and writes the .gitignore.
3. Push from your first machine:
claude-sync push4. On any other machine:
claude-sync resume # pulls latest, then opens claude --resumeclaude-sync init <remote> One-time setup per machine
claude-sync push Commit and push ~/.claude changes
claude-sync pull Pull remote changes
claude-sync resume Pull then launch claude --resume
claude-sync install-hooks Auto-push after every Claude response (Stop hook)
claude-sync uninstall-hooks Remove the auto-push hook
claude-sync status Show sync state at a glance
Install the Claude Code hook to push automatically after every response:
claude-sync install-hooksThis adds claude-sync push --quiet to the Stop hook in ~/.claude/settings.json. After that, just use claude-sync resume instead of claude --resume on new machines.
$ claude-sync status
Remote: git@github.com:you/claude-sessions.git (main)
Last sync: abc1234 3 minutes ago
Remote: up to date
Local: 3 files modified — run `claude-sync push`
Sequential sync across 2+ machines. push, pull, resume, install-hooks, status.
Automatically combines non-conflicting conversation changes. Both machines can work independently; forked sessions are preserved as sidechains using Claude Code's native branching mechanism.
- Bidirectional sync —
claude-sync syncdoes pull + push in one step - Detailed logging — console and file logging with configurable levels
- Auto-push hook + status improvements
- Interactive onboarding — first-time setup wizard guides you through configuration
- Non-interactive init — config file support for CI/CD and automation
- Flexible configuration — full TOML config with per-command CLI overrides
- Branch management — sync to different branches, manage multiple remotes
- Selective sync — filter by project, date range, or exclude attachments
- Undo operations — rollback any pull/push using automatic pre-sync snapshots
- Operation history — track and review past sync operations
- Conflict tracking — export detailed conflict reports as JSON or Markdown
- Git LFS support — efficiently store large conversation files with Git LFS
- Mercurial support — use Mercurial (hg) as an alternative to Git
- Smart conflict resolution — interactive TUI for reviewing and resolving conflicts with side-by-side diff preview