Lock your Mac while Claude Code and Cursor run
A 45-minute agent run is exactly long enough to walk away from — and exactly long enough for one stray keystroke to derail it.
The problem with walking away mid-run
AI coding agents run unattended by design. You give Claude Code a refactor, it works through the codebase for half an hour, and the useful thing to do in the meantime is something else. The catch is that the session lives in a terminal or IDE that is still listening to your keyboard.
A cat on the desk, a toddler at the keyboard, a colleague borrowing your machine for “one second” — any of it can send Ctrl+C, answer a confirmation prompt that should have been yours, or type into a file the agent is editing.
Why the macOS screen lock does not solve it
Locking the screen does stop the input — but it also hides the run. You lose the ability to glance over and see whether the agent finished, stalled, or is sitting on a permission prompt waiting for an answer. For a long unattended job, visibility is the whole point of leaving it on screen.
There is a second problem: the built-in lock does nothing about sleep. If your energy settings suspend the machine, the agent stops with it.
What locking input instead looks like
Warden blocks keyboard, mouse, and trackpad at the macOS event-tap layer, which means input is discarded before any application — terminal, IDE, or agent — can see it. The screen stays exactly as it was, so the agent’s output keeps streaming in full view, and optional sleep prevention keeps the Mac awake for the duration.
When you come back, Touch ID unlocks the session and the run is wherever it got to.
Set it up
$brew install --cask ParthJadhav/warden/wardenStart your agent, press ⌘⇧L, and walk away. Warden requires macOS 15.2 or later and comes with a 7-day free trial.
Beyond agents
The same shape of problem shows up anywhere a local job outlives your attention: Xcode release builds, Final Cut exports, local model training, long test suites. Anything you would rather watch than hide.