@alucardeht/claude-sync
v1.0.11
Published
Cross-platform CLI tool for automatic synchronization of CLAUDE.md files across projects with GitHub backup
Maintainers
Readme
Claude Sync
Cross-platform CLI tool for automatic synchronization of CLAUDE.md files, Skills, and Agents across multiple projects with GitHub backup
Overview
Claude Sync solves the problem of maintaining consistent CLAUDE.md configuration files across multiple projects. Instead of manually copying changes between projects, it automates synchronization while keeping project-specific rules separate.
What It Does
- Automatic sync of global rules, skills, and agents across all your projects
- Separates shared rules (GLOBAL) from project-specific rules (PROJECT)
- GitHub backup of global rules, skills, and agents
- Real-time watching for automatic updates
- Smart merging generates final CLAUDE.md from GLOBAL + PROJECT
- Cross-platform support (macOS, Linux, Windows)
Quick Start
# Install globally
npm install -g @alucardeht/claude-sync
# Run interactive setup
claude-sync init
# That's it! Changes are now synced automatically
# Edit CLAUDE-GLOBAL.md or skills and watch them syncInstallation
Prerequisites: Node.js 16.0.0+, Git, GitHub account
npm install -g @alucardeht/claude-syncConfiguration
First-Time Setup
claude-sync initThe wizard will guide you through:
- Authentication method (SSH or HTTPS with token)
- GitHub repository (existing or new)
- Initial workspaces (optional)
File Structure
Locally (each workspace):
project/
├── CLAUDE-GLOBAL.md ← Synced with GitHub
├── CLAUDE-PROJECT.md ← Project-specific (local only)
└── CLAUDE.md ← Auto-generated: GLOBAL + PROJECTOn GitHub:
your-repo/
├── CLAUDE.md ← Contains global rules
├── skills/ ← Contains global skills
│ ├── agent-orchestration/
│ │ └── SKILL.md
│ └── ux-feedback-patterns/
│ └── SKILL.md
└── agents/ ← Contains global agents
├── ux-guardian.md
├── security-guardian.md
└── workflow-guardian.mdUsage
Managing Workspaces
# Add a workspace
claude-sync add ~/projects/backend
# List all workspaces
claude-sync list
# Remove a workspace
claude-sync remove ~/projects/backendBackground Daemon (Recommended)
# Start daemon (auto-sync in background)
claude-sync start
# Stop daemon
claude-sync stop
# Restart daemon
claude-sync restart
# View logs
claude-sync logs
# Follow logs in real-time
claude-sync logs -fManual Synchronization
# Sync all workspaces and push to GitHub
claude-sync sync
# Pull latest rules, skills, and agents from GitHub
claude-sync pull
# Watch for changes (foreground mode)
claude-sync watchMigration & Management
# Migrate existing CLAUDE.md to new structure
claude-sync migrate <workspace>
# Show configuration and status
claude-sync status
# Reset everything
claude-sync resetWhen to Use GLOBAL vs PROJECT
CLAUDE-GLOBAL.md (Shared Rules)
Use for rules that apply to ALL projects:
- General coding style and conventions
- Git commit message patterns
- Code review guidelines
- Documentation standards
- General security best practices
Example:
# Global Rules
## Commit Messages
- Use conventional commits: feat, fix, docs
- Keep subject line under 50 characters
## Code Style
- Use meaningful variable names
- Add comments for complex logicCLAUDE-PROJECT.md (Project-Specific Rules)
Use for rules UNIQUE to each project:
- Programming language specifics
- Framework conventions
- Project architecture
- API endpoints and database schemas
- Third-party libraries usage
Example:
# Project-Specific Rules
## Technology Stack
- Backend: Node.js + Express
- Database: PostgreSQL
- ORM: Prisma
## Architecture
- Follow MVC pattern
- Controllers in /src/controllersImportant: CLAUDE-PROJECT.md never leaves your machine. This prevents polluting shared rules with React-specific instructions when other projects use Python.
Skills Synchronization
Claude Sync automatically synchronizes Claude Code Skills across all your machines.
Global Skills (Shared)
Location (auto-detected by platform):
- macOS:
~/.claude/skills/ - Linux:
~/.claude/skills/ - Windows:
C:\Users\username\.claude\skills\
Behavior:
- Automatically synced to GitHub when modified or created
- Pulled automatically when daemon starts
- Available across all projects and machines
- Backed up in
your-repo/skills/
Filename: Both SKILL.md and skill.md are supported (case-insensitive)
Example:
~/.claude/skills/
├── agent-orchestration/
│ └── SKILL.md
├── ux-feedback-patterns/
│ └── SKILL.md
└── browser-testing/
└── skill.mdProject-Specific Skills (Local Only)
Location: <workspace>/.claude/skills/
Behavior:
- Detected by watcher
- NOT synced to GitHub (stays local)
- Useful for project-specific workflows
How It Works
- On Daemon Start: Automatically pulls latest skills from GitHub and syncs any existing local skills
- When You Create/Edit a Global Skill:
- Daemon detects new or modified file in
~/.claude/skills/*/SKILL.md - Automatically pushes to GitHub
- Daemon detects new or modified file in
- When You Edit a Project Skill:
- Daemon detects change but doesn't sync to GitHub
- Skill stays local to that project
Agents Synchronization
Claude Sync automatically synchronizes Claude Code Agents across all your machines.
Global Agents (Shared)
Location (auto-detected by platform):
- macOS:
~/.claude/agents/ - Linux:
~/.claude/agents/ - Windows:
C:\Users\username\.claude\agents\
Behavior:
- Automatically synced to GitHub when modified or created
- Pulled automatically when daemon starts
- Available across all projects and machines
- Backed up in
your-repo/agents/
Example:
~/.claude/agents/
├── ux-guardian.md
├── security-guardian.md
├── tech-lead-enforcer.md
├── workflow-guardian.md
├── context-optimizer.md
└── mobile-responsive-reviewer.mdProject-Specific Agents (Local Only)
Location: <workspace>/.claude/agents/
Behavior:
- Detected by watcher
- NOT synced to GitHub (stays local)
- Useful for project-specific agent workflows
How It Works
- On Daemon Start: Automatically pulls latest agents from GitHub
- When You Create/Edit a Global Agent:
- Daemon detects new or modified file in
~/.claude/agents/*.md - Automatically pushes to GitHub
- Daemon detects new or modified file in
- When You Edit a Project Agent:
- Daemon detects change but doesn't sync to GitHub
- Agent stays local to that project
Authentication
Option 1: SSH (Recommended)
# Generate SSH key
ssh-keygen -t ed25519 -C "[email protected]"
# Add to SSH agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Copy public key and add to GitHub
cat ~/.ssh/id_ed25519.pub
# GitHub: Settings → SSH and GPG keys → New SSH keyOption 2: HTTPS with Personal Access Token
- GitHub → Settings → Developer settings → Personal access tokens
- Generate new token (classic)
- Select scopes: ✅
repo - Copy token and use during
claude-sync init
Automatic Update Notifications
Claude Sync checks for new versions every 6 hours and notifies you when an update is available.
Update manually:
npm update -g @alucardeht/claude-syncTroubleshooting
SSH authentication failed
- Verify:
ssh -T [email protected] - Check public key is added to GitHub
- Try HTTPS with PAT instead
Repository not found
- Verify repository exists on GitHub
- Check format:
owner/repo - Ensure you have access
Failed to push
- Check internet connection
- Verify GitHub credentials
- Pull latest:
cd ~/.config/claude-sync/repo && git pull
Skills or Agents not syncing
- Verify daemon is running:
claude-sync status - For skills: Check filename is
SKILL.mdorskill.md(case-insensitive) - For agents: Check filename ends with
.md - Verify files are in global directory (
~/.claude/skills/or~/.claude/agents/) - Check logs:
claude-sync logs - Try restarting daemon:
claude-sync restart
Contributing
Contributions are welcome! Submit a Pull Request.
Development Setup:
git clone https://github.com/alucardeht/claude-sync.git
cd claude-sync
npm install
npm linkLicense
MIT License - see LICENSE file for details
