Skip to main content

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/repo format
  • conflict_strategy: How to handle conflicts (merge, latest-wins, or ask)

GitHub token is resolved from (in order):

  1. CLAUDE_MEMORY_SYNC_TOKEN env var
  2. GH_TOKEN env var
  3. gh auth token CLI

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_memory_sync-0.2.0.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_memory_sync-0.2.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file claude_memory_sync-0.2.0.tar.gz.

File metadata

  • Download URL: claude_memory_sync-0.2.0.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for claude_memory_sync-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0cef6ae14b3edc91b7151159a01e9887e092c869a4128bd36f623034637451e6
MD5 e5c5892c1de0a0baf81c3b9e22cc5e5a
BLAKE2b-256 6438ee3c12746882bca022c1e0e95c7ffeee080f664753cd14d7db41ce25688a

See more details on using hashes here.

File details

Details for the file claude_memory_sync-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_memory_sync-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ae4b008e965954077a22b64558490a622555ec838753276a08a600d5cbec68
MD5 4cec132499b0edc85ef566adc75e0e09
BLAKE2b-256 a35d0249ea42c2cb09ba0a74e3d5fbc02604c1bc9f54ed05d2767587748c2c61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page