Sync Claude Code memory files across machines via GitHub
Project description
claude-memory-sync
Sync Claude Code memory files across machines via GitHub.
Claude Code stores per-project memory in ~/.claude/projects/<dirname>/memory/. This tool syncs those files to a private GitHub repo so your memory follows you across devices.
Install
pip install claude-memory-sync
Quickstart
# 1. Run setup (needs gh CLI authenticated or a GitHub token)
claude-memory setup
# 2. Push your local memory to GitHub
claude-memory push
# 3. Pull memory on another machine
claude-memory pull
# 4. Bidirectional sync (pull then push)
claude-memory sync
Cross-Device Setup
Different machines encode project paths differently (C--Users-ktanm on Windows vs -Users-ktanm on Mac). Aliases map these to a shared name so syncing works seamlessly.
# Auto-create aliases from matching project names
claude-memory alias auto
# Or manually add an alias
claude-memory alias add home --dirname C--Users-ktanm
# See what aliases exist
claude-memory alias list
# Sync aliases to/from remote
claude-memory alias sync
When you run claude-memory setup on a new device, the setup wizard will automatically discover remote projects and let you map them to local ones.
Migrating Existing Data
If you already pushed data under a raw dirname and want to consolidate under an alias:
claude-memory alias migrate --dirname C--Users-ktanm --alias home
Auto-Sync with Claude Code Hooks
Install hooks so memory syncs automatically when Claude Code sessions start and stop:
# Install hooks into ~/.claude/settings.json
claude-memory hooks install
# Remove hooks
claude-memory hooks remove
Commands
| Command | Description |
|---|---|
setup |
Interactive setup wizard |
push |
Upload local memory to GitHub |
pull |
Download memory from GitHub |
sync |
Bidirectional sync (pull then push) |
alias |
Manage project aliases (add, remove, list, suggest, auto, sync, migrate) |
hooks |
Install/remove Claude Code auto-sync hooks |
status |
Show configuration and sync state |
doctor |
Diagnose configuration issues |
All sync commands support --dry-run and --project <alias> flags.
Configuration
Config is stored at ~/.claude-memory-sync/config.json:
- device_name: Identifier for this machine
- github_repo: GitHub repo in
owner/repoformat - conflict_strategy: How to handle conflicts (
merge,latest-wins, orask)
GitHub token is resolved from (in order):
CLAUDE_MEMORY_SYNC_TOKENenv varGH_TOKENenv vargh auth tokenCLI
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_memory_sync-0.2.1.tar.gz.
File metadata
- Download URL: claude_memory_sync-0.2.1.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d1432e36fd3e248ea88b08ca96027f55eb705d07346299756533dc3137c6b49
|
|
| MD5 |
048426938d07e4ddf1c967271e875088
|
|
| BLAKE2b-256 |
f0d013f6e7e365c5af0323e30290e56f39ea264108e47a0f12b68923cb26a4d8
|
File details
Details for the file claude_memory_sync-0.2.1-py3-none-any.whl.
File metadata
- Download URL: claude_memory_sync-0.2.1-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee06f7c950b7447b652456061d27fea164b67c2d0962e1e1d205912197466377
|
|
| MD5 |
b3f0e08bf89c0d623cecd851b4d6d8c7
|
|
| BLAKE2b-256 |
a81d8c7fa60bd5fd23ef5582fc68c33c9b49d98dcd569c0584f947a94e3ae479
|