# How to keep your Mac or PC awake while Claude Code or Codex works

> While Allow Remote Access is on, HB Code keeps your Mac or Windows PC from going to sleep when idle. A long Claude Code run keeps going.

Turn on Allow Remote Access in HB Code. While it's on, HB Code asks the system not to go to sleep when the computer is idle, so a long run keeps going. A closed laptop lid still wins, though.

HB Code is a desktop app for Mac and Windows. It runs Claude Code and Codex on your own computer with your own Claude and ChatGPT plans.

Updated November 20, 2026

## Steps

1. On the desktop, open Settings › Connections.
2. Under Mobile Connection, turn on Allow Remote Access. If the app asks, choose your server region and sign in with your HB Code account.
3. Leave HB Code open. Start the run.
4. Keep a laptop open and on power. A closed lid can still put it to sleep, and HB Code doesn't override that.
5. Follow the run from the iPhone or Android app. Send the next message from there.

## Notes

- HB Code blocks idle sleep only while Allow Remote Access is on. Turn it off, and the computer sleeps as usual.
- The block doesn't need a connected phone. The switch alone is enough.
- The screen can still turn off. The agents keep running.
- On a Mac, it's the same kind of block that caffeinate -i makes.
- A phone needs a working network on both sides. The phone app connects again by itself after a network change.

## Questions

### Does HB Code keep a MacBook awake with the lid closed?

No. It blocks idle sleep only and doesn't override the sleep of a closed lid. Keep the lid open.

### Does the agent stop when the screen turns off?

No. The agent runs on while the computer is awake.

### Do I need the phone app for this?

No. You need the Allow Remote Access switch, and that needs an HB Code account. The phone app is optional.

### Does it work on Windows?

Yes. On Windows, HB Code asks the system to stay awake in the same way.

## Details in the handbook

- [Remote access and the device list](https://www.hbcode.ai/docs/setup.md#remote-access): Setup: sign-ins, regions, and remote access
- [The connected preview and HB Code Pro](https://www.hbcode.ai/docs/setup.md#preview): Setup: sign-ins, regions, and remote access

## Guides

- [How to check usage limits and use more than one account](https://www.hbcode.ai/claude-code-usage-limits.md)
- [How to check what Claude Code or Codex did](https://www.hbcode.ai/claude-code-ui.md)
- [How to run several Claude Code and Codex sessions](https://www.hbcode.ai/claude-code-sessions.md)
- [How to use Claude Code or Codex on your phone](https://www.hbcode.ai/claude-code-mobile.md)
- [How to see what the subagents of Claude Code do](https://www.hbcode.ai/claude-code-subagents.md)
- [How to try Claude Code and Codex on the same task](https://www.hbcode.ai/claude-code-vs-codex.md)
- [How to run Codex in a desktop app on Mac and Windows](https://www.hbcode.ai/codex-desktop-app.md)
- [How to switch Claude Code and Codex accounts without logging out](https://www.hbcode.ai/switch-claude-code-codex-accounts.md)
- [How to let Claude Code write and Codex review the change](https://www.hbcode.ai/claude-code-codex-review.md)
- [How to use Claude Code and Codex on Windows](https://www.hbcode.ai/claude-code-windows.md)
- [How to use Claude Code and Codex from an Android phone](https://www.hbcode.ai/claude-code-android.md)
- [How to run Claude Code in a desktop app on Mac and Windows](https://www.hbcode.ai/claude-code-desktop-app.md)
- [How to get a phone alert when Claude Code or Codex needs you](https://www.hbcode.ai/claude-code-notifications.md)
- [How to continue a Claude Code terminal session on your phone](https://www.hbcode.ai/claude-code-resume-session.md)
- [How to monitor your Claude Code and Codex usage over time](https://www.hbcode.ai/claude-code-usage-monitor.md)
- [Download HB Code](https://www.hbcode.ai/downloads)
