Skip to main content

Versioned snapshot-based sync for Claude Code config files across machines.

Project description

claude-cfg

Versioned snapshot-based sync for Claude Code config files across machines.

CI PyPI version Python versions License: MIT

claude-cfg is a small CLI that snapshots your ~/.claude/ directory — settings, CLAUDE.md, commands, skills, agents, plugins — and syncs the snapshots to a storage backend of your choice. Push from one machine, pull on another, and your Claude Code setup follows you.

It also scans tracked files for ~/.claude/<path> references (e.g. a status-line command) and includes those automatically, so nothing referenced gets left behind.


Features

  • Versioned snapshots — every push gets an incrementing ID, timestamp, and message
  • Multiple backends — Cloudflare R2, AWS S3, local folder (Dropbox/OneDrive/iCloud), GitHub Gist, SFTP
  • Auto-discovery — referenced scripts (e.g. status-line commands) are picked up automatically
  • Safe pulls — current config is backed up locally before any restore
  • Cross-platform — Windows, macOS, Linux
  • No daemon, no server — just push and pull when you want to

Installation

pip install claude-cfg

To enable a remote backend, install the matching extra:

pip install "claude-cfg[s3]"     # AWS S3 / Cloudflare R2
pip install "claude-cfg[gist]"   # GitHub Gist
pip install "claude-cfg[sftp]"   # SFTP
pip install "claude-cfg[all]"    # everything

Requires Python 3.10+.


Quick start

# 1. Configure interactively (pick a backend, enter credentials, choose tracked files)
claude-cfg init

# 2. Push your current config as snapshot #1
claude-cfg push "initial setup"

# On another machine, after running `claude-cfg init` with the same backend:
claude-cfg pull           # restore the latest snapshot
claude-cfg list           # see all snapshots
claude-cfg pull --point 3 # restore a specific snapshot

Commands

Command What it does
claude-cfg init Interactive setup — pick a backend, save config, push #1
claude-cfg push [message] Snapshot the current ~/.claude/ and upload it
claude-cfg pull [--point N] Restore the latest snapshot (or #N) to ~/.claude/
claude-cfg list Show all snapshots with ID, timestamp, message, machine
claude-cfg config show Print the current config (credentials masked)
claude-cfg config set K V Update a config value, e.g. claude-cfg config set r2.bucket my-bucket

Backends

Backend Best for Extra to install
local Dropbox / OneDrive / iCloud folder (built-in)
r2 Cloudflare R2 — free egress, S3 API [s3]
s3 AWS S3 [s3]
gist GitHub Gist (private, single-file ok) [gist]
sftp Any SSH server [sftp]

The local backend is the simplest path: point it at a folder inside Dropbox/OneDrive/iCloud and your snapshots sync to every machine for free.


What gets tracked

By default:

settings.json
CLAUDE.md
commands/
skills/
agents/
plugins/

You can override this during claude-cfg init or by editing ~/.claude-cfg/config.json. On push, claude-cfg also scans tracked files for ~/.claude/<path> references and auto-includes any matching files (useful for status-line scripts and similar).

Security note

settings.json typically contains API keys and tokens. Snapshots are not encrypted — they're plain zips containing whatever is tracked. Only push to private backends (your own bucket, a private Gist, an SSH server you own). The local backend inside Dropbox/iCloud/OneDrive is fine since the underlying sync is encrypted in transit and access-controlled by your account. Do not push to a public S3 bucket or a public Gist.

The sftp backend uses trust-on-first-use for host keys — fine for hosts you own on trusted networks, but be aware it can be MITM'd on first connection on a hostile network.


How snapshots are stored

<backend root>/
├── index.json                                # list of all snapshots
└── snapshots/
    ├── 001_20260507T101530_initial-setup.zip
    ├── 002_20260507T143022_added-skill.zip
    └── ...

Each zip contains the tracked files plus a manifest.json with the snapshot ID, timestamp, machine name, and file list. index.json is the source of truth for what snapshots exist.


Development

git clone https://github.com/razamit/claude-cfg.git
cd claude-cfg
pip install -e ".[dev]"
pytest

Tests run on Python 3.10/3.11/3.12 across Linux, macOS, and Windows in CI.


Contributing

Issues and PRs welcome. See CONTRIBUTING.md for the workflow and CODE_OF_CONDUCT.md for community expectations.


License

MIT © Amit Razam

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_cfg-0.1.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

claude_cfg-0.1.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file claude_cfg-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for claude_cfg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7bb3b9e35e0f8b303a223a50b053e9102d839a1d5e87f99dc58563bd55698e36
MD5 a116b523c6a186222505c3f480377f97
BLAKE2b-256 3085a5c0282aff77676a98728c6dece727541786f3407aa4c2bb5c69d9d3aa13

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_cfg-0.1.0.tar.gz:

Publisher: release.yml on razamit/claude-cfg

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

File details

Details for the file claude_cfg-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for claude_cfg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82bcb8e2343813b56b3a838dd691b5dd5d86cf08cfd76ca176fa2a734a2fe77c
MD5 06bc1cc18400c8dfbf5712e4f90f73e2
BLAKE2b-256 7ec912e30660cc10ef4234c6aefa6c7be795f8cb5b00bf584bec397aa2582fd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_cfg-0.1.0-py3-none-any.whl:

Publisher: release.yml on razamit/claude-cfg

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