MichaelP17/claude-mods/tree/main/config-snapshots
config-snapshots
`~/.claude`를 버전 관리하므로 플러그인, mod 또는 skill을 시험해도 되돌릴 수 있습니다. 스냅샷을 만들고 실험한 뒤 마음에 들지 않으면 롤백합니다.
이 mod 소개
shell 스크립트 bin/claude-config와 이를 노출하는 Claude Code mod가 ~/.claude를 ~/.claude-config.git의 bare git 저장소로 백업합니다. 스냅샷은 설정, 규칙, skills, agents, 명령, hooks, 키 바인딩 및 플러그인 메타데이터를 기록하고 transcript, 기록 및 캐시는 무시합니다. Claude Code 안에서 /snapshot, /snapshots, /rollback 명령, 머신별 패키지 목록, 선택적 원격 push 및 되돌릴 수 있는 롤백을 지원하며 패키지를 자동으로 제거하지 않습니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add MichaelP17/claude-mods claude plugin install config-snapshots
원문 / README
config-snapshots
Puts ~/.claude under version control, so trying a plugin, mod or skill is reversible: take a snapshot, experiment, roll back if you do not like the result.
It consists of a shell script, bin/claude-config, and a mod that exposes the script inside Claude Code. Both do the same thing; use whichever is at hand.
What a snapshot holds
The snapshot repository is a bare git repository at ~/.claude-config.git whose work tree is ~/.claude. Nothing inside ~/.claude changes except one file, ~/.claude/.gitignore, which is an allowlist: everything is ignored unless listed.
| Recorded | Not recorded |
| --- | --- |
| settings.json, CLAUDE.md, rules/, skills/, agents/, commands/, hooks/, keybindings.json, statusline.py | transcripts (projects/), history.jsonl, caches, sessions |
| plugins/installed_plugins.json, plugins/known_marketplaces.json | plugin caches and marketplace clones |
| inventory/<machine>/ | |
inventory/<machine>/ lists what is installed on the machine at snapshot time: Homebrew (Brewfile), global npm, cargo, mise, dotnet tool, uv tool, pipx and winget packages — each only if the tool exists — the MCP servers from ~/.claude.json, and the commit of every mod loaded through CLAUDE_CODE_PLUGIN_DIRS. Each machine writes only its own folder, so several machines can share one snapshot repository.
Setup
-
Initialise the repository and record the first snapshot,
baseline. Pass a remote URL to push snapshots there (an empty, private repository is the right target):~/claude-mods/config-snapshots/bin/claude-config init [email protected]:<you>/claude-config.gitWithout a URL, snapshots stay local. An existing
~/.claude/.gitignoreis kept as the allowlist. -
Optional — use the script by name in a terminal by adding its folder to
PATHin your shell profile:export PATH="$HOME/claude-mods/config-snapshots/bin:$PATH" -
Optional — let Claude take snapshots and roll back without a permission prompt: run
/permissionsin Claude Code and add the allow rulesBash(claude-config snapshot:*)andBash(claude-config rollback:*)to the user settings. This needs step 2.
To keep the repository elsewhere, set CLAUDE_CONFIG_GIT_DIR to its path — in the shell profile for the terminal, and in the env block of ~/.claude/settings.json for the mod.
Use
| Command | Effect |
| --- | --- |
| claude-config snapshot <name> [message] | Record the current state as <name>; spaces become dashes |
| claude-config list | All snapshots with date |
| claude-config status | Changes since the last snapshot, plus new entries in ~/.claude the allowlist does not cover |
| claude-config diff <name> [--full] | Changed files since <name> and packages installed since then |
| claude-config rollback <name> | Restore the config of <name> |
| claude-config brew-cleanup <name> | Uninstall Homebrew packages added since <name>, after confirmation |
| claude-config prune | Delete caches of plugins and marketplaces that are no longer installed, after confirmation |
Inside Claude Code:
| Command | Effect |
| --- | --- |
| /snapshot <name> | Same as claude-config snapshot |
| /snapshots | A pane with all snapshots; selecting one shows its diff, a button rolls back after a second confirming press |
| /rollback <name> | Opens the pane on that snapshot |
At session start a toast reports when the config changed since the last snapshot.
A rollback never rewrites history: it commits the current state first, then commits the restored one, so a rollback can itself be undone. It never uninstalls packages; it lists them and leaves the decision to you. snapshot and rollback push to origin when a remote is set; CLAUDE_CONFIG_NO_PUSH=1 skips the push. Restart Claude Code after a rollback.
Limits
- MCP servers added with
claude mcp add --scope userlive in~/.claude.json, which also holds login data and runtime state. Only itsmcpServerssection is recorded, and a rollback reports differences there instead of rewriting the file. plugins/installed_plugins.jsoncontains absolute paths, so plugins are best installed per machine rather than shared across operating systems.lastUpdatedinplugins/known_marketplaces.jsonis not recorded, because Claude Code rewrites it on every background marketplace refresh. A rollback restores that file without the field.- Homebrew's auto-update is disabled while the script reads the inventory; otherwise taking a snapshot could migrate formulae.
Uninstall
Remove the mod from CLAUDE_CODE_PLUGIN_DIRS. The snapshot repository ~/.claude-config.git and ~/.claude/.gitignore stay until you delete them.
