[BUG] Missed scheduled-task catch-up at app launch silently goes stale and never executes; lastRunAt updated anyway

Resolved 💬 1 comment Opened Jul 10, 2026 by noneangle Closed Jul 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When the desktop app launches after scheduled cron slots were missed (machine was shut down), the scheduler detects the missed occurrences and dispatches catch-up runs -- but the dispatched runs never execute. The pending dispatch is silently discarded ~16 minutes later ("Cleared stale pending dispatch"). No session runs, no error, no notification.

Worse, lastRunAt is updated at dispatch time, so the task list shows the task as having run even though nothing executed. Both affected tasks had to be run manually by the user.

Timeline (2026-07-10, local UTC+8): machine booted 12:36:59, app launched 12:37:53, both missed tasks dispatched 12:38:01, concert-ticket-tracker dispatch cleared as stale 12:54:00, user ran both manually at 12:48 / 13:02.

Also observed: slots missed while the machine sleeps (app kept running) are never caught up on wake -- the occurrence is lost until the next cron slot (2026-07-07: a weekly 09:00 task slept through; wake at ~11:45 did not backfill).

What Should Happen?

  • Catch-up dispatches at app launch should actually execute (this is the only recovery path for users who shut down overnight), or at least fail visibly with a notification.
  • lastRunAt should only be updated when a run actually executes, not at dispatch time -- otherwise silently lost runs look successful.
  • Slots missed during sleep should also be caught up on wake.

Error Messages/Logs

12:38:01 [info] [CCDScheduledTasks] Spawning new session for scheduled task yu-database-daily { cronExpression: '0 8 * * *', fireAt: undefined, lastRunAt: '2026-07-10T04:38:01.363Z', missed: '2026-07-10T00:00:00.000Z' }
12:38:01 [info] [CCDScheduledTasks] Spawning new session for scheduled task concert-ticket-tracker { cronExpression: '0 9,21 * * *', fireAt: undefined, lastRunAt: '2026-07-10T04:38:01.371Z', missed: '2026-07-10T01:00:00.000Z' }
12:54:00 [warn] [CCDScheduledTasks] Cleared stale pending dispatch for: concert-ticket-tracker

(from ~/Library/Logs/Claude/main.log; timestamps local UTC+8. The same silent-stale pattern also appeared for a 3-hourly task on 2026-07-07: "Cleared stale pending dispatch" 13 minutes after its "Spawning" entry.)

Steps to Reproduce

  1. In the Claude desktop app, create a scheduled task with a daily cron (e.g. 0 8 *).
  2. Shut the machine down across the scheduled time.
  3. Boot and open the app after the slot has passed.
  4. Watch ~/Library/Logs/Claude/main.log: "Spawning new session ... missed: ..." appears within seconds of launch, no session ever executes, then "Cleared stale pending dispatch" ~16 min later. The task list nevertheless shows an updated last-run time.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Desktop app 1.20186.0 / Claude Code 2.1.205

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Desktop app 1.20186.0 (internal Claude Code 2.1.205), macOS 26.5.1 (arm64).

Possibly related: #47899 (dispatch-without-execution on Windows, closed as stale), #44128 (tasks fire on next app launch -- that catch-up path is exactly what goes stale here).

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗