claude-code-notifier
how it works guides faq
◐English
English العربية Deutsch Español Français עברית Italiano 日本語 한국어 Nederlands Polski Português (Brasil) Русский Türkçe Tiếng Việt 简体中文 繁體中文
Get started
All guides

Does Claude Code keep running when you close your laptop?

Updated 27 November 2026 · 4 min read
on this page 01Why closing the lid stops Claude Code 02Keep a laptop awake on Mac 03Keep a laptop awake on Windows 04Keep a laptop awake on Linux 05When you want it to run with the computer off 06Leaving a long task on a laptop that stays on 07FAQ

No, not by default. Claude Code runs on your computer, so when you close the lid and the laptop goes to sleep, Claude Code pauses with it and carries on only when the computer wakes. To keep a local session working, stop the computer from sleeping (keep it plugged in and use the settings or commands below for Mac, Windows or Linux). If you want work to continue with the computer completely off, use an Anthropic cloud session instead, which runs on Anthropic's servers.

01Why closing the lid stops Claude Code

The Claude Code CLI is a program on your machine. It reads your files, runs your commands and calls the model from there. A sleeping computer runs no programs, so a task in progress simply stops where it was. Nothing is lost: when the computer wakes, the session is still open and continues.

The same is true of everything that drives a local session, including Anthropic's Remote Control. Its documentation says your computer has to stay on and the claude process has to keep running. After a sleep, Remote Control reconnects on its own when the computer is back online.

02Keep a laptop awake on Mac

On macOS, caffeinate keeps the Mac awake for as long as a command runs:

caffeinate -i claude

-i stops idle sleep while Claude Code is running. To keep working with the lid closed, a MacBook also needs to be on power with an external display connected (clamshell mode); with no display attached, closing the lid still sleeps it. If you want to walk away with the lid open, set the display to turn off in System Settings > Lock Screen and leave the Mac plugged in.

03Keep a laptop awake on Windows

In Control Panel > Power Options > Choose what closing the lid does, set "When I close the lid" to Do nothing for "Plugged in". Then set sleep to Never while plugged in, under Settings > System > Power. Microsoft PowerToys also has an Awake tool that keeps the computer awake on demand.

04Keep a laptop awake on Linux

On distributions with systemd, run Claude Code under an inhibitor so the system does not sleep while it runs:

systemd-inhibit --what=idle:sleep:handle-lid-switch claude

Your desktop environment's power settings may also have a "when the lid is closed" option.

05When you want it to run with the computer off

Use a cloud session. Anthropic runs Claude Code on its own infrastructure, so it keeps going after you close your laptop and you can check on it from any device, including the Code tab in the Claude app. Start one from claude.ai/code, from the app, or from your terminal:

claude --cloud "Fix the flaky test in auth.spec.ts"

Cloud sessions clone your code from GitHub and do not have your computer's local tools, files or MCP servers. They are available on Pro, Max, Ultra and Team plans, and for some Enterprise seats. Later you can bring the work back to your terminal with claude --teleport.

06Leaving a long task on a laptop that stays on

If the work needs your machine, the routine is: keep it awake, allow the routine commands so it does not stop at every prompt, and make sure you hear when it needs you. Claude Code still waits for you at permission prompts, questions and the end of each turn.

A notification tool closes that gap. Claude Code Notifier is an independent tool (not made by Anthropic) with a free command line tool, ccn, for Mac, Windows and Linux, and apps for iPhone and Android. It sends a push when Claude finishes, needs a permission or asks a question, and you can allow, deny, answer or send the next instruction from your phone. It does not keep a computer awake, so use it with the settings above. The full routine is in Leave Claude Code running and walk away.

07FAQ

If I close my laptop, does Claude Code lose my session?

No. The session pauses while the computer sleeps and continues when it wakes. Only quitting the terminal or stopping the claude process ends it.

Can I close the lid on a MacBook and keep Claude Code running?

Only in clamshell mode, with power and an external display connected. Otherwise keep the lid open, let the display turn off, and run caffeinate -i claude.

Does Claude Code run in the cloud?

It can. Cloud sessions run on Anthropic's infrastructure and keep going with your laptop closed. A normal claude session in your terminal runs on your computer.

Does Remote Control keep running when the laptop sleeps?

No. Remote Control connects to a session on your computer, so it pauses while the computer sleeps and reconnects when it wakes.

Claude Code Notifier Get a push on your phone when Claude Code finishes or needs you, then approve, deny or answer from there. The ccn command line tool is free on Mac, Windows and Linux.
Download for iOS Download for Android Install ccn

Use OpenAI's Codex CLI? Notifier for Codex does the same for Codex.

Use Antigravity? Try Antigravity Notifier

Related guides

  • Leave Claude Code running and walk away: a workflowA practical routine for long Claude Code tasks: keep the computer awake, cut needless prompts, get pinged on your phone and reply from there.
  • Claude Code Remote Control: how it works and how to set it upHow to start Claude Code Remote Control, connect from the Claude app or a browser, turn on push notifications, and what happens when your computer sleeps.
  • Using Claude Code from your phone: what works and what does notThe real options for using Claude Code from an iPhone or Android phone: Anthropic's Remote Control and cloud sessions, SSH, and hook-based push tools.
  • How to get a notification when Claude Code finishesUse a Stop hook for "finished" and a Notification hook for "needs input". Copy-paste setups for Mac, Windows and Linux, plus phone alerts.
claude-code-notifier

Claude Code Notifier is an independent third-party application. It is not affiliated with, endorsed by, or sponsored by Anthropic, PBC. "Claude" and "Claude Code" are trademarks of Anthropic, PBC.

apps iOS App Android App ccn for macOS, Windows & Linux All guides Use Codex? Try Notifier for Codex Use Antigravity? Try Antigravity Notifier
legal Privacy Policy Terms of Service Other languages © 2026 touchtap. All rights reserved. TouchTap Ltd is registered in England and Wales, company number 13942589.