Skip to main content

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

Metadata

Release files for claude-cfg 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-cfg 0.2.0
File Size Uploaded
claude_cfg-0.2.0.tar.gz 24.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-cfg 0.2.0
File Interpreter ABI Platform
claude_cfg-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.6 kB

Release files / claude_cfg-0.2.0.tar.gz

Download URL claude_cfg-0.2.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2b3175a9256f60084ba2485978cd0802329cfab56554f5a9f697817a4e4601bb
BLAKE2b-256 checksum
How to use checksums
d0b706977fa528000af26bb89465f3155b83223009194b4cf4fb2825cdff2fef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.

Transparency log

Release files / claude_cfg-0.2.0-py3-none-any.whl

Download URL claude_cfg-0.2.0-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b07c81357df6fca37c2b50b89ef54713a177f912059dcd2467dc95abe6db397b
BLAKE2b-256 checksum
How to use checksums
47e35a3cc576c4ae12dc96117a60729f25806290b3a786da9e7c7b897500b670
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page