Sync your Claude Code configuration across multiple macOS machines using iCloud, with automatic dependency checking at session start.
Claude Code stores configuration in ~/.claude/, including:
CLAUDE.md- Global instructionsclaude.json- MCP server configurationssettings.json- Hooks, permissions, pluginscommands/,skills/,agents/,hooks/
When using multiple machines, you want this config synced. But some dependencies (like local MCP server builds and Playwright browsers) need to be set up on each machine individually.
- Symlink
~/.claudeto iCloud - Config syncs automatically - SessionStart hook - Warns when local dependencies are missing
- Bootstrap script - One command to set up a new machine
On your first machine, move your Claude config to iCloud:
# Move existing config to iCloud
mv ~/.claude ~/Library/Mobile\ Documents/com~apple~CloudDocs/claude-shared-config
# Create symlink
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/claude-shared-config ~/.claudeOn additional machines, just create the symlink (iCloud syncs the folder):
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/claude-shared-config ~/.claudeCopy hooks/check-deps.sh to ~/.claude/hooks/:
cp hooks/check-deps.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/check-deps.shRegister it in ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/check-deps.sh"
}
]
}
]
}
}Copy setup.sh to your MCP servers directory:
mkdir -p ~/mcp-servers
cp setup.sh ~/mcp-servers/
chmod +x ~/mcp-servers/setup.shCustomize setup.sh with your MCP servers (see comments in file).
When you set up a new machine:
# 1. Create the symlink (config syncs via iCloud)
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/claude-shared-config ~/.claude
# 2. Clone your MCP server repos to ~/mcp-servers/
# 3. Run the setup script
~/mcp-servers/setup.shThe symlink makes ~/.claude point to an iCloud folder:
~/.claude -> ~/Library/Mobile Documents/com~apple~CloudDocs/claude-shared-config
Everything in this folder syncs automatically across your Macs.
| Syncs via iCloud | Requires Local Setup |
|---|---|
| CLAUDE.md | MCP server repos (~/mcp-servers/) |
| claude.json | node_modules in each server |
| settings.json | Built artifacts (dist/) |
| hooks/, commands/, skills/ | Python venvs |
| agents/, plugins/ | Playwright browsers |
When you start a Claude Code session, check-deps.sh runs and checks:
- Playwright browsers - Required for web automation MCP
- Node.js MCP servers - Checks for clone, node_modules, and dist/
- Python MCP servers - Checks for clone and .venv/
If anything is missing, it shows a warning with the fix command:
DEPS (My-MacBook): Missing local dependencies:
- my-server not built
Fix: cd ~/mcp-servers/my-server && npm run build
Or run full setup: ~/mcp-servers/setup.sh
The check is non-blocking - you can still use Claude Code, but the warning reminds you to fix it.
Edit ~/.claude/hooks/check-deps.sh and add calls to the check functions:
# Node.js servers
check_node_server "my-server" "https://github.com/user/repo.git"
# Python servers
check_python_server "my-python-server"Edit ~/mcp-servers/setup.sh and add calls:
# Node.js servers
setup_node_server "my-server" "https://github.com/user/repo.git"
# Python servers
setup_python_server "my-python-server".
├── README.md # This file
├── setup.sh # Bootstrap script for new machines
├── hooks/
│ └── check-deps.sh # SessionStart hook for dependency checking
└── templates/
└── CLAUDE.md # Template for multi-machine CLAUDE.md section
- macOS with iCloud Drive enabled
- Claude Code installed
- Node.js and npm (for Node.js MCP servers)
- Python 3 (for Python MCP servers)
MIT