Skip to main content

Sync Claude Code conversations across machines — GitHub-authed CLI + server (Postgres metadata, R2 blobs).

Project description

cync — code sync for Claude Code conversations

Sync your Claude Code conversations across machines, signed in with GitHub. Your conversation metadata lives in your Supabase Postgres (per-user, RLS), the transcripts live in your Cloudflare R2 bucket, and a small FastAPI server brokers both. Like git, but for your chats: cync push on one machine, cync pull on another, and claude --resume picks up where you left off — plus a web viewer to browse them.

Browser / CLI ── GitHub login (Supabase Auth) ──┐
                                                 ▼ JWT
                                            FastAPI  ── Postgres (metadata, per-user RLS)
                                                     ── R2 (transcript blobs)

How it works

  • Sign in once per machine with cync login (GitHub via Supabase, browser PKCE).
  • A project is a first-class record you own; create one with cync init <name> and link a directory to it. Conversations are keyed by their Claude session UUID.
  • push uploads ~/.claude/projects/<repo>/<id>.jsonl; pull writes it back on the other machine and rewrites the embedded cwd so claude --resume just works.
  • Everything is scoped to your GitHub user — projects/conversations are private to you.

Install & use (hosted)

The CLI is on PyPI as cync-cli (the command is cync). No server setup — it points at the hosted cync by default:

pipx install cync-cli        # or: uv tool install cync-cli
cync login                   # sign in with GitHub
cd ~/path/to/your/project
cync init myproject && cync push     # machine A
cync link myproject && cync pull     # machine B → claude --resume

Self-hosting

Prefer your own stack? Point the CLI at your deployment via CYNC_SERVER_URL (env or ~/.config/cync/config.toml), then deploy the server + provision your own Supabase + R2:

1. Provision (one time)

  • Cloudflare R2: create a bucket (default name cync) and an API token with Object Read & Write.
  • Supabase: create a project, then run supabase/schema.sql in the SQL editor. Enable Auth → Providers → GitHub (create a GitHub OAuth App with callback https://<ref>.supabase.co/auth/v1/callback). Under Auth → URL Configuration, add redirect URLs http://127.0.0.1:8765/callback (CLI) and http://localhost:5173/auth/callback (web).

2. Server

uv venv && source .venv/bin/activate
uv pip install -e ".[server]"
cp .env.example .env     # fill in R2_* and SUPABASE_* (URL, anon, service_role)
cync-server              # http://127.0.0.1:8787

For cross-machine use, expose the server over HTTPS (Tailscale, Fly.io, Railway). The CLI refuses non-HTTPS server URLs except on localhost.

3. CLI (each machine)

uv pip install -e .                      # base install
export CYNC_SERVER_URL=http://127.0.0.1:8787   # or your https URL / config.toml
cync login                               # sign in with GitHub (opens a browser)

cd ~/path/to/your/project
cync init droneforge                     # create + link a project (machine A)
cync push
# on machine B:  cync link droneforge && cync pull  →  claude --resume

4. Web viewer (optional)

cd client
pnpm install
cp .env.example .env   # PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY, CYNC_SERVER_URL
pnpm dev               # http://localhost:5173 → "Sign in with GitHub"

The SvelteKit server holds the token (Supabase SSR cookies); browse at /p/<project>.

Commands

Command What it does
cync login / logout / whoami GitHub auth session
cync init <name> create a project + link this directory
cync link <name> link this directory to an existing project
cync unlink remove this directory's link
cync push [id] upload this project's conversation(s)
cync pull [id] download into ~/.claude (overwrite/add)
cync list list this project's conversations
cync project list / rm <name> manage your projects

Migrating from v0.2

If you have v0.2 (static-token) data still in R2, after cync login:

python scripts/migrate_legacy.py --slug <name> --email <your-github-email> [--purge]

Or simply re-cync push from a machine that has the conversations locally.

Security

  • Per-user GitHub auth (Supabase JWT); every project/conversation is owner-scoped, with Postgres RLS as a backstop. The server holds R2 + Supabase keys; clients never do.
  • CLI login uses PKCE + a single-use loopback callback; the session (refresh token) is stored 0600 at ~/.config/cync/session.json.
  • Request bodies are capped (CYNC_MAX_BODY_BYTES, default 64 MB).

Layout

src/cync/        server (FastAPI), CLI, auth, Supabase + R2 stores
client/          SvelteKit web viewer (GitHub login)
supabase/        Postgres schema + RLS
scripts/         legacy migration

Limitations

  • Last-writer-wins; no version history yet.
  • Syncs the .jsonl transcript only (enough for --resume); not todos/ sidecars.
  • Don't push a conversation that's open in Claude Code — quit first so it isn't mid-write.
  • Listing reads one object per conversation from Postgres (fine for personal scale).

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

cync_cli-0.3.0.tar.gz (48.7 kB view details)

Uploaded Source

Built Distribution

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

cync_cli-0.3.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file cync_cli-0.3.0.tar.gz.

File metadata

  • Download URL: cync_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 48.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cync_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f719fe7f1e439b8e659b1fc21dc644987d546be4ca8432a4948f3618f0d9ff47
MD5 972c10517b90455e09778b96dcf60096
BLAKE2b-256 d996ac05fdfcb7ebab2a844d8f5fd316ab8b7c038699f9102c584c6de8f202e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for cync_cli-0.3.0.tar.gz:

Publisher: publish.yml on 03hgryan/cync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cync_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cync_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cync_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e16fdf506809d0ceb3e1763acbfc6eb6b41b991748a75f27b8ceae61689f26f5
MD5 f7f59a32ed3300d4c4dfc529abfcc12a
BLAKE2b-256 d8dee4d38307a0df47e32ec0678b92c5415db828c671cb40c8d34546caf73441

See more details on using hashes here.

Provenance

The following attestation bundles were made for cync_cli-0.3.0-py3-none-any.whl:

Publisher: publish.yml on 03hgryan/cync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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