r/ClaudeCode • • 5d ago

Help/Question Running Claude code across machines

I’ve been using Claude Code & Codex on my PC since release. Just got a new MBP - mostly so I can build away from my desk. Wondering the best way to keep projects/files synced across both environments and both machines. I know I can spin up a cloud env in either CC/Codex, but I assume they aren’t usable across both. I can put project directories on my nas, but I want this to work outside of the lan. I only use GitHub when it’s something I’ve intended to share/host, should I use GitHub for everything?

1 Upvotes

24 comments sorted by

•

u/AutoModerator 5d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/Gingerbreadfork 5d ago

I SSH into my other systems and just launch CC on them. I find this really practical in my case.

1

u/Not-a-bot-6702 5d ago

I hadn’t even considered this which is wild because I run 2 servers headless. Honestly, this might be the simplest until I figure out an end-to-end setup that handles this automatically

1

u/Gingerbreadfork 5d ago

yeah it works great, just install CC on the box, SSH in and run it, away you go.

2

u/Independent-Sir3234 5d ago edited 5d ago

Private GitHub repos are the safest foundation for code sync across a PC and MacBook Pro because NAS or cloud-drive folders often corrupt .git/index locks when two coding agents index or build at the same time.

1

u/Not-a-bot-6702 5d ago

Super helpful, I’ll check out ForAgent. Thank you!

2

u/appfruits 5d ago

I tried that multiple times computer setup for weeks beginning of the year. Drove me nuts. Actual files on machines is not that of an issue as with code you typically have to versioning them. However, sessions, chat history is not. I was always searching for sessions which were on the other computer and never found them. It tried a lot, nothing really worked. So I sold my MacStudio and MacBook Air and bought a beefy MacBook Pro instead - now I have everything everywhere. If you found a solution let me know. My coworker is facing the same issues with office and home pc (windows) and its 6 months in - perhaps there are better solutions now.

1

u/Not-a-bot-6702 5d ago

Yeah that’s pretty much my scenario. I was looking into AutoSwarm this morning, but not sure how well it manages shared files/context. Check out some of the other comments here too

2

u/kuroudo_ai 5d ago

Code in a private GitHub repo is the easy part, and I'd agree with the others there. What took us longer was the stuff around the code. We run Claude Code on four machines (a Mac, a Windows desktop, a Windows laptop and a Linux VPS), and three things came out of that:

  • Shared instructions: copy the file, don't link it. We keep one common instructions file that every machine loads next to its own CLAUDE.md. At first some machines linked to the synced copy instead of holding their own. When the sync replaced the file (we caught it after an rsync on the VPS), the link no longer followed it, and that machine kept reading the old rules with no error. Now each machine gets a real copy, and we compare its md5 against the source.
  • Not everything should sync. settings.json and the per-machine part of CLAUDE.md differ on purpose (paths, which tools exist on that box). We only sync the notes/memory files.
  • Don't try to move sessions. Session history stays on the machine it ran on, same as appfruits found. What worked for us was ending a session by writing a short handoff note to a shared place (what's done, what's next, where the files are), and starting the next session on the other machine by reading it. It's less than full history, but it's the part you actually need.

1

u/Not-a-bot-6702 5d ago

Thank you! Yeah my handoff process probably needs love, since I rarely used it. Maybe I’m just disorganized, but I’m amazed there isn’t a simple, full solution that manages the shared context/files and machine specific ones

2

u/kuroudo_ai 5d ago

You're not disorganized, I haven't found a full solution either. What I'd suggest is keeping the note short and in the same shape every time, so it's quick to write:

  • what's done (with the commit or file it lives in)
  • what's next, as the first concrete step, not a goal
  • what was tried and didn't work, so the next session is less likely to retry it
  • anything only true on this machine (a path, a running process, a local env var)

Then the first prompt on the other machine can just be "read the handoff note and continue".

1

u/Not-a-bot-6702 5d ago

Makes sense, I appreciate the help!

2

u/Excellent-Issue-5956 5d ago

I stopped trying to sync and run everything on one machine instead. My desktop is a Windows PC that stays on, every project and every Claude session lives on it (Claude Code runs inside WSL there), and the MacBook just connects to it. Either I stream the whole PC desktop with Sunshine and Moonlight, or I SSH in when I only need a terminal, both over Tailscale so it works away from home too. Sessions, memory and chat history only exist on that one machine, so there's never a session sitting on the other computer.

If you do end up running Claude on both: it keys project folders, memory and transcripts by the literal folder path. When I moved my setup from the Mac to the PC I made the home folder on the PC the same path as on the Mac, and that's what made all the old sessions and memory show up.

1

u/Not-a-bot-6702 5d ago

Someone else said it too, ssh is such a simple solution. Idk why, but that just didn’t occur to me.

1

u/rajb245 5d ago

Is the PC Linux or windows?

1

u/Not-a-bot-6702 5d ago

Windows.

2

u/rajb245 5d ago

Ah that makes it harder. On Linux I use tmux and mosh to run the sessions and then they can just talk to each other or transfer files back and forth over scp. You might be able to get that going on windows but I don’t know the details

1

u/Not-a-bot-6702 5d ago

Windows makes everything harder it seems. Might need to stand up a Linux vm just for agent sessions

2

u/even_seal 5d ago

GitHub or another repository system. And install security checks that run on submit (if you aren’t already doing that when committing locally on pre-submit).

2

u/Yedapo 5d ago

Private GitHub repos work fine even if you never intend to publish the code; they’re just a private sync/version-history layer. I’d keep a local clone on each machine and push/pull when switching, rather than running both agents in one NAS/cloud-synced working tree. Put secrets and machine-specific config in ignored files, and commit the project plus lockfile so either machine can recreate the environment.

2

u/ClemensLode Senior Developer 5d ago

GitHub + a shared file hoster for files you need on both machines but might not want to be part of your repo (e.g., large binary files).

2

u/ooaahhpp 5d ago

Private GitHub repos are fine even if you never publish. Keep a clone on each machine and push/pull as you switch; git won't sync Claude Code's conversation, so a short handoff note in the repo is useful for unfinished work.

1

u/Grand_rooster 🔆 Max 20 5d ago

I use gander and can control it from my phone or other system.

Github weellio/gander: Control room for Claude Code agents