DEV Community

Snow Lee
Snow Lee

Posted on

How to sync Claude Code across multiple machines

How to sync Claude Code across multiple machines

If you use Claude Code on more than one machine, you know the drift: the CLAUDE.md you refined on your desktop isn't on your laptop, skills live in one place, session notes in another, and the agent on machine B happily works from stale context.

Git doesn't fix this well. Your agent's working context — notes, plans, skills, scratch files — changes constantly, mid-session, on whatever machine you're on. Committing "update notes" forty times a day isn't a workflow, and half these files don't belong in your repo anyway.

We built BearDrive for exactly this (it's open source, AGPL — repo). Here's the setup, end to end, in about two minutes.

1. Install and sign in (once per machine)

brew install runbear-io/tap/beardrive
bdrive login            # BearDrive Cloud, or: bdrive login https://your-hub
Enter fullscreen mode Exit fullscreen mode

login opens a browser sign-in and stores a per-device token. Self-hosting? A hub is one command (bdrive web s3://bucket/root --upload) — separate post coming.

2. Start syncing a folder

cd ~/agent-workspace
bdrive init
Enter fullscreen mode Exit fullscreen mode

That's it — the folder now syncs through your hub via a background daemon. Files stay real files on disk, so every editor, tool, and agent works on them unchanged. Inside a repo, sync just the knowledge folder instead of the root: bdrive init --shared docs.

On your other machine:

bdrive login
cd ~/agent-workspace && bdrive init --name agent-workspace
Enter fullscreen mode Exit fullscreen mode

Same project name + same hub = the folders converge.

3. The part that makes it agent-native

bdrive hooks install
Enter fullscreen mode Exit fullscreen mode

This detects the agent platforms you use — Claude Code, Codex, Gemini CLI, Hermes — and registers turn-boundary sync hooks in each one's own config: pull the latest files when your prompt is submitted, push right after the agent edits. Your agent starts every turn on current files, on every machine, and every change it makes is stamped with the session that made it:

$ bdrive log -p notes/plan.md
2026-07-28 09:14  put  notes/plan.md  snow on macbook  [claude-code session a1b2…]
Enter fullscreen mode Exit fullscreen mode

4. Verify

bdrive status    # daemon running, pending: 0 → you're synced
Enter fullscreen mode Exit fullscreen mode

What you get beyond sync

Per-file change history with who/when/which device, conflict copies instead of silent overwrites, offline support, share links for teammates, and a read heatmap showing which files your agents actually use versus what's going stale.

If Claude Code across machines has been biting you, try it and tell us what breaks: github.com/runbear-io/beardrive.

Top comments (0)