ScreenAwake Logo ScreenAwake

Keep AI Running While Your Screen Is Locked

Published 2026-04-19 • 6 min read

For a couple of years, working independently meant total control over your environment. You'd fire up Claude Code on a complex refactor, step away to grab lunch, and come back to find the work done. No one walking past your screen. No reason to lock anything.

Then you went back to a company.

Open floor plan, colleagues nearby, the occasional manager passing through. The habits that made you productive as an indie developer suddenly created friction. You still use AI agents — Claude Code in the terminal, Codex for implementing features, various tools that handle the tedious parts of the job. But now, every time you step away — to refill your water, grab food, use the restroom — you're stuck choosing between two bad options: leave your code visible to whoever walks by, or lock your screen and risk interrupting your AI session.

Neither feels right. And it turns out, neither is necessary.

The Misunderstanding: Lock Screen Is Not Sleep Mode

Most people treat "locking the screen" and "putting the computer to sleep" as the same thing. They're not.

When you press Win + L on Windows or Cmd + Ctrl + Q on Mac, your display goes dark and your session requires a password to access. But your operating system keeps running. Background processes, terminal sessions, locally running scripts — they all continue without interruption.

The actual problem is what happens next. If your power settings are configured to sleep after a few minutes of inactivity, walking away from a locked screen triggers sleep mode. The system suspends everything. Your AI agent stops. When you return, you're not picking up where you left off — you're starting over.

So the issue was never the lock screen. It was the sleep that followed.

The Solution: Block Sleep, Then Lock Freely

Fix the sleep problem, and locking your screen becomes harmless. ScreenAwake handles exactly this — and it offers two approaches depending on how much privacy you need.

Using the ScreenAwake Web Tool

The web version uses the browser's Screen Wake Lock API to prevent your display from automatically dimming and sleeping. Open it in a tab, set your duration, and activate it. Your computer won't enter sleep mode while it's running.

The limitation: the web tool requires the screen to remain active. You can't manually lock your screen while using it — doing so would interrupt the wake lock. What you can do before stepping away is dim your monitor brightness to its lowest setting. The screen stays technically on, the wake lock stays active, your AI session keeps running — but there's nothing visible to passersby.

This is a reasonable option for brief, low-stakes departures: a quick walk down the hall, a short phone call.

Using the ScreenAwake Browser Extension

For real office privacy, the ScreenAwake Browser Extension is the right tool.

The extension runs in the background without requiring an open browser tab. It keeps your system awake at the OS level — meaning your computer doesn't sleep even when no visible activity is happening. Once it's active:

  • Press Win + L or Cmd + Ctrl + Q to lock your screen normally
  • Your display goes dark, your session is password-protected
  • Claude Code, Codex, terminal scripts, anything running locally — all continue
  • Return when you're ready, enter your password, and find everything exactly where you left it

The lock screen protects what people can see. The extension protects what keeps running behind it.

Before locking, drop your monitor brightness to its lowest setting. Your system will draw significantly less power with a near-dark display, and everything behind it keeps working.

A Practical Workflow for Office Use

Here's what this looks like in practice:

  1. Start your AI task — kick off a Claude Code session or whatever you're running locally
  2. Activate the ScreenAwake extension from your browser toolbar
  3. Set a timer based on how long you'll be away — lunch usually runs about an hour, so set 90 minutes as a buffer
  4. Lower your screen brightness to the minimum before you leave
  5. Lock your screenWin + L on Windows, Cmd + Ctrl + Q on Mac
  6. Step away — lunch, coffee, restroom, a short walk
  7. Return, enter your password — your AI session is still running

Privacy maintained. Work uninterrupted. The office environment handled without changing your workflow.

Which AI Tools Work with This Approach

Not every AI tool behaves the same way when your screen is locked. The key distinction is whether the tool runs locally or depends on a browser tab staying visible.

Works well (local, system-level processes):

  • Claude Code running in a terminal
  • Codex running locally via CLI
  • Local scripts, build processes, data pipelines
  • Any process running in a terminal or IDE that doesn't require browser focus

Requires extra consideration (browser-based):

  • Web-based AI agents that run inside a browser tab may pause when the tab loses visibility. For these, check out the guidance in our article on keeping your screen awake for AI agents — the web tool with a visible screen may be the better fit.

The extension approach works best for local AI workloads — the kind where the computation happens on your machine rather than inside a browser.

Why Not Just Change Your Power Settings?

Adjusting your system's sleep settings to "Never" would also solve the problem. But there are a few reasons this doesn't work well in practice for most office setups.

It applies all the time. Power settings don't know the difference between "AI running in background" and "laptop sitting idle overnight." You end up with a computer that never sleeps, draining battery and running warmer than needed whenever you forget to change it back.

Company machines often lock this down. On IT-managed devices, power settings may be restricted. You might not be able to change them at all without administrator access.

ScreenAwake is task-specific. Activate it when you're about to step away with something running, let the timer expire automatically when you're back. Your normal power behavior remains intact for everything else.

Coming Back to Office Work Without Leaving Your Workflow Behind

Returning to a company after working independently doesn't mean giving up the async, AI-assisted approach that made solo development productive. The tools that worked when you were on your own still work. They just need to fit into a different physical environment.

Locking your screen for privacy is a reasonable workplace habit. Running AI agents through long, unattended tasks is a reasonable productivity habit. They're not in conflict — you just need to address the right problem.

The ScreenAwake extension keeps your system running. The lock screen keeps your work private. Between them, you get the office behavior that's expected without interrupting the workflow you've built.

Install the ScreenAwake extension — and keep your AI running through lunch, through the restroom break, through whatever pulls you away from your desk.