A marketplace for claude-sync plugin
npx claudepluginhub chenyii1120/claude-syncSync your Claude Code settings, plugins, and commands across machines using any git remote
Early Preview — This plugin is under active development. Features may change, and you may encounter rough edges. Bug reports and feedback are welcome via GitHub Issues.
Sync your Claude Code settings, plugins, and commands across machines using any git remote.
No extra dependencies. No server. Just one private git repo.
# 1. Add the marketplace
claude plugin marketplace add chenyii1120/claude-sync
# 2. Install the plugin
claude plugin install claude-sync
# Or install directly from source (for development)
claude plugin install /path/to/claude-sync
Troubleshooting: If
plugin installfails withPermission denied (publickey), this is a known Claude Code bug where plugin install forces SSH even for public repos. Run this once to fix:git config --global url."https://github.com/".insteadOf "git@github.com:"
First machine:
/sync-init # Create or connect a git repo
/sync-push # Push your settings
Other machines:
/sync-init <url> # Connect to the same repo
/sync-pull # Pull settings from remote
/sync-init — First-time setupTwo paths depending on your environment:
Default if
ghCLI is available and authenticated.
git (required), gh (optional)gh repo create claude-config-sync --private to create a private repo~/.claude/sync/repo/~/.claude/sync/config.jsonWorks with any git remote: GitHub, GitLab, Bitbucket, self-hosted, etc.
~/.claude/sync/repo/global/ directory exists), it skips the initial export — your remote settings are preserved, and you can pull them with /sync-pull💡 Second machine detection: When you run
/sync-initon a new machine pointing to a repo that already has data, it automatically recognizes this and offers to pull immediately — no extra steps.
/sync-push — Export & pushExports your local settings to the sync repo and pushes to remote.
📝 Reads ~/.claude/settings.json, filters out blacklisted fields (statusLine), writes to repo/global/settings.json
🔌 Reads ~/.claude/plugins/installed_plugins.json and known_marketplaces.json, transforms absolute paths → ${CLAUDE_HOME} placeholders, writes to repo/global/
🔌 Copies plugin data (CLAUDE.md, blocklist.json, data/, plugin-specific config dirs) to repo/global/plugin-data/, excluding rebuildable content (cache/, marketplaces/)
📂 Copies ~/.claude/commands/, ~/.claude/rules/, ~/.claude/agents/, ~/.claude/skills/, and ~/.claude/hooks/ to repo/user-config/
📤 Runs git add -A && git commit && git push
🔄 If push is rejected (remote has newer commits), automatically fetches, performs field-level JSON merge, then retries
/sync-pull — Fetch & applyPulls remote settings and applies them locally.
💾 Auto-backup — Snapshots your current settings, plugin configs, plugin data, commands, rules, agents, skills, and hooks to ~/.claude/sync-backups/ (max 5 retained, oldest auto-pruned)
📤 Export + commit local state — Exports current local ~/.claude/ state and commits to the repo before merging, so smart merge sees both sides for a correct 3-way merge
🔄 Fetch + merge — If merge conflicts occur, performs field-level JSON merge with remote preference
⚙️ Import settings — Merges remote settings into local settings.json. Blacklisted fields (e.g., statusLine) are preserved from local and never overwritten
🔌 Import plugin configs + plugin data — Transforms ${CLAUDE_HOME} placeholders back to local absolute paths. Imports plugin data (CLAUDE.md, blocklist.json, data/, plugin-specific dirs)
📂 Import commands / rules / agents / skills / hooks — Mirror syncs from repo to local directories. Files deleted on the source machine are also removed locally. Changes to rules/, skills/, and hooks/ are shown to the user with a confirmation prompt before applying (security measure — these may contain executable code)
🔧 Auto plugin reinstallation — Detects missing marketplace clones and plugin installations. Automatically runs:
claude plugin marketplace add for each missing marketplace sourceclaude plugin update to reinstall all missing pluginsThis ensures a pull results in a fully working setup, not just config files without actual plugin code.