Safeguard
Developer Tools•

What happens to a scheduled AI task when your laptop sleeps?

Local scheduled AI tasks skip or catch up after sleep, cloud tasks do not care. How missed runs behave and why late runs can break your assumptions.

Safeguard Security Team
7 min read

It depends on where the task runs. Anthropic's Desktop tasks skip a run if the computer sleeps, then start one catch-up run on wake. Session loops fire once when idle and do not replay misses. Cloud routines and remote Cowork tasks run regardless of your laptop.

Behavior by setup

SetupComputer asleep at the scheduled time
Claude Code Desktop local taskRun skipped. On wake, one catch-up run for the most recently missed time, older misses discarded.
Claude Code session loopFires only while the session is running and idle. A missed time fires once when Claude becomes idle, not once per interval.
Claude Code cloud routineRuns in the cloud, so the laptop is irrelevant.
Claude Cowork scheduled taskRuns remotely and keeps its schedule, unless it needs local files or apps, in which case it runs only locally.
Codex style task with local filesThe documentation says to keep the computer on and the app running.

These details come from the vendors' pages as read on 19 October 2026. The Cowork help article does not describe missed run behavior, so do not assume it.

The catch-up run is the surprise

The Desktop page gives an example: a task scheduled for 9am can run at 11pm if the computer was asleep all day. A daily task that missed six days runs once on wake, with a notification.

For a harmless summary that is fine. For a task that posts to a channel, files tickets or opens pull requests, a run at the wrong time can mean stale data acted on as fresh. Anthropic suggests building guardrails into the prompt itself, for example telling the task to skip work and post a note if it is past a certain hour.

Design for lateness

Treat every scheduled run as possibly late, early, duplicated in effect, or absent.

  1. Put a time check in the prompt: "If the current time is more than two hours after the intended run time, report that and stop."
  2. Make actions idempotent. Search for an existing ticket or branch before creating one.
  3. Have the task state its data window, such as "commits since the last successful run", and store that marker somewhere durable.
  4. Alert on silence. A task that quietly stopped is harder to notice than one that fails loudly. See how to detect a silently failing scheduled scan.

Jitter is separate from sleep

Even with a machine awake, schedules are not exact. Claude Code's loop scheduler shifts recurring runs late by up to half the gap to the next run, capped at 30 minutes, to spread API load. Routines scheduled exactly on the hour can start several minutes late. GitHub says scheduled workflows can be delayed under load, especially at the top of the hour. Pick an off-peak minute such as 9:07, and never use a scheduled AI task as a precise timer.

Keep awake or go cloud

The Desktop page offers a Keep computer awake setting, but closing the lid still sleeps the machine. If the job needs to be reliable and does not need local files, run it in the cloud. If it needs local files, accept that availability is only as good as the laptop, and say so in the task description.

Worked example: a Monday morning report that arrives on Tuesday

A manager sets up a Desktop task to summarize weekend security tickets every Monday at 8am. The laptop goes in a bag on Friday and stays closed until Tuesday at 9. On wake, Desktop checks for runs missed in the last seven days and finds one. It starts a single catch-up run, with a notification. The summary now covers tickets up to Tuesday morning but is labeled as the Monday report, and the manager forwards it to leadership as if it were current to Monday.

Nothing broke. The product did what its documentation says. The failure is in the prompt and the process, which assumed on time delivery.

Fixing it in three layers

In the prompt. Tell the task to state the current time and the period it covers at the top of the output. Add a rule: "If it is more than three hours after 8am Monday, start the report with LATE RUN and continue." That single line gives the reader the one fact they need.

In the setup. If the report must be on time, run it where the laptop does not matter. A cloud routine or a remote Cowork task keeps its schedule without your computer, as long as it does not need local files. If it does need local files, accept the limit or move the files somewhere the cloud task can reach.

In monitoring. Ask someone to expect the report by 9am. If it has not arrived, they check. An absence alarm is cheap and catches sleeping machines, expired schedules and revoked connectors all at once.

Comparing the failure modes

SetupHow it failsHow you notice
Desktop taskSkipped when asleep, one late catch-upA notification on wake, or a gap in the report series
Session loopStops when the terminal closesThe loop simply stops, with no alert
Cloud routineConnector or GitHub access lapsesSkipped runs, then the routine turns off after 72 hours without GitHub access
Remote Cowork taskNeeds local files, so it cannot run remotelyThe task runs only locally

Steps to harden any scheduled job

  1. Decide whether lateness matters. If not, stop here.
  2. If it does, choose the cloud option or a machine that stays on.
  3. Add time awareness to the prompt.
  4. Make writes idempotent so a catch-up run does not duplicate yesterday's work.
  5. Add an external check that expects the output.
  6. Review run history weekly for skips.

Keep computer awake is not a plan

The Desktop page offers a setting to prevent idle sleep, and warns that closing the lid still sleeps the machine. For personal convenience that is fine. For anything a team depends on, a personal laptop is a weak host. Treat it like any other single point of failure and either move the job or write down the dependency.

Try it yourself

Click through it at your own pace, or open it full screen.

Watch how a recurring check reports on its own schedule and what a gap between runs would look like.

Quick check

Will a daily Desktop task run seven times after a week offline?

No. The Desktop page says it starts exactly one catch-up run for the most recently missed time and discards older ones.

Can I rely on a scheduled prompt firing at an exact minute?

No. Recurring loops are shifted by jitter, routines on the hour can start late, and GitHub warns of delays under load.

If my task catches up after sleep, will it also repeat every missed run?

No for Desktop tasks, which run once for the most recently missed time and discard older ones. Session loops also fire once when idle. Design prompts so one late run is safe.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.