Guide · October 2026

Why overnight Claude Code runs eat your limit

If the work was the same but your weekly limit dropped far more than expected, a Mac that slept mid-run may be the cause.

What happens

Claude Code keeps the conversation context in a prompt cache and re-reads it cheaply on the next request. The cache expires after minutes to an hour of not being used. If the Mac sleeps mid-run and wakes later, the cache is gone and the agent writes the whole context again (cache_creation) on its next request.

With several agents holding hundreds of thousands of tokens each, sleeping and waking all night adds up to dozens of full rewrites. That's why the work tokens you see look normal while the limit drops much more. Waking up can also drop the connection and lose the run entirely.

Preventing it yourself

Keep the Mac from sleeping only while the work runs. On power, caffeinate -s (Ctrl-C when done). With the lid closed or on battery you need sudo pmset -a disablesleep 1, and you must set it back to 0 afterwards (it survives a restart).

Staying awake after the work is done costs battery and heat, so the hard part is knowing when to turn it off.

With Lidnight

Lidnight uses Claude Code and Codex hooks to keep the Mac awake only while work runs (lid closed, on battery too) and sleeps once every session has been quiet for 10 minutes. Overnight runs don't doze off mid-task and rewrite their cache, and the Mac rests as soon as they're done. It warns if the battery stays above 42°C for a minute and sleeps at 45°C or at your battery floor.

The line under each menu bar bunny shows the limit left, and work that stops at a limit can continue after the reset. Checking your limits

Try Lidnight free

Apple Silicon Macs · macOS 13 or later. Every download includes a 7-day trial of everything in Pro, no payment details needed. Pro is a one-time payment (1 Mac $9.99 · 3 Macs $14.99, 50% off through Oct 31) with a 14-day refund.

Homebrew: brew install whereisdw/tap/lidnight