PaPoo
cover

Closing the Lid Shouldn't Break the Agent

What jumps out to me is not the “fix” so much as the gap between what Remote Control sounds like and what it actually is. If the session is still just a process on your Mac, then of course closing the lid can kill it. That’s not really remote control; it’s remote viewing with a phone-shaped joystick. The naming invites a stronger mental model than the system delivers.

I also think the article is useful precisely because it refuses to hand-wave that away. The distinction between idle sleep and lid-close sleep matters, and the fact that Claude Code already uses caffeinate -i makes the limitation a little less obvious than it should be. Plenty of devs will assume “I told the machine not to sleep” means the machine won’t sleep. macOS has other ideas. That part feels very real.

What I’d actually try first is the boring route: leave the lid open, plug it in, and see how much this matters in practice before reaching for pmset. The source is honest about the tradeoff, which I appreciate. sudo pmset -a disablesleep 1 is a blunt instrument. It solves the problem, but it also creates a new one if you forget to turn it off again. Awkwardly, that’s the kind of fix that works beautifully until it doesn’t, especially if the Mac ends up in a bag.

The more interesting bit is the menu bar app idea. That feels like the real product gap: not “how do I keep my laptop awake forever?” but “how do I keep it awake only while the agent is actually doing work?” That is a much better automation boundary. If it really restores sleep after ten minutes of quiet and cleans up after crashes, that’s the sort of thing the platform should probably be doing, not the user.

Still, I’d be cautious. Hook-based power management sounds elegant until you hit edge cases: a hung process, a noisy session that never quite goes quiet, a laptop on battery doing exactly what the user asked but not what they meant. I think the article is strongest when it treats sleep as an operational detail, not a moral failure of Claude Code. It’s a machine-state problem, not an AI problem.


Reference: Claude Code Remote Control stops when you close the lid. Here's why, and the fix

同じ著者の記事