keepscreenunlocked.

OpenAI Codex

Does OpenAI Codex stop when your laptop sleeps?

Short answer: it depends which Codex. Cloud tasks run in a sandbox on OpenAI's side and don't need your laptop. The Codex CLI and IDE extension run on your own machine, so system sleep pauses them.

Inactive

Pick a duration and hit start.

Duration

Stealth screen
— covers the page with black (or your own wallpaper) so it looks like nothing is open.
Fullscreen
— the same cover, edge to edge. Press Esc to leave.
Ambient sound

Starts only when you press Play. It fades out on its own, when you stop the tool, and when you enter stealth screen (unless you tick the box above).

Feedback

Two different things called Codex

Codex cloud tasks are delegated to a sandbox in OpenAI's infrastructure. You start the task, and the work continues on their side whether your laptop is open, asleep or off. You come back to review the result.

The Codex CLI and the editor extension are different: the agent runs commands and edits files on your own computer. When the machine goes to full system sleep, the process is suspended until you wake it.

SetupRuns onLaptop sleeps?
Cloud tasksOpenAI's sandboxKeep working
Codex CLIYour terminalPaused while asleep
IDE extension (local mode)Your machinePaused while asleep

Questions

Does a Codex cloud task need my laptop awake?
No. It runs in OpenAI's environment, so you can close the lid after starting it.
Does the Codex CLI stop if my laptop sleeps?
Yes. It runs locally, so full system sleep suspends it. Use your OS power settings, or caffeinate -s on a Mac, for long local runs.
What does a screen wake lock change?
It keeps the display on so you can watch a local session. It cannot stop a closed lid or full system sleep; see the screen-lock vs. system-sleep distinction.

Related: Claude Code · ChatGPT · Gemini · Perplexity · Cursor · GitHub Copilot · Grok · DeepSeek · Claude · Windsurf · Cline · All AI tools compared · Any local agent · Wake lock not working?. Last checked October 2026; these products change often, so confirm against the vendor's current docs.