A macOS menu-bar app that locks your screen — blurs everything, kills the keyboard and mouse — while keeping your Mac wide awake so long-running work survives. Close the lid, walk away, come back hours later: your Claude Code sessions, servers, and downloads are still running. Unlock with a 4-digit PIN.
Built in one shot with Claude, for the delightfully meta reason of keeping AI agents running while the screen is locked. A fun project — ship it, use it, break it.
While locked, the screen shows a little coral Claude leading a pack of cyclists across a frosted blur, and the scene reacts to the input it's swallowing: your mouse leaves a glowing trail, every blocked keystroke throws a spark, and the bikes pedal harder the more you mash.
- Locks people out, not processes — full-screen blur on every display, all keyboard/mouse input swallowed at the event-tap level (Cmd-Tab, Force-Quit, media keys — all dead).
- Stays awake, lid closed included — holds an IOKit power assertion; optional
pmset disablesleepso a closed clamshell keeps working. - 4-digit PIN — salted SHA-256 in the Keychain, escalating lockout after wrong tries.
- Ambient scene — Claude + bikes, reacting to your (blocked) input.
- Tunable look — independent Blur and Background-opacity sliders with live preview, plus a solid-black Opaque mode.
- Menu-bar only, global hotkey ⌃⌥⌘L, crash-safe (a crash just leaves your Mac normal).
./scripts/setup-signing.sh— stable code-signing identity so macOS keeps the Accessibility grant across rebuilds (login password once)./scripts/bundle.sh— buildsbuild/DeskLock.appand installs it to /Applicationsopen /Applications/DeskLock.app— a lock icon appears in the menu bar- Menu → Set PIN… — choose your 4-digit PIN
- First lock asks for Accessibility permission (System Settings → Privacy & Security → Accessibility → enable DeskLock), then lock again
- Optional, for lid-closed operation:
./scripts/setup-sudoers.sh(admin password once), then enable menu → Keep Awake When Lid Closes
- Lock: menu → Lock Now, or ⌃⌥⌘L from anywhere
- Unlock: type your 4-digit PIN (Backspace clears; 3 wrong → 30 s lockout, doubling after)
- Blur / Background opacity sliders in the menu, with a live preview as you drag
- Deterrence lock, not a vault: a hard power-cycle reboots to the macOS login screen — the intruder still can't get in, but your session dies.
- SSH and remote access are unaffected.
- Heat: a closed laptop under load runs hot. Desk, not bag.
- Touch ID isn't supported — macOS forces a system prompt for third-party biometric auth, which conflicts with a full-screen lock, so DeskLock is PIN-only on purpose.
- On unlock and at launch, DeskLock resets
pmset disablesleepto 0 (including a value set outside the app).
swift build # or ./scripts/bundle.sh for the .app
swift run desklock-tests # assert-based tests (no Xcode/XCTest needed)
Swift Package Manager, zero dependencies, macOS 13+.