Metadata-Version: 2.4
Name: claude-memory-sync
Version: 0.2.1
Summary: Sync Claude Code memory files across machines via GitHub
Author-email: Tanmay Kallakuri <tanmay@users.noreply.github.com>
License: MIT
Project-URL: Homepage, https://github.com/TanmayKallakuri/claude-memory-sync
Project-URL: Repository, https://github.com/TanmayKallakuri/claude-memory-sync
Project-URL: Issues, https://github.com/TanmayKallakuri/claude-memory-sync/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Version Control
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Dynamic: license-file

# 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

```bash
pip install claude-memory-sync
```

## Quickstart

```bash
# 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.

```bash
# 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:

```bash
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:

```bash
# 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
