Claude Backup — ~/.claude to GitHub
Use the claude-backup CLI to back up and sync your Claude Code configuration, skills, memory, and settings to a private GitHub repo.
Quick Reference
Run these via Bash:
# Smart default: init if first time, sync if already set up
claude-backup
# One-shot setup (creates repo, installs scheduler + hooks)
claude-backup init
claude-backup init --repo my-custom-name
# Manual sync
claude-backup sync
# Health check
claude-backup status
claude-backup status --json
# Scheduler management
claude-backup daemon install
claude-backup daemon install --interval 15
claude-backup daemon uninstall
claude-backup daemon status
# Hook management
claude-backup hook install
claude-backup hook uninstall
claude-backup hook status
What gets backed up
CLAUDE.md— global instructionsskills/— custom skillsagents/— agent definitionssettings.json— permissions, model configkeybindings.json— key mappingsplugins/installed_plugins.json— plugin registryprojects/*/memory/— per-project persistent memoryhooks/— hook scripts
What's excluded
- Session transcripts (JSONL — ephemeral, large)
- Credentials and secrets (
.credentials.json,*.local.json) - Debug logs, cache, telemetry
- Plugin marketplace cache
How it works
Three-layer backup:
- Passive: Claude Code hooks auto-sync after tool use (5-min debounce)
- Scheduled: launchd (macOS) or cron (Linux) every 30 min
- Manual:
claude-backup sync
Git-native — works directly in ~/.claude (no file copying). Commit messages are category-aware:
vault-sync 2026-03-10 14:30 (3 memories, 1 skill, 2 config)
Cross-machine sync
Auto-remaps project memory directories when usernames differ between machines.
Requirements
git(required)ghCLI (optional — for automatic private repo creation)- Install:
npm install -g @lucasygu/claude-backup