
通过 Git 同步您的 Claude 代码设置( ~/. claude/) 。 备份和在任何设备上恢复 .
概览
通过 Git 备份并同步您的 Claude 代码设置(~/.claude/) 。 任何设备立即恢复。 - ~/.claude/ 只存在于本地 -- OS restall 或磁盘失效 = 所失去的一切 -- 多重设备 = 技能、钩子、规则在每台机器上分别演变 -- 手动同步容易出错 -- 丢失一个文件并断裂 复制实例命令文件以启用 /cc- sync 和/cc- 在 Claude 代码中应用 : 交叉设备内存同步需要内存库插件 : 复制了存储库的事实, 所以下个会话会自动导入它们 。 - 电报 bot sords / Chat ID - Supabase keys (特别是 service role) - API keys, 密码 - 个人文件路径
概述(AI 翻译)
通过 Git 备份并同步您的 Claude 代码设置 ([[T0]) 。 任何设备立即恢复。
□ 问题
~/.claude/仅存在于本地 – – OS 重新安装或磁盘失效=已全部丢失- 多种设备=技能、钩子、规则在每台机器上分别演变
- 手动同步容易出错 – 错过一个文件并断开东西
如何运作
□ 快开始
- 克隆这个还原
& 2. 第一次同步( 导出您的设置)
- 在另一个设备上(进口)
□ 斜线命令( 可选)
复制示例命令文件以启用 Claude 代码中的 [[T2]和 /cc-apply :
然后在克洛德代码:
∮什么得到同步∮
-
-
- 目录 * * * 描述 * * * * * * |-|-|-.
-
skills/ 技能文件(SKILL.md).
hooks/ 虎克脚本(自动验证,通知等).
rules/ 规则文件(编码模式、审查规则)
QQ[ [T8]] 已安装插件 QQ
commands/ 斜线命令定义
QQ [ [T11]] 内存文件 QQ
teams/ 团队定义
| [ [T13]] |全球设置 |
| [ [T14]] |全球指令 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
cc-sync
Back up and sync all your Claude Code settings (~/.claude/) via Git. Restore instantly on any device.
The Problem
~/.claude/only exists locally – OS reinstall or disk failure = everything gone- Multiple devices = skills, hooks, rules evolving separately on each machine
- Manual sync is error-prone – miss one file and things break
How It Works
~/.claude/ cc-sync (Git repo) Other Device
skills/ ──sync.sh──→ skills/ ──apply.sh──→ ~/.claude/
hooks/ hooks/ skills/
rules/ rules/ hooks/
agents/ agents/ rules/
plugins/ plugins/ agents/
settings.json settings.json ...
... memory-bank-sync/ ←── import-sync.sh
Quick Start
1. Clone this repo
git clone https://github.com/YOUR_USERNAME/cc-sync.git ~/Project/cc-sync
cd ~/Project/cc-sync
2. First sync (export your settings)
./sync.sh
# Follow prompts to commit and push
3. On another device (import)
git clone https://github.com/YOUR_USERNAME/cc-sync.git ~/Project/cc-sync
cd ~/Project/cc-sync
./apply.sh
claude restart
Slash Commands (Optional)
Copy the example command files to enable /cc-sync and /cc-apply in Claude Code:
cp examples/commands/cc-sync.md ~/.claude/commands/
cp examples/commands/cc-apply.md ~/.claude/commands/
Then in Claude Code:
/cc-sync # Export: ~/.claude/ → Git
/cc-apply # Import: Git → ~/.claude/
What Gets Synced
| Directory | Description |
|---|---|
agents/ |
Custom agent definitions |
skills/ |
Skill files (SKILL.md) |
hooks/ |
Hook scripts (auto-validate, notifications, etc.) |
rules/ |
Rule files (coding patterns, review rules) |
plugins/ |
Installed plugins |
commands/ |
Slash command definitions |
scripts/ |
Utility scripts |
memory/ |
Memory files |
teams/ |
Team definitions |
settings.json |
Global settings |
CLAUDE.md |
Global instructions |
memory-bank-sync/ |
Cross-device memory-bank facts |
Automation
Daily auto-sync (within a Claude Code session)
/loop 1d /cc-sync
Memory-Bank cross-device sync
Cross-device memory sync requires the memory-bank plugin:
# Install memory-bank plugin (one-time)
/plugin marketplace add https://github.com/jung-wan-kim/memory-bank
/plugin install memory-bank
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add jung-wan-kim/cc-sync-template