Will GitHub Copilot in VS Code keep running if you close your laptop?

By Matyas Rathonyi. Published November 23, 2026. Guides

No, it stops if the session runs locally on your Mac. Closing a MacBook without an external monitor puts macOS to sleep, suspending VS Code's local Agent Host so a running Copilot turn stalls until the laptop wakes; only a Copilot cloud session or a separate remote host keeps running on its own. Clamshell for Mac keeps an Apple Silicon MacBook awake with the lid closed on power or battery so local Copilot runs can finish, with no admin password, no sudo and nothing to undo, for $9.99 once after a 7-day free trial.

Written by Matyas Rathonyi, the maker of Clamshell for Mac.

Two closed MacBooks with a local Copilot session. With nothing set up, the Mac sleeps and the turn stalls until it wakes. With the Mac kept awake, the turn can finish. z Nothing set up turn stalls Mac kept awake turn can finish
A local turn needs the Mac awake. A VS Code maintainer writes that a running turn "stalls partway until the machine wakes." Apple's desk setup, a Terminal override or a lid-closed app keeps the Mac out of sleep.

Which Copilot session stops when you close your laptop

This guide covers Macs. Whether closing your laptop stops GitHub Copilot depends on where the session runs, not on whether the VS Code editor window stays open:

The free fixes, and where they stop

Every built-in VS Code feature and free macOS shortcut hits a wall when you close your laptop without a monitor:

Why pay $9.99 once for Clamshell? You keep local VS Code sessions running with your laptop closed on power or battery, with no admin passwords, no sudoers files, no privileged helpers and nothing to undo.

Keep local Copilot sessions running on a closed MacBook with Clamshell

When your task relies on uncommitted files, local dependencies or local tooling and you want to close your laptop without breaking the run, Clamshell keeps macOS awake:

Test Clamshell on your next local Copilot run before paying anything: Download free trial (7-day free trial, no card required; $9.99 once for 1 Mac or $19.99 for up to 3 Macs, with a 14-day money-back guarantee).

When a cloud session or another option is the better pick

Frequently asked questions

Will VS Code itself keep running if I close my laptop?

Not while your Mac sleeps. Apple documents closing the display as a way to sleep a Mac laptop, and a VS Code maintainer notes that sleep suspends the local Agent Host "with everything else", pausing agent turns until wake. Keep the Mac awake with Apple's external-monitor setup or a lid-closed app like Clamshell.

Does sessions.keepAwakeWhileWorking keep Copilot running with the lid closed?

No. VS Code's own test plan (microsoft/vscode#349545) states that sessions.keepAwakeWhileWorking prevents "idle system sleep, not the screen turning off, closing the lid, or explicitly choosing Sleep" (and as of November 23, 2026 it is still in VS Code 1.148 Insiders, not stable 1.147.0). To close your laptop during a local run, you still need a lid-closed solution like Clamshell.

Does closing the VS Code editor window stop Copilot?

With the default Copilot harness (Agent Host), closing the editor window lets the session continue in the background as long as you do not quit VS Code and your Mac stays awake. With the deprecated Local harness, closing the editor window stops the agent's ongoing work.

Will Copilot keep running if I lock my Mac?

Yes, while the lid stays open: locking the screen does not put the Mac to sleep, and a VS Code maintainer says the Copilot extension "prevents the system from going to sleep while the agent is processing." Closing the lid is what stops the run, so arm Clamshell first if you also close the lid.

Do VS Code "no sleep" extensions keep a closed MacBook awake?

Not by their own listings. Sleepwalker's Visual Studio Marketplace listing states "macOS is not supported yet", and NoSleep states it "simulates pressing the F15 key" with no closed-lid claim. Use a macOS lid-closed app such as Clamshell instead.

Try Clamshell free for 7 days

Close your MacBook and let local Copilot sessions in VS Code finish, with no admin password, an always-on heat cut-off and a 20% battery floor. Normal lid sleep returns when you disarm or quit.

Download free trial $9.99 once, no subscription

$9.99 for 1 Mac, $19.99 for up to 3 Macs. 7-day free trial with no card required and a 14-day money-back guarantee. Apple Silicon, macOS 14 or later, notarized by Apple. Also available via Homebrew or Setapp.

Sources checked November 23, 2026: GitHub changelog posts (October 28 and November 16, 2026), GitHub Copilot cloud documentation, VS Code documentation (agent harnesses, Agent Host, Agents window, remote agent sessions, Remote Tunnels, cloud continuity), VS Code source and issues #276546, #348891 and #349545, PRs #348889 and #349491, release 1.147.0 and 1.148 Insiders notes, Visual Studio Marketplace listings for Sleepwalker and NoSleep, Apple's Mac User Guide, Apple Support article 102501, the macOS 27.2.1 caffeinate(8) manual, and vendor pages for Amphetamine and Keepresso. Clamshell details come from version 2.0.5. Product names belong to their respective owners.