Skip to content

docs: note that a sleeping Mac stops an agent waiting on a reset - #38

Merged
tkc merged 1 commit into
mainfrom
readme-caffeinate-tip
Sep 18, 2026
Merged

tkc merged 1 commit into
mainfrom
readme-caffeinate-tip

Conversation

@tkc

@tkc tkc commented Sep 17, 2026

Copy link
Copy Markdown
Owner

A new Leaving it running section in the README, after Session restore.

Claude Code resumes its task by itself when a usage limit resets — but only while its session is still alive, which is what makes leaving termit open the thing that gets work done overnight. A sleeping Mac freezes every process, so the reset passes and nothing happens.

The default state is not enough on its own. Checked what was actually holding this machine awake:

PreventSystemSleep            0
PreventUserIdleSystemSleep    1   <- coreaudiod, sharingd, powerd

Everything holding an assertion was holding the idle one, and those come and go (coreaudiod's disappears when the audio stops).

caffeinate -is termit

Verified rather than assumed: PreventSystemSleep goes 0 → 1 while caffeinate -is runs and back to 0 when it exits, so nothing is left holding the machine awake after termit closes.

Both limits are stated in the section, because both are easy to trip over:

  • -s applies only on AC power (its man page says so).
  • Neither flag stops a laptop sleeping when you close the lid — a power assertion does not override clamshell sleep.

Test

cargo test — unchanged, including the test pinning the README's [paste] example to the shipped defaults. No code touched.

Separate from #37 so each lands on its own; they touch different parts of the README and merge cleanly in either order.

🤖 Generated with Claude Code

Claude Code resumes its task by itself when a usage limit resets, but
only while its session is alive, which makes leaving termit open the
thing that gets work done overnight. A sleeping Mac freezes every
process, so the reset passes and nothing happens -- and none of the
assertions already on this machine (coreaudiod, sharingd, powerd) hold
PreventSystemSleep, so the default state is not enough.

`caffeinate -is termit` covers it, and releases both assertions when
termit exits. Verified: PreventSystemSleep goes 0 -> 1 while it runs and
back to 0 after. The two limits are stated, because both are easy to
trip over: -s applies only on AC power, per its man page, and neither
flag stops a laptop sleeping when the lid closes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tkc
tkc merged commit db37841 into main Sep 18, 2026
1 check passed
@tkc
tkc deleted the readme-caffeinate-tip branch September 18, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant