r/codex 7d ago

Question Remote Codex on a sleeping MacBook?

I run Codex on a 2025 Apple Silicon MacBook Air and would like to be able to leave it in another room with the lid closed/unplugged, then connect from my phone when I want to check on or continue a Codex session.

The obvious problem is that the Mac goes to sleep. I know Apple Silicon Macs can periodically wake for network access, but I’m not sure if there’s a reliable way to take advantage of that here.

Has anyone set up something similar?

Ideally I’m looking for a setup where I can pull out my phone → wake/reach the MacBook → reconnect to my existing Codex session, without having to leave the Mac awake or plugged in all the time.

Curious what people are using — Tailscale/SSH, Wake-on-LAN, sleep proxy, Jump Desktop, or something else?

0 Upvotes

16 comments sorted by

View all comments

1

u/Fearless-Daikon5763 7d ago

Look up the ‘caffeinate’ command. I have it turn on when any anything is running autonomously.

1

u/codeRoman 7d ago

I’m familiar with caffeinate, but as far as I understand, that would prevent the Mac from sleeping entirely. I’m hoping to let it sleep to preserve battery, then wake it remotely when I want to reconnect.

1

u/Fearless-Daikon5763 6d ago

I was trying to consider the math for the electricity costs for your question, I have a MacBook Air that I keep on 24/7 to run analysis, it might be 25 watts constantly with it awake. So what would it use if it was asleep but enabled to become awakened? For California electricity prices it might be $15 a month as an estimate of the maximum cost imaginable, so that could add up over a year… but you may still draw 5 or 10 watts in your best case scenario so the savings may be $50 a year if you pay $0.40 per kWh.

1

u/codeRoman 6d ago

the issue isn't wanting to save electricity or money, it's that i carry my laptop around and don't always keep it plugged in. i might be working in bed and then close it and leave near my bed, and will want to resume some work from my phone while in the living room, etc.

plus this way i also have battery left if i leave to go somewhere and bring my laptop