Automatic synchronization of Claude skills across project repositories.
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
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
- Node.js 18.0.0 or higher
- Git installed and available in PATH
- Bash or Zsh shell (for automatic sync hooks)
npm install -g @claude/sync-skillsclaude-sync --versionFirst, make your user skills directory a git repository (if not already):
cd ~/.claude/skills
git init
git add .
git commit -m "Initial skills"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 bashNavigate to any project and register it:
cd ~/projects/myapp
claude-sync registerNow skills will automatically sync when you cd into this directory!
- 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)
Register the current directory for automatic syncing:
cd ~/projects/myapp
claude-sync registerOutput:
✓ Registered /Users/you/projects/myapp
If you have several existing projects and want to register them all, here's a systematic approach:
Step 1: Find all your git repositories
find ~ -type d -name ".git" -maxdepth 5 2>/dev/null | sed 's/\/.git$//' | grep -v "/\."This finds git repos in your home directory (up to 5 levels deep), excluding hidden directories and system repos.
Step 2: Review and filter the list
The command will show all repositories. Identify which ones you want to register for skills syncing.
Step 3: Register each repository
For each repository you want to register:
cd /path/to/repository
claude-sync register
claude-sync runExample interactive walkthrough:
# Find all repos
$ find ~/PycharmProjects -type d -name ".git" -maxdepth 3 2>/dev/null | sed 's/\/.git$//'
/Users/you/PycharmProjects/myapp
/Users/you/PycharmProjects/another-project
/Users/you/PycharmProjects/demo
# Register the ones you want
$ cd /Users/you/PycharmProjects/myapp
$ claude-sync register
✓ Registered /Users/you/PycharmProjects/myapp
$ claude-sync run
Syncing /Users/you/PycharmProjects/myapp...
✓ Synced 83 skills (83 new, 0 updated)
$ cd /Users/you/PycharmProjects/another-project
$ claude-sync register
✓ Registered /Users/you/PycharmProjects/another-project
$ claude-sync run
Syncing /Users/you/PycharmProjects/another-project...
✓ Synced 83 skills (83 new, 0 updated)Tips:
- Skip demo/test repositories that don't need skills
- Skip system repositories (like
.nvm, plugin caches) - After registering, skills will auto-sync when you
cdinto these directories - Use
claude-sync listto see all registered repositories
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.000Z
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.000Z
Sync the current repository manually:
claude-sync runOutput:
Syncing /Users/you/projects/myapp...
✓ Synced 47 skills (2 new, 1 updated)
Sync all registered repositories at once:
claude-sync run --allGet 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-plugin
Run sync with minimal output (useful for automated hooks):
claude-sync run --quietOnly errors and warnings will be shown.
Remove the current directory from syncing:
claude-sync unregister| 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 |
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.mdPlugins 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.mdFile 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
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 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": []
}
}To exclude specific plugins from syncing, add them to excludePlugins:
{
"sources": {
"excludePlugins": ["unwanted-plugin", "another-plugin"]
}
}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 status
If not initialized, run:
git init git add . git commit -m "Initial skills"
-
Verify the repository is registered:
cd ~/projects/myapp claude-sync status
-
Try manual sync:
claude-sync run --verbose
Problem: Skills don't sync automatically when changing directories.
Solutions:
-
Verify hooks are installed:
cat ~/.zshrc | grep claude-sync
or
cat ~/.bashrc | grep claude-sync
-
Reinstall hooks:
claude-sync uninstall-hooks claude-sync install-hooks source ~/.zshrc # or ~/.bashrc
-
Check if repo is registered:
claude-sync is-registered echo $? # Should output 0 if registered
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 run
-
If 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"
Problem: Getting permission denied errors.
Solutions:
-
Check file permissions:
ls -la ~/.claude/skills -
Ensure you own the skills directory:
sudo chown -R $USER ~/.claude/skills
-
Check if files are locked or in use
Problem: Files are synced but not staged in git.
Solutions:
-
Check if repo is in detached HEAD state:
git status
If detached, checkout a branch:
git checkout main
-
Check if .claude/skills is gitignored:
cat .gitignore | grep claude -
Manually stage if needed:
git add .claude/skills
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"Problem: Plugins installed but skills aren't syncing.
Solutions:
-
Verify plugin directory structure:
ls -la ~/.claude/plugins/cache/*/skills
-
Check if plugin is excluded in config:
cat ~/.claude/sync-config.json -
Try manual sync with verbose output:
claude-sync run --verbose
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 register- 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
- DESIGN.md - Complete architecture and implementation details
- docs/CONTRIBUTING.md - Development and contribution guidelines
For issues and feature requests, please open an issue on GitHub.
MIT