claude-sync-skills
v0.1.0
Published
Automatic synchronization of Claude skills across project repositories
Maintainers
Readme
Claude Skills Auto-Sync
Automatic synchronization of Claude skills across project repositories.
Problem
Managing Claude skills across multiple repositories is cumbersome:
- 50+ custom skills need to be copied to each project
- Plugin skills (like superpowers) must be included in each repo
- Skills must be committed to git for Claude Code online handoff
- Keeping everything in sync manually is tedious and error-prone
Solution
claude-sync automatically syncs your Claude skills to project repositories:
- ✅ Automatic sync via shell hooks (triggers on
cd) - ✅ Preserves local skill modifications
- ✅ Auto-discovers plugin skills
- ✅ Fast (<1 second) and lightweight
- ✅ Stages changes but lets you control commits
Installation
Prerequisites
- Node.js 18.0.0 or higher
- Git installed and available in PATH
- Bash or Zsh shell (for automatic sync hooks)
Install from npm
npm install -g @claude/sync-skillsVerify Installation
claude-sync --versionQuick Start
1. Initialize Your Skills Directory
First, make your user skills directory a git repository (if not already):
cd ~/.claude/skills
git init
git add .
git commit -m "Initial skills"2. Install Shell Hooks (Recommended)
Install shell hooks for automatic syncing when you change directories:
claude-sync install-hooksThen restart your shell or run:
source ~/.zshrc # for zsh
source ~/.bashrc # for bash3. Register Your Projects
Navigate to any project and register it:
cd ~/projects/myapp
claude-sync registerNow skills will automatically sync when you cd into this directory!
How It Works
- Your
~/.claude/skills/becomes a git repository (source of truth) - Plugin skills are auto-discovered from
~/.claude/plugins/cache/*/skills/ - Shell hooks trigger sync when you
cdinto registered repos - Skills are copied to
.claude/skills/in each project - Changes are staged automatically (you commit when ready)
Usage
Register Repositories
Register the current directory for automatic syncing:
cd ~/projects/myapp
claude-sync registerOutput:
✓ Registered /Users/you/projects/myappCheck Registration Status
Check if the current directory is registered:
claude-sync statusOutput:
✓ Repository is registered
Registered: 2025-11-17T10:30:00.000Z
Last sync: 2025-11-17T12:45:00.000ZList All Registered Repositories
See all repositories configured for syncing:
claude-sync listOutput:
Registered repositories (3):
/Users/you/projects/myapp
Registered: 2025-11-17T10:30:00.000Z
Last sync: 2025-11-17T12:45:00.000Z
/Users/you/projects/another-project
Registered: 2025-11-17T11:15:00.000Z
Last sync: 2025-11-17T13:20:00.000ZManual Sync
Sync the current repository manually:
claude-sync runOutput:
Syncing /Users/you/projects/myapp...
✓ Synced 47 skills (2 new, 1 updated)Sync All Repositories
Sync all registered repositories at once:
claude-sync run --allVerbose Output
Get detailed information about what's being synced:
claude-sync run --verboseOutput:
Syncing /Users/you/projects/myapp...
✓ Synced 47 skills (2 new, 1 updated)
Staged changes in git
User skills: /Users/you/.claude/skills
Plugins: superpowers, custom-pluginQuiet Mode
Run sync with minimal output (useful for automated hooks):
claude-sync run --quietOnly errors and warnings will be shown.
Unregister a Repository
Remove the current directory from syncing:
claude-sync unregisterCommands Reference
| Command | Description |
|---------|-------------|
| claude-sync register | Register current repo for syncing |
| claude-sync unregister | Remove current repo from sync |
| claude-sync list | Show all registered repos |
| claude-sync status | Show sync state of current repo |
| claude-sync run | Manually sync current repo |
| claude-sync run --all | Sync all registered repos |
| claude-sync run --verbose | Sync with detailed output |
| claude-sync run --quiet | Sync with minimal output |
| claude-sync install-hooks | Install shell integration |
| claude-sync uninstall-hooks | Remove shell integration |
| claude-sync is-registered | Check if repo is registered (for scripts) |
| claude-sync --version | Show version number |
| claude-sync --help | Show help information |
Features
Conflict Detection
Local skill modifications are never overwritten. If you modify a skill in a project, it won't be updated during sync:
Syncing /Users/you/projects/myapp...
✓ Synced 45 skills (0 new, 0 updated)
⚠ Skipped 2 files (locally modified):
- my-custom-skill.md
- superpowers/debugging-workflow.mdPlugin Discovery
Plugins installed in ~/.claude/plugins/cache/ are automatically discovered and synced:
# Plugins are organized by name
.claude/skills/
superpowers/
brainstorming.md
systematic-debugging.md
custom-plugin/
my-skill.mdFast Sync
File hashing ensures only changed files are processed:
- Unchanged files are skipped (no copy operation)
- Only new or modified files are synced
- Typical sync time: <1 second
Git Integration
Changes are automatically staged but never committed:
$ claude-sync run
✓ Synced 47 skills (2 new, 1 updated)
$ git status
Changes to be committed:
modified: .claude/skills/my-skill.md
new file: .claude/skills/new-skill.mdThis gives you control over when to commit skill updates.
Configuration
Configuration is stored in ~/.claude/sync-config.json:
{
"repos": [
{
"path": "/Users/you/projects/myapp",
"registered": "2025-11-17T10:30:00.000Z",
"lastSync": "2025-11-17T12:45:00.000Z"
}
],
"sources": {
"userSkills": "/Users/you/.claude/skills",
"pluginScanPath": "/Users/you/.claude/plugins/cache/*/skills",
"excludePlugins": [],
"customPluginPaths": []
}
}Excluding Plugins
To exclude specific plugins from syncing, add them to excludePlugins:
{
"sources": {
"excludePlugins": ["unwanted-plugin", "another-plugin"]
}
}Troubleshooting
Skills Not Syncing
Problem: Changed a skill but it's not syncing to projects.
Solutions:
Check if the skill directory is a git repo:
cd ~/.claude/skills git statusIf not initialized, run:
git init git add . git commit -m "Initial skills"Verify the repository is registered:
cd ~/projects/myapp claude-sync statusTry manual sync:
claude-sync run --verbose
Shell Hooks Not Working
Problem: Skills don't sync automatically when changing directories.
Solutions:
Verify hooks are installed:
cat ~/.zshrc | grep claude-syncor
cat ~/.bashrc | grep claude-syncReinstall hooks:
claude-sync uninstall-hooks claude-sync install-hooks source ~/.zshrc # or ~/.bashrcCheck if repo is registered:
claude-sync is-registered echo $? # Should output 0 if registered
Skills Marked as "Locally Modified"
Problem: Skills are being skipped with "locally modified" warning.
Explanation: This is intentional! The tool detected you modified the skill locally and won't overwrite your changes.
Solutions:
If you want to keep local changes: No action needed
If you want to accept source version:
cd ~/projects/myapp git checkout .claude/skills/problem-skill.md claude-sync runIf you want to update the source:
cp ~/projects/myapp/.claude/skills/problem-skill.md ~/.claude/skills/ cd ~/.claude/skills git add problem-skill.md git commit -m "Update problem-skill from project"
Permission Errors
Problem: Getting permission denied errors.
Solutions:
Check file permissions:
ls -la ~/.claude/skillsEnsure you own the skills directory:
sudo chown -R $USER ~/.claude/skillsCheck if files are locked or in use
Git Not Staging Files
Problem: Files are synced but not staged in git.
Solutions:
Check if repo is in detached HEAD state:
git statusIf detached, checkout a branch:
git checkout mainCheck if .claude/skills is gitignored:
cat .gitignore | grep claudeManually stage if needed:
git add .claude/skills
Sync Metadata Conflicts
Problem: .sync-metadata.json causing issues.
Solution: This file should be gitignored (automatic). If you see it in git:
cd ~/projects/myapp
git rm --cached .claude/.sync-metadata.json
echo '.sync-metadata.json' >> .claude/.gitignore
git add .claude/.gitignore
git commit -m "Ignore sync metadata"Plugin Skills Not Appearing
Problem: Plugins installed but skills aren't syncing.
Solutions:
Verify plugin directory structure:
ls -la ~/.claude/plugins/cache/*/skillsCheck if plugin is excluded in config:
cat ~/.claude/sync-config.jsonTry manual sync with verbose output:
claude-sync run --verbose
Multiple Git Worktrees
Problem: Using git worktrees and sync behaves unexpectedly.
Solution: Each worktree is treated as a separate repository. Register each worktree individually:
cd ~/projects/myapp/.worktrees/feature-branch
claude-sync registerBest Practices
- Keep skills in git: Always commit your user skills to version control
- Review before committing: Check synced changes before committing to projects
- Use meaningful commits: Commit skill updates separately from code changes
- Test skills locally: Modify skills in projects, test them, then promote to user skills
- Regular syncs: Run
claude-sync run --alloccasionally to ensure all projects are up-to-date
Documentation
- DESIGN.md - Complete architecture and implementation details
- docs/CONTRIBUTING.md - Development and contribution guidelines
Support
For issues and feature requests, please open an issue on GitHub.
License
MIT
