Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claude-sync

Sync your Claude Code sessions across multiple machines. Run claude --resume on any machine and pick up exactly where you left off.

The Problem

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.

How It Works

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/

What Gets Synced

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.

Installation

git clone https://github.com/ayushag-nv/claude-sync
cd claude-sync
cargo install --path .

Requires Rust and git on your PATH.

Setup

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.git

This initializes a git repo inside ~/.claude/, sets the remote, and writes the .gitignore.

3. Push from your first machine:

claude-sync push

4. On any other machine:

claude-sync resume   # pulls latest, then opens claude --resume

Commands

claude-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

Auto-Sync

Install the Claude Code hook to push automatically after every response:

claude-sync install-hooks

This 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.

Status

$ 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`

Roadmap

Milestone 1 — MVP ✅

Sequential sync across 2+ machines. push, pull, resume, install-hooks, status.

Milestone 2 — Smart Merge

Automatically combines non-conflicting conversation changes. Both machines can work independently; forked sessions are preserved as sidechains using Claude Code's native branching mechanism.

Milestone 3 — Polish

  • Bidirectional syncclaude-sync sync does pull + push in one step
  • Detailed logging — console and file logging with configurable levels
  • Auto-push hook + status improvements

Milestone 4 — Configuration & Onboarding

  • 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

Milestone 5 — Advanced Sync

  • 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

Milestone 6 — Storage & Backend

  • Git LFS support — efficiently store large conversation files with Git LFS
  • Mercurial support — use Mercurial (hg) as an alternative to Git

Milestone 7 — Advanced UX

  • Smart conflict resolution — interactive TUI for reviewing and resolving conflicts with side-by-side diff preview

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages