Sync Your Claude Code Global Settings Across All Your Machines
If you use Claude Code on multiple machines, you've probably recreated the same skills, agents, and settings more than once. There's a better way: version control your ~/.claude directory and sync it everywhere.
The Idea
Your ~/.claude folder contains all your global configuration—custom skills, agents, templates, and settings. By turning it into a git repository, you can push changes from any machine and pull them to all the others.
What to Track vs Ignore
Not everything should be synced. Here's the breakdown:
Track (shared across machines):
settings.json - global permissions, enabled pluginsskills/ - custom skill definitionsagents/ - custom agent definitions templates/ - reusable file templatesplugins/installed_plugins.json - which plugins you use
Ignore (machine-specific):
.credentials.json - OAuth tokens (sensitive!)settings.local.json - machine-specific permissionscache/, debug/, projects/ - temporary/local dataQuick Setup
On Your Main Machine
cd ~/.claude
git init
Create .gitignore for sensitive files
cat > .gitignore << 'EOF'
.credentials.json
.vibe9-token
settings.local.json
cache/
debug/
downloads/
file-history/
ide/
plans/
projects/
shell-snapshots/
statsig/
telemetry/
todos/
plugins/cache/
plugins/install-counts-cache.json
plugins/marketplaces/
EOF
git add .
git commit -m "Initial commit: global Claude Code settings"
git remote add origin https://github.com/YOU/claude-settings.git
git push -u origin main
On a New Machine
# Run claude once first to generate credentials
claudeExit with Ctrl+C
Backup and clone
mv ~/.claude ~/.claude-backup
git clone https://github.com/YOU/claude-settings.git ~/.claude
Restore machine-specific files
cp ~/.claude-backup/.credentials.json ~/.claude/
cp ~/.claude-backup/settings.local.json ~/.claude/ # if exists
Restart Claude Code
Daily Workflow
Sync is simple:
cd ~/.claude
git pull # Get latest from other machines
git add . && git commit -m "Update settings"
git push # Share your changes
Or create a sync script to do it all at once.
What About settings.local.json?
Use settings.local.json for machine-specific permissions that shouldn't sync—like paths that differ between Windows and Mac, or permissions you only want on certain machines.
The shared settings.json handles everything else.
Pro Tips
TL;DR: git init your ~/.claude folder, ignore credentials and cache, push/pull like any other repo. Your skills, agents, and templates will follow you everywhere.
Log in to vote