claude-code - 💡(How to fix) Fix Scheduled tasks: auto-run missed tasks on app startup [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54555Fetched 2026-04-30 06:42:26
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

Feature Request

When Claude Code is closed at the time a scheduled routine is set to run, the task is silently skipped. It would be helpful to have a per-task (or global) setting to automatically run missed tasks when the app is launched again.

Use Case

Users who rely on daily/weekly routines but can't keep the app running 24/7 currently miss scheduled runs with no recovery. An 'run on startup if missed' toggle would ensure no routine is skipped unintentionally.

Proposed Behavior

  • Add a toggle option per scheduled task (e.g., runIfMissed: true)
  • On app startup, check the lastRunAt timestamp of each enabled task
  • If a task was scheduled to run while the app was closed, automatically trigger it on next launch

Expected Outcome

No scheduled routine is silently skipped due to the app being closed at run time.

extent analysis

TL;DR

Implement a mechanism to automatically run missed tasks when the app is launched again by adding a 'runIfMissed' toggle option per scheduled task.

Guidance

  • Introduce a new setting runIfMissed for each scheduled task to control whether a missed task should be run on app startup.
  • On app startup, iterate through all enabled tasks and check their lastRunAt timestamp to determine if any tasks were missed while the app was closed.
  • Develop a logic to automatically trigger missed tasks when the app is launched, considering the scheduled run time and the current time.
  • Consider implementing a queue or buffer to store missed tasks and process them sequentially on app startup to avoid concurrent execution issues.

Example

// Pseudo-code example of checking for missed tasks on app startup
tasks.forEach((task) => {
  if (task.enabled && task.runIfMissed && task.lastRunAt < getCurrentTime()) {
    // Trigger the missed task
    triggerTask(task);
  }
});

Notes

The proposed solution assumes that the app has access to the system clock and can accurately determine the time when tasks were scheduled to run. Additionally, the implementation should consider handling edge cases such as multiple missed tasks, task priorities, and potential resource constraints.

Recommendation

Apply workaround: Implement the proposed runIfMissed toggle option and the associated logic to automatically run missed tasks on app startup, as this addresses the core issue of silently skipped tasks.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING