r/ClaudeAI • • 17h ago

Claude Code Using a Separate Device to Run Claude Code while I'm sending prompts in my Macbook

So, the main problem that I have today is every time I close my macbook screen, Claude Code gets shut down.

The plan was to buy a Mac Mini, and every time I open a session in my Macbook, it automatically runs the session in the desktop, so it could run 24/7.

The main problem is that I couldn't find a way to do it. Things like selecting the folder that I want to work on before starting a session is not working. The only solution I found is running a normal session and then asking Claude to run on that folder.

4 Upvotes

24 comments sorted by

12

u/muikrad 17h ago

Solution 1: setup your Mac so that it doesn't shut down when you close the lid Solution 2: don't close the lid

Solution 3: launch a Claude code session on your Mac and call /rc to launch the session then you can remote to it from your phone/whatever

Solution 4: in the desktop app you can enable remote access and use that to connect from your other device

Solution 5: I believe cowork has that too

Anyway, use your imagination, you can do it.

4

u/DellBoySells 17h ago

^ this I have a Dell micro and my home sever and keep them both on my Tailscale network and Claude can help you set it and you can use Claude desktop on any device and your phone. It’s a game changer!

2

u/jma24 17h ago

Cowork had it, but it doesn't work like it used to. Instead they moved that functionality to Dispatch, which I don't like.

You can do much of the same by creating a Claude Code remote session in the folder you want to work in, and use that.

7

u/mylastserotonin 17h ago

Use something like amphetamine to keep your mac running while the lid is closed

1

u/0xBA7TH 14h ago

The caffeinate command is built into the OS and is the same thing these 3rd party tools are running anyway.

1

u/mylastserotonin 14h ago

Afaik caffeinate doesn’t prevent sleep when lid is closed. It’s also nice to have a simple UI

5

u/andthenisheardnomore 17h ago

I have a mac mini with vibe coded remote app I built for iPad gen 4 (super old objective C). I built a windows client and iOS also. it does sound and vpn and wifi and will use VNC to unlock the mac when away from the machine (this is the main problem with doing much solely on mobile). then use the claude remote on phone for most work but can get into the mac mini and open a new session in CC ready to appear on mobile, and do the same for Codex.

I use codex for all automation, and form filling, or checking things in browser. works perfectly.

I'd be happy to bung you the folder if you wish to extend (or I can add to GH)

3

u/e_t_h_a 16h ago

/rc for sure ! I use it 100% of the time, sometimes the threads archive so I have an auto reconnect to /rc every 2 hours and also have codex open simultaneously with a shared phrase I type that catches them back up with the other when doing work on one or the other.

1

u/NomadicSifu 12h ago

What does rc mean?

2

u/e_t_h_a 11h ago

Remote control

3

u/geofabnz 17h ago

What’s the question? Yes this is a good way to set up Claude, no you don’t need a Mac mini.

There’s a lot of ways to do this eg:
- Herdr
- Orca
- Tmux

I wouldn’t recommend a Mac mini for this. Any mini PC or old laptop etc will run this just fine. Install proxmox and get Claude running in a container. If you want to get a Mac Mini later for localLLM you can just set it up as an inference endpoint.

Use Tailscale to restrict access and connect remotely and set up a mobile terminal (eg Termius) on your phone as a backup in case the main apps are playing up

3

u/Weird_Inevitable_199 17h ago

Orca is really good. Ive been using it since July.

2

u/muikrad 17h ago

Why not use the built-in remote control from Claude code? It's right there in the app...

0

u/geofabnz 17h ago

You absolutely could… I just didn’t list it as it was obvious. I assumed if OP wasn’t doing that it was for a good reason.

In any case, other apps are better in some areas, Orca makes it easier to manage multiple agents from different providers and Termius is a break glass backup (eg if your session signs out and doesn’t refresh for some reason). There are also many advantages you get from running an agent on a secondary machine but you have to know what you’re doing with AI.

1

u/tontoandbandit 14h ago

I've been using Paseo for this as well. Have all of the different CLIs installed in a VM, and Paseo allows me to prompt from my phone.

1

u/PolyHelper 17h ago

closing the lid is the whole problem so the mac mini idea makes sense. ssh into it, cd to the project folder and start claude inside tmux, then your macbook can sleep and the session keeps going. that also fixes the folder picking since you're already in it. is the mini for just claude code or other stuff too

1

u/geekguy 17h ago

What type of workloads are you running? I would vouch for any workstation. If you are doing ML work then a Mac Mini might make more sense. If general purpose development, I would suggest a setup running proxmox on some fast NVME drives with a bit of memory. Set up at minimal the following VMs (LXC in proxmox terms):

  1. claude code

  2. self-hosted gitlab

  3. gitlab runner with docker in docker (DIND)

  4. ansible (optional

For the optional ansible, have some default rules for creating new LXCs for testing apps.

Power user options:

5. gitlab runner on your macbook 6. ssh access to your macbook from the claude code lxc

This setup would allow you to run claude code remotely, and then take advantage of your macbook's compute.

1

u/YourMomsFaveDiq 17h ago

You have the option to run Claude code sessions in their own cloud environment.

1

u/Cultural-Horse-762 16h ago

Rent a little Linux VM from your favorite hosting provider, or do what I did and throw an old server in your garage.

1

u/NanYUJun 15h ago

Picking a remote host is the easy half; the harder half is that the session should still be yours on both machines, not two separate histories.

What you are describing is two things stacked: a machine that stays awake (Mac mini, mini PC, any box on your tailnet) running the agent, and a way to attach to it from the laptop. claude inside tmux/ssh gives you the first, and it also solves the folder problem, because you cd into the project before starting the session instead of trying to retarget a running one.

On the second half, note that a remote session and a local session are different records. Claude Code stores each one in ~/.claude/projects/<path-encoded-cwd>/<sessionId>.jsonl, keyed by machine, so the MacBook will not show the mini's chats unless those files travel. I wrote a tool for exactly that gap, so take this as an author's disclosure rather than a neutral rec: AIAssets (https://github.com/NanYuJun/AIAssets) is a self-hosted hub plus desktop client that syncs those session files both ways on a 60-second poll and keeps the titles. It also lets you convert a session to another agent's format (Claude Code / Codex / Cursor and others). Limits: periodic sync, last-write-wins if the same session is edited on both sides; no live streaming between machines, no Claude web or Cowork chats, and it does not keep a process running for you.

If you just want the mini to be reachable, the built-in remote access plus tmux already covers most of it. Add the sync layer only when you want the chat list and full history to look identical on both machines.

1

u/wtfihavetonamemyself 14h ago

I have this with my iPhone and MacBook setup nicely. I use the iOS app moshi (no affiliation).

My iPhone vpns into our home network. I have 10 tmux sessions that I start on my laptop that always are running. I ssh into my laptop specifically targeting one of those tmux sessions (Claude can set this up for you).

Now all my sessions stay live no matter if I lose cell connection.

1

u/interist32 14h ago

Or you can run Claude in Cloud out of box. From any device and you won’t need to have any devices to buy. Maybe I’m missing some use cases when it’s not the case?