@opentech1/cc-sync
v2.0.13
Published
Sync Claude Code configuration across devices via GitHub
Maintainers
Readme
cc-sync
Sync your Claude Code configuration across devices via GitHub.
What is cc-sync?
cc-sync automatically synchronizes your Claude Code slash commands and configuration files across multiple devices using a private GitHub repository. Any changes you make to ~/.claude/ on one device can be easily synced to all your other devices.
Features
- Automatic sync: Push and pull your Claude configuration with simple commands
- Daemon mode: Watch for changes and auto-push them to GitHub
- Private & secure: Uses your existing GitHub authentication via
ghCLI - Simple setup: One command to initialize
Requirements
- Node.js 18+ or Bun (recommended)
- GitHub CLI (
gh) installed and authenticated# Install GitHub CLI (macOS) brew install gh # Authenticate gh auth login
Installation
Using Bun (recommended)
# Clone the repository
git clone https://github.com/yourusername/cc-sync.git
cd cc-sync
# Install globally
bun install -g .Using npm
# Clone the repository
git clone https://github.com/yourusername/cc-sync.git
cd cc-sync
# Install globally
npm install -g .After installation, you can use the cc-sync command from anywhere.
Quick Start
1. Initialize
First-time setup on your primary device:
cc-sync initThis creates a private .cc-sync-config repository on your GitHub account and pushes your current ~/.claude/ configuration.
2. Push changes
After making changes to your Claude configuration:
cc-sync push3. Pull changes
On another device, pull the latest configuration:
cc-sync pull4. Check status
See what has changed locally:
cc-sync status5. Daemon mode (optional)
Automatically push changes whenever files are modified:
cc-sync daemonPress Ctrl+C to stop the daemon.
How it Works
- Private GitHub repo: cc-sync creates a private repository called
.cc-sync-configon your GitHub account - Local config: Your Claude configuration lives in
~/.claude/ - Git-based sync: Uses Git to track changes and sync between devices
- GitHub CLI: Leverages
ghfor authentication (no need to manage tokens)
Commands
cc-sync init # Initialize cc-sync (first-time setup)
cc-sync push # Push local changes to GitHub
cc-sync pull # Pull changes from GitHub
cc-sync status # Show local changes
cc-sync daemon # Watch for changes and auto-push
cc-sync --help # Show help
cc-sync --version # Show versionTypical Workflow
On your first device
# One-time setup
cc-sync init
# Make changes to ~/.claude/commands/
# Then push them
cc-sync pushOn your second device
# One-time setup
cc-sync init
# Pull the configuration from your first device
cc-sync pull
# Make changes locally
# Push them back
cc-sync pushUsing daemon mode
# Start watching for changes
cc-sync daemon
# Now any changes to ~/.claude/ are automatically pushed
# Leave it running in the background or in a tmux sessionWhat Gets Synced?
Everything in your ~/.claude/ directory:
- Slash commands (
~/.claude/commands/*.md) - CLAUDE.md configuration
- Any other configuration files you add
Troubleshooting
"gh: command not found"
Install the GitHub CLI:
brew install gh
gh auth login"Repository already exists"
If .cc-sync-config already exists on your GitHub account, you can:
- Delete it from GitHub and run
cc-sync initagain - Or manually clone it to
~/.claude/.cc-sync-repo/
Merge conflicts
If you have conflicting changes on multiple devices:
cd ~/.claude/.cc-sync-repo
git status
# Resolve conflicts manually
git add .
git commit -m "Resolved conflicts"
cc-sync pushLicense
MIT
Contributing
Issues and pull requests welcome!
