goguma

Writing

What actually happens when a Mac sleeps through the work it was supposed to do, why the usual advice does not fix it, and how each of the tools in this area really behaves.

Why your Mac's cron jobs don't run while it's asleepcron skips a job whose time passed while the Mac was asleep — no error, no retry, no record. launchd behaves differently. Here is exactly what happens, and what to do about it.How to wake a Mac for a scheduled job with pmsetThe complete method — computing the wake time, arming it, holding sleep off until the job finishes, and re-arming for next time — plus the four things that go wrong.How to find which of your scheduled jobs your Mac has been missingcron keeps no record of a job it skipped, so you have to reconstruct it — replay each schedule against the machine's own sleep history. Here is how, by hand.launchd vs cron on macOS — which one survives sleeplaunchd re-fires a missed calendar job on wake; cron skips it silently. Which one you are using decides whether a sleeping Mac is a problem or a non-event.caffeinate vs pmset vs Amphetamine — what each one actually doesThree tools people reach for interchangeably that behave completely differently with the lid closed, on battery, and when the thing holding the assertion dies.Why caffeinate doesn't work when you close the lidcaffeinate asserts against idle sleep. Closing the lid is a different sleep path entirely, which is why your job dies the moment the MacBook shuts — and what actually holds it.Amphetamine alternatives for macOS, compared honestlyEvery keep-awake app for the Mac, what each actually does with the lid closed, and the question that separates them — what happens when you forget to turn it off.You cannot tell whether an AI coding agent is working by watching itMeasured over ten seconds, the idle Claude Code session used more CPU than the one actively working. Here is the data, and why every process-watching approach to agent sleep prevention is built on sand.Is it safe to keep a MacBook awake with the lid closed in a bag?The two real risks are thermal and battery, and the reason lid-closed is the dangerous case is that you cannot see anything is wrong. What a safety cutoff has to check, and the sensor trap that makes a naive one useless.How to keep Claude Code or Codex running when you close the MacBook lidWhy the agent dies the moment the lid shuts, the three ways to fix it ranked by how badly each fails, and the hook configuration for all four major harnesses.How to keep a MacBook awake with the lid closedClosing the lid sleeps a MacBook regardless of every timer and every keep-awake app. Here is the one supported way, the one mechanism that works without a display, and what each costs.How to find out what woke your MacYour Mac keeps a log of every sleep and wake, with a reason for each. Here is how to read pmset -g log, what the wake reasons mean, and how to tell a real wake from a maintenance dark wake.How to keep a Mac awake from the terminal until a command finishescaffeinate can scope a sleep hold to exactly one command or process, so the Mac stays awake precisely as long as the work runs. The flags, the traps, and the one case it cannot cover.pmset repeat: put your Mac's sleep and wake on a daily schedulemacOS still has scheduled sleep and wake — the Energy Saver UI for it is gone, but pmset repeat does everything the panel did and more. Syntax, weekday codes, verification, and the gotchas.Dark wake and Power Nap: when your Mac is awake but not reallymacOS punctuates a long sleep with brief wakes that never turn on the screen. What dark wakes are for, how to spot them in the log, and why your scheduled jobs do not run during them.pmset disablesleep: the sleep switch with no ownerOne command overrides every kind of sleep on a Mac, including the lid. It is also undocumented, global, and stays set when the thing that set it dies. How to use it without stranding it.Every pmset sleep setting, explainedsleep, displaysleep, standby, hibernatemode 0, 3 and 25, womp, ttyskeepawake, powernap: what each setting in pmset -g actually controls, with the defaults and the traps.Why SSH sessions drop when your Mac sleeps, and what actually survivesSleep suspends the network, so every SSH connection dies with it — in both directions. What tmux and mosh actually solve, what ttyskeepawake does, and how to keep either end alive on purpose.