Symptom
The task was still running when you disconnected in the evening. The next day you connect and find it stopped long ago: no error, no new log lines after a certain time, or the program is no longer in the process list.
Possible causes (most common first)
- The program exited on its own: an error, being terminated by the system for running out of memory, or a sign-in session it depends on expiring. This is the most common cause, and the one most readily blamed on sleep.
- The task was attached to a terminal window and was ended together with it when the terminal closed or the remote session ended.
- The system went to sleep after being idle for a while and the process was suspended. After wake, some programs continue and some fail because their network connections timed out.
- The machine was restarted, for example by you or by some other operation.
Troubleshooting steps (easiest first)
Check whether the machine actually slept
Run
pmset -g log | grep -E "Sleep|Wake" | tail -n 30in Terminal to see recent sleep and wake records with their times. Compare them with the time of the last line in your task's log. Only if the times match was sleep the cause. If the machine has no sleep record for the whole night, look for the cause in the program itself.uptimetells you when the machine last started, which shows whether it was restarted.See how the program ended
If the process is gone, read the last few dozen lines of its own log and its exit code. If you did not write its output to a file when starting it, there is nothing left to check this time; next time start it with
>> ~/logs/run.log 2>&1appended.Confirm sleep prevention is in effect
pmset -g assertionslists which processes are currently preventing system sleep. After you start a task wrapped incaffeinate -i, a matching entry should appear here. According to the built-in manual page,-iprevents idle sleep and holds only while the wrapped command is running; it is released when the command ends. If the task is already running and it is too late to start it again, open another terminal and runcaffeinate -i -wfollowed by that process's ID for the same effect.Detach the task from the terminal window
If the cause was the terminal closing and not sleep, start the task inside a tmux session. The full steps are in the guide to keeping long tasks running and are not repeated here.
Do not fix this by changing global power settings
caffeinate affects only your own task and changes no system setting. System-level energy and lock screen options are tied to the delivery configuration; you may look at them, but ask support before changing them. Letting only the display turn off does not affect background tasks, and you do not need to do anything about it.
When to contact support directly
If the log shows the machine slept or restarted at a time when you did nothing, and you are sure you did not change the power settings, contact support on Contact support. Include your machine ID, roughly when the task stopped, the lines from pmset -g log for that period and the output of uptime. If you cannot connect and suspect the machine is asleep and will not wake, do not keep submitting restarts. Just state the last time you were able to connect.
Related
- How to keep long tasks running on a remote Mac mini after you disconnect
- Can I shut down a rented Mac mini or put it to sleep?
- Does a long Claude Code task stop when my remote connection drops?
- How do I know my unattended agent is still running properly?
- Mac mini for 24/7 AI agents? Only worth it when the agent needs a desktop or macOS apps
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support