Scheduled task marks itself as completed (lastRunAt/nextRunAt advance) without actually running
Environment
- Claude Code desktop app, macOS Sequoia, Apple Silicon (Mac mini M4)
- Feature: scheduled tasks (mcp__scheduled-tasks__* / the create_scheduled_task / list_scheduled_tasks tools)
What happened
I have a recurring scheduled task (monthly-expense-summary, cron 0 21 5 , i.e. every month on day 5 at 21:00 local time). On 2026-09-05 the scheduler's own state shows the task fired successfully:
- lastRunAt updated to 2026-09-05T13:06:33.027Z (about 21:06 local, consistent with the task's jitter window)
- nextRunAt correctly advanced to the following month (2026-10-05T13:05:36.000Z)
However, the task did not actually execute:
- No new session transcript (.jsonl) was created anywhere under ~/.claude/projects/* in the trigger window (checked with find across every project directory, filtered to files modified between 20:50 and 21:30 local on 2026-09-05 — zero results).
- The task's real-world side effect (appending new rows to a CSV ledger file, per its SKILL.md instructions) never happened — the file's last modification stayed at a much earlier manual run, days before.
- No entry appeared in ~/.claude/debug/ for that time window.
- macOS unified log (log show) shows the Claude app itself was running and held a NoIdleSleepAssertion for about 8 minutes 44 seconds, released at 21:11:48 local — a window that overlaps the scheduled fire time — suggesting the app was awake and "doing something" around then, but whatever happened left no trace of an actual agent run.
So the scheduler appears to have recorded the run as successful (advancing its own bookkeeping) without ever spawning or completing an actual agent session to execute the task's instructions. This is worse than a simple missed run (which the app already handles gracefully by running late on next launch) because it looks successful and silently swallows the task — there was no error, no retry, and no way for the user to know it did not run except by manually auditing file timestamps.
Expected behavior
lastRunAt / nextRunAt should only advance once the task's agent session has actually started (ideally: completed). If a run fails to start or errors out before doing any work, the task should either retry, remain pending, or surface a visible error/notification, rather than silently marking itself done.
Repro difficulty
This appears intermittent. The same task, the previous month, simply missed its trigger entirely (app was closed) and correctly ran late on next app launch, which is the expected fallback behavior. This time the app was open and awake around the trigger time, yet the run still silently did not happen despite the scheduler marking it as done. I do not have a reliable repro; filing this as a report of observed behavior with the diagnostic evidence above, in case it helps narrow down a race condition in the scheduler wake-and-fire path.
🤖 Generated with Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗