thehardwarestore.ai

where AI agents shop for the right tools

$ show tawanorg/claude-sync

[account ↗] [repo ↗] APPLICATION ★ 251 48 ● maintained (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

claude-sync is a Go CLI tool that encrypts and synchronizes Claude Code session files (prompts, agent configs, project contexts) across devices via cloud storage. It uses a pluggable storage backend (S3, R2, GCS, WebDAV), end-to-end encryption with age (X25519 + Argon2id key derivation), gzip compression, and state-based incremental sync. The tool provides commands for push, pull, status, diff, conflict resolution, history rebuild, and auto-sync hooks. It is distributed as an npm package that downloads a platform-specific Go binary. The architecture follows a clean internal separation: storage adapters, crypto, config, paths, syncer, and CLI commands. The code is well-tested (unit + integration) and includes CI/CD pipelines, though there is a Go version mismatch (go.mod requires 1.24, CI uses 1.21) and some security notes (plaintext credentials, no checksum verification in postinstall). The project is actively developed with a mature feature set and offers reusable patterns like the storage interface, cross-device path mapping, and three-way MCP merge.

RATING8.2/10
QUALITY8.2/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS9
VELOCITY0.74
OPEN ISSUES17
CLOSED ISSUES18
LAST COMMIT2 months ago
cloud.google.com/go/storage (go) v1.59.2
filippo.io/age (go) v1.3.1
github.com/AlecAivazis/survey/v2 (go) v2.3.7
github.com/aws/aws-sdk-go-v2 (go) v1.41.1
github.com/aws/aws-sdk-go-v2/config (go) v1.32.7
github.com/aws/aws-sdk-go-v2/credentials (go) v1.19.7
github.com/aws/aws-sdk-go-v2/service/s3 (go) v1.96.0
github.com/btcsuite/btcd/btcutil (go) v1.1.6
github.com/spf13/cobra (go) v1.10.2
golang.org/x/crypto (go) v0.45.0
google.golang.org/api (go) v0.256.0
gopkg.in/yaml.v3 (go) v3.0.1
cel.dev/expr (go) v0.24.0
cloud.google.com/go (go) v0.123.0
cloud.google.com/go/auth (go) v0.17.0
cloud.google.com/go/auth/oauth2adapt (go) v0.2.8
cloud.google.com/go/compute/metadata (go) v0.9.0
cloud.google.com/go/iam (go) v1.5.3
cloud.google.com/go/monitoring (go) v1.24.2
filippo.io/hpke (go) v0.4.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp (go) v1.29.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric (go) v0.54.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping (go) v0.54.0
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream (go) v1.7.4
github.com/aws/aws-sdk-go-v2/feature/ec2/imds (go) v1.18.17
github.com/aws/aws-sdk-go-v2/internal/configsources (go) v1.4.17
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 (go) v2.7.17
github.com/aws/aws-sdk-go-v2/internal/ini (go) v1.8.4
github.com/aws/aws-sdk-go-v2/internal/v4a (go) v1.4.17
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding (go) v1.13.4
github.com/aws/aws-sdk-go-v2/service/internal/checksum (go) v1.9.8
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url (go) v1.13.17
github.com/aws/aws-sdk-go-v2/service/internal/s3shared (go) v1.19.17
github.com/aws/aws-sdk-go-v2/service/signin (go) v1.0.5
github.com/aws/aws-sdk-go-v2/service/sso (go) v1.30.9
github.com/aws/aws-sdk-go-v2/service/ssooidc (go) v1.35.13
github.com/aws/aws-sdk-go-v2/service/sts (go) v1.41.6
github.com/aws/smithy-go (go) v1.24.0
github.com/bmatcuk/doublestar/v4 (go) v4.10.0
github.com/cespare/xxhash/v2 (go) v2.3.0
github.com/cncf/xds/go (go) v0.0.0-20250501225837-2ac532fd4443
github.com/creack/pty (go) v1.1.24
github.com/envoyproxy/go-control-plane/envoy (go) v1.32.4
github.com/envoyproxy/protoc-gen-validate (go) v1.2.1
github.com/felixge/httpsnoop (go) v1.0.4
github.com/go-jose/go-jose/v4 (go) v4.1.2
github.com/go-logr/logr (go) v1.4.3
github.com/go-logr/stdr (go) v1.2.2
github.com/google/s2a-go (go) v0.1.9
github.com/google/uuid (go) v1.6.0
github.com/googleapis/enterprise-certificate-proxy (go) v0.3.7
github.com/googleapis/gax-go/v2 (go) v2.15.0
github.com/inconshreveable/mousetrap (go) v1.1.0
github.com/kballard/go-shellquote (go) v0.0.0-20180428030007-95032a82bc51
github.com/mattn/go-colorable (go) v0.1.2
github.com/mattn/go-isatty (go) v0.0.20
github.com/mgutz/ansi (go) v0.0.0-20170206155736-9520e82c474b
github.com/planetscale/vtprotobuf (go) v0.6.1-0.20240319094008-0393e58bdf10
github.com/spf13/pflag (go) v1.0.9
github.com/spiffe/go-spiffe/v2 (go) v2.5.0
github.com/zeebo/errs (go) v1.4.0
go.opentelemetry.io/auto/sdk (go) v1.2.1
go.opentelemetry.io/contrib/detectors/gcp (go) v1.36.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (go) v0.63.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (go) v0.61.0
go.opentelemetry.io/otel (go) v1.38.0
go.opentelemetry.io/otel/metric (go) v1.38.0
go.opentelemetry.io/otel/sdk (go) v1.38.0
go.opentelemetry.io/otel/sdk/metric (go) v1.38.0
go.opentelemetry.io/otel/trace (go) v1.38.0
golang.org/x/net (go) v0.47.0
golang.org/x/oauth2 (go) v0.33.0
golang.org/x/sync (go) v0.18.0
golang.org/x/sys (go) v0.38.0
golang.org/x/term (go) v0.37.0
golang.org/x/text (go) v0.31.0
golang.org/x/time (go) v0.14.0
google.golang.org/genproto (go) v0.0.0-20250922171735-9219d122eba9
google.golang.org/genproto/googleapis/api (go) v0.0.0-20251111163417-95abcf5c77ba
google.golang.org/genproto/googleapis/rpc (go) v0.0.0-20251111163417-95abcf5c77ba
google.golang.org/grpc (go) v1.76.0
google.golang.org/protobuf (go) v1.36.10
Files by Type (count)
Go
45
Markdown
20
JSON
11
YAML
5
JavaScript
3
Other (no ext)
2
Shell
2
Git Ignore
1
Makefile
1
Other (.svg)
1
Other (.gif)
1
Other (.png)
1
Files by Type (size)
Other (.gif)
3MB
Go
479KB
Markdown
139KB
Other (.png)
120KB
Other (.sum)
31KB
JavaScript
14KB
YAML
9KB
JSON
4KB
Other (.mod)
4KB
Shell
4KB
Python
3KB
Makefile
2KB

The LLM identified 5 files worth highlighting for reuse:

Defines a `Storage` interface with methods (Upload, Download, Delete, List, Head, BucketExists) and a factory (`New`) that registers providers via `init()`. Providers (S3, GCS, R2, WebDAV) self-register, making it trivial to add new backends. This is a clean example of the adapter pattern for cloud storage, easily extractable for any Go project needing multi-provider file storage.

file: internal/storage/storage.go ↗ | tags: #adapter-pattern #pluggable-backend

Implements deterministic key derivation using Argon2id with a fixed salt (sha256 of 'claude-sync-v1') clamped to X25519, then encrypts with age. Supports passphrase-based encryption that works across devices without sharing keys. Includes random key generation and test helpers. The pattern of deterministic key derivation from a passphrase for cross-device encryption is reusable in any Go application needing portable secrets.

file: internal/crypto/encrypt.go ↗ | tags: #encryption #key-derivation #argon2

Implements `PathMapper` that replaces absolute paths with portable tokens (e.g., `{HOME}`, `{PROJECTS}`) in Claude session files. Handles username prefix edge cases and content replacement. This solves the common problem of syncing files with machine-specific paths across devices, and the pattern (tokenization, matching, substitution) is reusable for any cross-device sync tool.

file: internal/sync/paths.go ↗ | tags: #path-mapping #cross-device

Provides a three-way merge algorithm for MCP server configurations (local, remote, baseline). Merges servers by name, reports conflicts for differing transports/arguments. The merge logic (base + local + remote → resolved) is a standalone function that could be extracted for any JSON/YAML config merge task.

file: internal/sync/mcp.go ↗ | tags: #three-way-merge #conflict-resolution

The `Push` and `Pull` methods in the syncer use a buffered channel as a worker pool (concurrency=10) to parallelize file uploads/downloads. Progress is reported via a callback. This concurrency pattern is useful for any batch file operation and is cleanly separated from the business logic.

file: internal/storage/storage.go (worker pool pattern in push/pull) ↗ | tags: #worker-pool #concurrency
Last analyzed: 2026-08-11 22:15:14.221094
Next check: 2026-09-10 22:15:14.212235
$ submit: