npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@askalf/claude-sync

v0.0.1

Published

Sync Claude Code sessions across machines. Pack a local CC session into a portable .ccsync file, ship it via Dropbox / iCloud / Syncthing / a USB stick, unpack on the other side. Path-hash mismatches solved via git-remote-url as canonical project key.

Readme

@askalf/claude-sync

Sync Claude Code sessions across machines. Pack a session into a portable .ccsync file, ship it via Dropbox / iCloud / Syncthing / a USB stick, unpack on the other side. Path-hash mismatches solved via git-remote-url as the canonical project key.

npm install -g @askalf/claude-sync

CI npm License

Why

Claude Code stores sessions locally at ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl. There's no native cross-machine sync. The naive workaround — rsync ~/.claude/projects/ — has two problems:

  1. Path-hash mismatch. <encoded-cwd> is the absolute path with [/\\:.\s]+ collapsed to -. Same git repo at /Users/alice/code/myapp (mac) and D:\code\myapp (windows) hashes to different directory names → the synced session is orphaned on arrival.
  2. No file locking. Concurrent writes from two machines into the same JSONL corrupt the transcript.

claude-sync solves both:

  • Canonical project key = git:<remote-url>. Same logical repo → same key, regardless of where it's checked out. (Falls back to name:<basename> when no git remote.)
  • Single-writer model. You explicitly push from machine A, then pull on machine B. No background daemon racing files. The transport is a directory you nominate (Dropbox / iCloud / Syncthing / a USB stick); each machine writes its own file under its own machine name, so two machines pushing the same session don't collide.

Use it

One-time setup, on each machine

# Point claude-sync at a directory that's mirrored across machines.
# Anything Dropbox / iCloud / Syncthing / OneDrive sync, or a network
# share. Doesn't matter what — claude-sync just reads + writes here.
claude-sync init ~/Dropbox/claude-sync --name desktop

# On the other machine:
claude-sync init ~/Dropbox/claude-sync --name laptop

Push a session

cd ~/code/myapp
claude  # ... do work ...
# When you're switching machines:
claude-sync push
# → Pushed sess-abc123 → ~/Dropbox/claude-sync/git-https---github-com-you-myapp-git/sess-abc123-desktop.ccsync

Pull on the other machine

cd ~/code/myapp
claude-sync pull
# → Imported sess-abc123 from desktop → ~/.claude/projects/-Users-laptop-code-myapp/sess-abc123.jsonl
claude --resume sess-abc123

That's the whole loop.

How path resolution works

When you push from a project with a git remote, claude-sync:

  1. Reads git remote get-url origin from your cwd.
  2. Builds a project key: git:https://github.com/you/myapp.git.
  3. Registers the local cwd under that key in ~/.claude-sync/projects.json.
  4. Writes the .ccsync into <syncDir>/<encoded-key>/<session>-<machine>.ccsync.

When you pull, the receiving machine:

  1. Scans <syncDir>/ for project subdirs.
  2. For each, looks up the encoded key in its own projects.json.
  3. If a local cwd is registered for that key, installs the session there.
  4. If not — claude-sync hasn't seen this project on this machine yet — it skips with a warning. You either push once from the right cwd to register it, or run claude-sync import <file> --cwd <path> explicitly.

In practice: clone the repo on the new machine, cd in, run claude-sync push once with no real session (it'll error if there's no session — that's fine), then run claude-sync pull to fetch. The first push registers the cwd.

A cleaner way: just run any claude command in the cwd once, then claude-sync export (which registers without pushing).

Concurrency

There's no daemon and no automatic background sync. You decide when to push and when to pull. If you forget and edit the same session on both machines:

  • Two .ccsync files end up in <syncDir>/<project>/, named with each machine's name.
  • The receiving pull skips files older or shorter than the local copy.
  • Newer/longer files install with --overwrite. The losing machine's edits become a <session-id>-copy.jsonl (you can manually inspect + reconcile).

Future versions may add a watch-mode + lock-file protocol for "real-time" sync; v0.0.1 is deliberate-action only.

CLI reference

claude-sync init <syncDir> [--name <machine>]
claude-sync list
claude-sync export [session-id] [-o <file>]
claude-sync import <file> [--cwd <path>] [--overwrite]
claude-sync push [session-id]
claude-sync pull
claude-sync doctor
claude-sync --help / --version

doctor prints config, machine name, registered projects, and warns if any registered cwd no longer exists on disk.

File format

.ccsync is a small JSON wrapper around the JSONL session content:

{
  "_schemaVersion": 1,
  "sessionId": "...",
  "projectKey": "git:https://github.com/you/myapp.git",
  "originalCwd": "C:\\Users\\you\\code\\myapp",
  "machineName": "desktop",
  "exportedAt": 1715380000000,
  "lineCount": 142,
  "jsonl": "<the entire session JSONL>"
}

Schema-versioned. Version 1 is the only thing v0.0.1 understands; importers refuse unknown versions explicitly rather than silently dropping fields.

What it isn't

  • Not a daemon. Push and pull are explicit user actions. Run a watcher yourself if you want background sync.
  • Not a relay service. v0.0.1 ships only the filesystem transport — point it at any synced folder. SSH / S3 / gist / WebSocket transports would be straightforward additions; not in v0.0.1.
  • Not real-time. If both machines are CC-active simultaneously, the second to pull overwrites their in-progress session unless they noticed and stopped first. Use one machine at a time.
  • Not a CC re-implementation. It just shuffles JSONL. CC's session schema can change without breaking claude-sync — we never parse the events.

Library API

For embedders (custom transports, watch daemons, etc.):

import {
  listSessions, readSession, writeSession,
  buildCcsync, parseCcsync, readCcsyncFile, writeCcsyncFile,
  projectKey, registerProject, lookupCwd,
  pushToTransport, listTransport,
} from '@askalf/claude-sync';

See src/index.ts for the full surface. Zero runtime dependencies.

License

MIT — see LICENSE.

Also by askalf

| Project | What it does | |---------|-------------| | arnie | Portable IT troubleshooting companion. Networking, AD, Windows Update, package managers, log triage, hardware checks. | | brio | Capability layer for AI workloads — semantic cache, cost tiering, policy. Sits in front of any Anthropic-compat endpoint. | | browser-bridge | Stealth headless Chromium in a container. CDP on 9222 — Playwright/Puppeteer/MCP-compatible. | | claude-bridge | Bridge Claude Code sessions to Discord. | | dario | Local LLM router. Use your Claude Max/Pro subscription as an API. | | deepdive | Local research agent. Plan → search → fetch → extract → synthesize. Cited answers. | | git-providers | Unified GitHub + GitLab + Bitbucket Cloud REST clients behind one GitProvider interface. Plus a 44-entry api-key-provider taxonomy. | | hands | Cross-platform computer-use agent. Mouse, keyboard, screen. | | install-kit | curl-pipe-bash template for self-hosted Docker apps. | | pgflex | One Postgres API. Two modes (real PG ↔ PGlite WASM). | | redisflex | One Redis API. Two modes (ioredis ↔ in-process). |