Sync Your Claude Code Global Settings Across All Your Machines

by mobes January 21, 2026 4 views

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 plugins

skills/ - custom skill definitions

agents/ - custom agent definitions

templates/ - reusable file templates

plugins/installed_plugins.json - which plugins you use


Ignore (machine-specific):

.credentials.json - OAuth tokens (sensitive!)

settings.local.json - machine-specific permissions

cache/, debug/, projects/ - temporary/local data

Quick 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
claude

Exit 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

1.Add a pre-commit hook to validate JSON files before committing

2.Use shell aliases to auto-pull before starting Claude

3.Don't forget to restart Claude Code after pulling changes—skills and agents are loaded at startup



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.

0

Log in to vote

No comments yet. Be the first to share your thoughts!

Log in to participate