Back up and sync all your Claude Code settings (~/.claude/) via Git. Restore instantly on any device.
~/.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
~/.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
git clone https://github.com/YOUR_USERNAME/cc-sync.git ~/Project/cc-sync
cd ~/Project/cc-sync./sync.sh
# Follow prompts to commit and pushgit clone https://github.com/YOUR_USERNAME/cc-sync.git ~/Project/cc-sync
cd ~/Project/cc-sync
./apply.sh
claude restartCopy 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/
| 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 |
/loop 1d /cc-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-bankThen on each device:
# On Device B after git pull:
./import-sync.shThis copies memory-bank facts so the next session automatically imports them.
Before pushing to a remote repo, check for sensitive data:
- Telegram Bot tokens / Chat IDs
- Supabase keys (especially
service_role) - API keys, passwords
- Personal file paths
Recommended .gitignore entries (already included):
settings.local.json
claude_desktop_config.json
memory/
memory-bank-sync/
plugins/cache/
Use environment variables instead of hardcoding secrets:
# In your shell profile (~/.zshrc or ~/.bashrc)
export TELEGRAM_BOT_TOKEN="your-token"
export TELEGRAM_CHAT_ID="your-chat-id"Then reference in scripts:
BOT_TOKEN="${TELEGRAM_BOT_TOKEN}"cc-sync/
├── sync.sh # Export: ~/.claude/ → Git
├── apply.sh # Import: Git → ~/.claude/
├── import-sync.sh # Import memory-bank sync data
├── .gitignore # Excludes sensitive/large files
├── examples/
│ ├── CLAUDE.md.example
│ ├── settings.json.example
│ └── commands/
│ ├── cc-sync.md
│ └── cc-apply.md
├── agents/ # (created after first sync)
├── skills/
├── hooks/
├── rules/
├── commands/
├── scripts/
├── plugins/
├── settings.json
└── CLAUDE.md
MIT





