macOS 14+ · Apple Silicon · Native Swift 6

Close the lid.
Your agents keep shipping.

LidKeep keeps Claude Code, Codex CLI, Antigravity, OpenCode, Aider and T3 Code — plus headless browser automation — running on your MacBook with the lid closed. No VPS to rent. No cooked laptop in your backpack.

L closes the lid. Go on, try to kill the agents.

TerminalShellEditViewWindow 85%Sat 9:41
agents — zsh
Claude Code
Codex CLI
Antigravity
Agent Browser · CDP :9222
zZ
Detects & protects
A

Agent-aware, not always-on

Sleep is disabled only while an agent or CLI lease is running. The moment they finish, normal macOS sleep is back.

pmset -a disablesleep 1
B

Fails closed

A 30-second dead-man's switch restores sleep on its own if LidKeep quits, crashes, or is force-killed.

pmset -a disablesleep 0
C

Backpack-proof

Power rules and a sustained thermal watchdog put the Mac to sleep before a closed, running laptop cooks in a bag.

Cool → Warm → Hot

01Anti-backpack safety

Now zip it into a backpack.

A closed Mac that never sleeps is a hazard, so LidKeep watches power and heat the whole time. It also locks the screen when the lid closes, so reopening it takes Touch ID or your password. Drag the controls and try to make it do something unsafe.

Conditions
PowerPlugged in
Battery level85%
Only stay awake when plugged inThe default. Turn off to use a battery cutoff instead.
Pause if battery drops to25%
Mac temperatureCool
CoolWarmInside backpack
Closed-Lid Active
lid closed · 3 agents working
CoolthermalState: nominal
Thermal watchdogarmed · 30 s sustained-heat grace
disablesleep1
agentsrunning
macOS sleepheld off
Safety enginedemo runs 6× real time

    02Phone companion

    Scan once. Check on it from anywhere.

    Your Mac serves a small web app straight to your phone — no cloud account, no server of ours in the middle. Pair with a QR scan or a 6-digit code, then tap around below: both sides stay in sync.

    LidKeep Settings
    GeneralPhone
    Allow Phone ConnectionCheck agents and control LidKeep right from your phone.

    Scan with your phone camera

    Tailscale • Works anywhere
    Pairing Code
    482-917
    100.101.67.33:47821

    The link changes when LidKeep restarts. Just scan again.

    Connected Phones (1)

    iPhone (Safari)Last active just now
    Disconnect

    On the Mac, instantly

    Wi-Fi / Tailscale

    Direct to your Mac over the local network or your tailnet. Nothing leaves your devices.

    Anywhere (No VPN)

    One click starts a Cloudflare Quick Tunnel via cloudflared — HTTPS from any network, no account and no server to run.

    Install as an app

    It's a PWA: add it to your home screen and it opens full-screen like a native app.

    03The real thing

    Not a mockup. This is the app.

    Everything above is a simulation. These are unedited renders from the compiled SwiftUI binary.

    ⌘85%9:41
    LidKeep menu bar popover: Ready to Close Lid, three agents working, Keep web browsing alive enabled, lid closed, 85% plugged in, cool.
    LidKeep Settings
    LidKeep General settings: Closed-Lid Mode enabled, only stay awake when plugged in, auto-sleep if Mac gets too hot, lock screen when lid closes, web browsing options.
    LidKeep Settings
    LidKeep Phone settings with QR code and pairing code over Tailscale.
    LidKeep Settings
    LidKeep Phone settings with Secure Tunnel active on a trycloudflare.com address.

    04Local vs. rented

    You already own the best agent box.

    The usual fix for "my laptop sleeps" is a cloud VM. That means paying monthly to move your work away from everything that makes it work.

    Your MacBook + LidKeep
    $0/mo

    Apple Silicon you've already paid for.

    • Your repos, as they areUncommitted work, local branches, env files — already there.
    • Keys never leave the machineAPI keys, SSH keys and keychain stay where they live today.
    • Logged-in browser sessionsAgents browse with your real cookies, even with the screen off.
    • Xcode, Simulator, macOS toolchainsBuild and test Apple-platform apps where they actually build.
    • Nothing to provisionOne-time permission prompt. No images, firewalls or patching.
    Cloud VPS
    $30+/mo

    For a box comparable to the laptop on your desk.

    • Clone, sync, repeatEvery repo, every dotfile, kept in step with your real machine.
    • Secrets copied to a remote hostTokens and SSH keys now live on a second, internet-facing computer.
    • Fresh browser, no sessionsLog in again everywhere, and get treated like a datacenter IP.
    • No Xcode on LinuxmacOS-only toolchains need a pricier hosted Mac.
    • One more server to runProvisioning, hardening, updates and a bill that never sleeps.

    05Architecture you can audit

    Small enough to trust with root.

    Changing system sleep needs privileges. LidKeep keeps that part tiny, single-purpose and unable to stay stuck on.

    Dead-man's switch

    If LidKeep dies, your Mac sleeps again.

    The app renews a 30-second lease with the helper every few seconds. No renewal, no lease: the helper restores normal sleep by itself.

    30s lease
    LidKeep.apprunning
    heartbeatrenewing
    disablesleep1
    helper: lease active · ttl 30s
    Privileged helper

    The entire root-level API.

    # everything lidkeep-helper can run
    pmset -a disablesleep 1
    pmset -a disablesleep 0

    No shell, no arbitrary commands, no file access. Everything else — agent detection, the lid-close screen lock, the browser, the phone server — runs unprivileged as you.

    Bundled CLI

    Wrap any command in a closed-lid lease.

    $lidkeep run -- claude

    Footprint

    100% native. Zero Electron.

    5.4 MB
    whole app bundle
    Swift 6
    SwiftUI menu bar app
    macOS 14+
    Apple Silicon
    Closed-lid web

    Browsers that don't stall when the screen goes dark.

    A dedicated anti-throttling Chromium for CDP, Playwright and MCP tools runs --headless=new, even with the Mac locked. Need a real window? Flip on a virtual display backed by CGVirtualDisplay.

    LidKeep app icon

    Close the lid tonight.

    LidKeep builds from source in one command. A signed DMG and Homebrew cask are on the roadmap.

    $./scripts/build-app.sh && cp -R dist/LidKeep.app /Applications/ && open /Applications/LidKeep.app
    1. 1Run the command from the repo root. Needs Xcode's Swift 6 toolchain.
    2. 2Click the shield in your menu bar and enable Closed-Lid Mode — a one-time macOS permission.
    3. 3Start an agent. Close the lid. Walk away.