Skip to main content
NOV 2026 Latest guide updates. Latest: AI Design Patterns Local vs cloud AI Grill me Changelog →
T10 Intermediate Technical

Multi-Machine Config & Backup

Syncing your Claude Code configuration across multiple machines

PDF editions Β· Guide v3.44.1 Β· Updated

What stays local vs what is shareable

Local onlyShareable
settings.local.jsonagents/, skills/
API keys, tokenshooks/, rules/
Session historysettings.template.json
.env with secretsCLAUDE.md (team conventions)

Golden rule: never commit API keys or credentials. Use template files with ${VAR_NAME} placeholders for sensitive values.

Version reviewed configuration files

Keep actual files in a configuration repository. A symlink from the repository to ~/.claude stores only the link target in Git, not the referenced contents.

Terminal window
# Create a new private configuration repository
mkdir ~/claude-config-backup
cd ~/claude-config-backup
git init
# Copy only directories that exist and have been reviewed
cp -R ~/.claude/agents ./agents
cp -R ~/.claude/skills ./skills
cp -R ~/.claude/hooks ./hooks
# Inspect copies for secrets and machine-specific paths before staging
git add agents skills hooks
git diff --cached
# Commit and push only after reviewing the staged content

Create a sanitized settings template separately. On another machine, clone the repository and compare files with the current configuration before copying them into place. Back up existing files and review hooks before enabling them.

settings.local.json for machine-specific overrides

Each machine can have its own preferences without touching the shared configuration. This file takes precedence over settings.json and is never committed.

{
"permissions": {
"allow": ["Bash(brew *)", "Bash(docker *)"]
},
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:8080"
}
}

Cloud backup scope

Back up reviewed configuration templates rather than the entire ~/.claude directory, which also contains transcripts and potentially credentials. Choose access and retention settings for the actual data.

Automatic backup with cron

Create the backup directory first and protect it appropriately. This cron entry archives the reviewed repository; cron requires the percent sign in date to be escaped.

0 2 * * * tar -czf "$HOME/claude-backups/config-$(date +\%F).tar.gz" -C "$HOME" claude-config-backup

Enter your email to read the full card and get the complete PDF bundle.

All content is free and open-source. We just ask for your email.

PDF: