Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Sync Claude Code Config Across Macs with Syncthing

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to keep your Claude Code configuration files (settings, credentials, and custom commands) in sync across multiple Macs using Syncthing, a free, open-source, peer-to-peer file synchronization tool. You'll set up a shared folder on each Mac, point Claude Code to use it, and let Syncthing handle the rest—no cloud storage or manual copying required.

What You'll Need

  • Two or more Macs running macOS 10.15 (Catalina) or later.
  • Claude Code installed on each Mac (via npm or the native installer).
  • Syncthing installed on each Mac. You can download it from the official Syncthing website or use Homebrew (brew install syncthing).
  • Basic familiarity with the macOS Terminal and file paths.

Step-by-Step

  1. Install Syncthing on both Macs. If you used Homebrew, run brew install syncthing on each Mac. Alternatively, download the macOS .zip from the Syncthing releases page and drag the binary to your Applications folder.
  2. Start Syncthing on the first Mac. Open Terminal and run syncthing serve --gui-address=127.0.0.1:8384 (or just syncthing if you want the default GUI). The web GUI should open in your browser at http://127.0.0.1:8384.
  3. Add a folder for Claude Code config. In the Syncthing GUI, click Add Folder. Give it a label like "Claude Code Config" and set the Folder ID to something like claude-config. For the Folder Path, use ~/.claude (this is the default Claude Code config directory). Click Save.
  4. Note the device ID of the first Mac. In the Syncthing GUI, click Actions (top right) and select Show ID. Copy this long string—you'll need it to connect the second Mac.
  5. Install and start Syncthing on the second Mac. Repeat steps 1 and 2 on the second Mac.
  6. Connect the second Mac to the first. On the second Mac's Syncthing GUI, click Add Remote Device (bottom right). Paste the first Mac's device ID, give it a name like "MacBook Pro", and click Save. A notification may appear on the first Mac—accept it.
  7. Add the same folder on the second Mac. On the second Mac, click Add Folder. Use the same Folder ID (claude-config) but set the Folder Path to ~/.claude as well. When you save, Syncthing will ask if you want to use the existing folder from the first Mac—choose Replace (this will copy the config from the first Mac to the second).
  8. Verify sync. On the second Mac, check that ~/.claude now contains the same files as on the first Mac. You can also see the sync status in the Syncthing GUI (green checkmark).
  9. Test Claude Code. Run claude in a terminal on both Macs. Your settings, custom slash commands, and any API keys should be recognized.
  10. Optional: Set up automatic start. To have Syncthing launch at login, add it to your Login Items in System Settings > General > Login Items, or use a launch agent (see the Syncthing docs for a plist example).

Common Mistakes

  • Using different folder IDs. Syncthing identifies folders by their ID, not the path. If the IDs don't match, the folders won't sync.
  • Pointing to the wrong path. Claude Code stores its config in ~/.claude by default. If you've changed the location (e.g., via the CLAUDE_CONFIG_DIR environment variable), you need to sync that directory instead.
  • Forgetting to accept the remote device. Syncthing requires both devices to approve each other. If you don't accept the incoming device request, the connection won't establish.
  • Choosing "Merge" instead of "Replace" on the second Mac. If the second Mac already has an existing ~/.claude folder, merging can cause conflicts. For a clean setup, use Replace.
  • Not checking file permissions. Syncthing may create files with different permissions than expected. If Claude Code complains about permissions, run chmod -R 700 ~/.claude on both Macs.

Tips

  • Use the same folder ID across all Macs. This makes it easy to add additional Macs later—just add the folder with the same ID.
  • Exclude sensitive files if needed. If you have secrets that shouldn't leave one Mac, you can use Syncthing's ignore patterns (e.g., create a .stignore file in the folder) to exclude them.
  • Set up a local network first. Syncthing works over the internet, but for initial setup, keep both Macs on the same Wi-Fi to speed up the first sync.
  • Use versioning. In the folder settings, enable File Versioning (e.g., "Trash Can") to recover from accidental deletions or overwrites.
  • Monitor sync health. The Syncthing GUI shows the last sync time and any errors. Check it periodically, especially after changing config.

Troubleshooting

  • Syncthing can't connect between Macs. Check that both Macs are on the same network (or that port 22000 is open in your firewall). In the GUI, click Actions > Advanced > Connections to see if the devices are connected.
  • Folder shows "Unconnected" or "Not Syncing". Make sure the folder ID matches on both devices and that both devices are connected. If the folder was added before the devices connected, try removing and re-adding it.
  • Claude Code doesn't see the synced config. Verify that the environment variable CLAUDE_CONFIG_DIR is not set to a different path. Also, check that the ~/.claude directory exists and contains the expected files.
  • Sync conflicts (files with "sync-conflict" in the name). This happens when a file is edited on both Macs simultaneously. Resolve by keeping the correct version and deleting the conflict copy.
  • Syncthing GUI won't open. If you started Syncthing manually, the GUI should be at http://127.0.0.1:8384. If not, check the terminal output for errors or try a different port.

Frequently Asked Questions

Is it safe to sync my Claude Code credentials with Syncthing?

Syncthing encrypts traffic between devices using TLS. However, your API keys are stored in plain text in the config files. Only sync over trusted networks, and consider using a separate, more secure vault for secrets if you're concerned.

Can I sync only part of the Claude Code config?

Yes. Instead of syncing the entire ~/.claude folder, you can create a subfolder (e.g., ~/.claude/settings) and sync that. You'd need to adjust Claude Code's config directory accordingly, though it's simpler to sync the whole folder.

Will this work with multiple Macs simultaneously?

Yes, Syncthing supports multi-device sync. Add each Mac as a remote device and share the same folder. All devices will stay in sync.

What if I change config on one Mac while the other is offline?

Syncthing will queue the changes and sync them when the other Mac comes online. There's no conflict as long as you don't edit the same file on both Macs before they sync.

Can I use iCloud Drive or Dropbox instead?

Yes, but Syncthing is peer-to-peer and doesn't store your data on a third-party server. It also handles conflicts better and works even if you don't have internet (on a local network).

How do I remove a Mac from the sync?

In Syncthing, go to the remote device and click Remove. The folder will stop syncing to that Mac, but existing files remain.