claude-code - 💡(How to fix) Fix [BUG] Routines (RemoteTrigger) scheduler stalls: next_run_at freezes in the past, scheduled fires never execute [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#56086Fetched 2026-05-05 05:58:34
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

  • The minute jitter in next_run_at (e.g. 18:08:04, 18:08:38) suggests the scheduler intentionally offsets cron slots — that's fine, but a stall on the offsetted timestamp suggests the dispatcher isn't picking the slot up reliably.
    • Manual POST /v1/code/triggers/{id}/run works in both stall states, which rules out an issue with the agent / git source / MCP connector.
    • I've collected the JSON of GET /v1/code/triggers/{id} at each stall state if useful.
  1. Is there a known cause for the dispatcher to drop a slot once next_run_at has been written?
  2. Would it be reasonable for the platform to auto-advance next_run_at when a slot is more than N minutes overdue, rather than requiring a manual no-op update?

Stall #1 — Fri 2026-05-01

  • After successful manual run, scheduler set next_run_at: 2026-05-01T18:08:04.644Z
  • 18:08 came and went; no run was logged on the routine page
  • At ~18:22 UTC, next_run_at still showed 18:08:04 (in the past, ~14 min stale)
  • Workaround: POST /v1/code/triggers/{id} with {"cron_expression": "0 */3 * * 1-5"} (same value as before) → next_run_at advanced to 2026-05-01T21:01:25.811Z

Code Example

## Routine                                                                                                                                                          
                                                                                                                                                                      
  - ID: `trig_011oqBnKmkKHSrjZ9D18pKNC`                                                                                                                               
  - Name: `yii-dead-code-cleanup`                                                                                                                                     
  - Cron (UTC): `0 */3 * * 1-5` (top of every 3rd hour, Mon–Fri)                                                                                                      
  - `enabled: true` throughout                                                                                                                                        
  - Environment: `env_01JH5JdGeMF6paSdhapriQxW` (anthropic_cloud)                                                                                                     
  - Sources: a single git_repository                                                                                                                                  
  - One MCP connection (GitHub)     

## Timeline                                                                                                                                                         
                                                                                                                                                                      
  **Stall #1Fri 2026-05-01**                                                                                                                                       
  - After successful manual run, scheduler set `next_run_at: 2026-05-01T18:08:04.644Z`
  - 18:08 came and went; no run was logged on the routine page                        
  - At ~18:22 UTC, `next_run_at` still showed `18:08:04` (in the past, ~14 min stale)                                                                                 
  - Workaround: `POST /v1/code/triggers/{id}` with `{"cron_expression": "0 */3 * * 1-5"}` (same value as before)`next_run_at` advanced to
  `2026-05-01T21:01:25.811Z`                                                                                                                                          
                                                                                                                                                                      
  **Stall #2Mon 2026-05-04**                                                                                                                                       
  - Scheduler had set `next_run_at: 2026-05-04T18:08:38.298Z`                                                                                                         
  - 18:08 came and went; no run logged                       
  - At ~18:11 UTC, `next_run_at` still showed `18:08:38` (~3 min stale)                                                                                               
  - Same workaround applied → `next_run_at` advanced to `2026-05-04T21:07:49.910Z`
                                                                                                                                                                      
  Both stalls happened at the 18:08 UTC slot specifically.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

A claude.ai/code routine on a recurring cron stops firing. The routine's next_run_at field freezes at a past timestamp and never advances. Manual "Run now" works fine, and re-saving the cron expression (no-op partial update) advances next_run_at to a valid future slot — at which point the schedule resumes (until the next stall).

What Should Happen?

Notes

  • The minute jitter in next_run_at (e.g. 18:08:04, 18:08:38) suggests the scheduler intentionally offsets cron slots — that's fine, but a stall on the offsetted timestamp suggests the dispatcher isn't picking the slot up reliably.
  • Manual POST /v1/code/triggers/{id}/run works in both stall states, which rules out an issue with the agent / git source / MCP connector.
  • I've collected the JSON of GET /v1/code/triggers/{id} at each stall state if useful.

Asks

  1. Is there a known cause for the dispatcher to drop a slot once next_run_at has been written?
  2. Would it be reasonable for the platform to auto-advance next_run_at when a slot is more than N minutes overdue, rather than requiring a manual no-op update?

Error Messages/Logs

## Routine                                                                                                                                                          
                                                                                                                                                                      
  - ID: `trig_011oqBnKmkKHSrjZ9D18pKNC`                                                                                                                               
  - Name: `yii-dead-code-cleanup`                                                                                                                                     
  - Cron (UTC): `0 */3 * * 1-5` (top of every 3rd hour, Mon–Fri)                                                                                                      
  - `enabled: true` throughout                                                                                                                                        
  - Environment: `env_01JH5JdGeMF6paSdhapriQxW` (anthropic_cloud)                                                                                                     
  - Sources: a single git_repository                                                                                                                                  
  - One MCP connection (GitHub)     

## Timeline                                                                                                                                                         
                                                                                                                                                                      
  **Stall #1 — Fri 2026-05-01**                                                                                                                                       
  - After successful manual run, scheduler set `next_run_at: 2026-05-01T18:08:04.644Z`
  - 18:08 came and went; no run was logged on the routine page                        
  - At ~18:22 UTC, `next_run_at` still showed `18:08:04` (in the past, ~14 min stale)                                                                                 
  - Workaround: `POST /v1/code/triggers/{id}` with `{"cron_expression": "0 */3 * * 1-5"}` (same value as before)`next_run_at` advanced to
  `2026-05-01T21:01:25.811Z`                                                                                                                                          
                                                                                                                                                                      
  **Stall #2 — Mon 2026-05-04**                                                                                                                                       
  - Scheduler had set `next_run_at: 2026-05-04T18:08:38.298Z`                                                                                                         
  - 18:08 came and went; no run logged                       
  - At ~18:11 UTC, `next_run_at` still showed `18:08:38` (~3 min stale)                                                                                               
  - Same workaround applied → `next_run_at` advanced to `2026-05-04T21:07:49.910Z`
                                                                                                                                                                      
  Both stalls happened at the 18:08 UTC slot specifically.

Steps to Reproduce

Repro shape

  1. Create a routine with cron 0 */3 * * 1-5
  2. Wait for the system to schedule a fire near 18:00 UTC on a weekday
  3. Observe that next_run_at is in the past and the run did not execute
  4. POST /v1/code/triggers/{id} with the same cron_expressionnext_run_at recomputes to the next valid future slot

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.126

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The dispatcher appears to drop a scheduled slot once next_run_at has been written, and a potential fix could be to auto-advance next_run_at when a slot is overdue.

Guidance

  • Investigate the dispatcher's behavior when handling scheduled slots, particularly around the 18:08 UTC time on weekdays.
  • Verify if the issue is specific to the 0 */3 * * 1-5 cron expression or if it occurs with other cron expressions as well.
  • Consider implementing a mechanism to auto-advance next_run_at when a slot is more than a certain number of minutes overdue, as a potential workaround.
  • Review the collected JSON data from GET /v1/code/triggers/{id} to see if there are any patterns or clues that could help identify the root cause.

Example

No code snippet is provided as the issue seems to be related to the scheduling mechanism rather than a specific code implementation.

Notes

The issue seems to be specific to the Anthropic API platform and the Claude Code Version 2.1.126. The root cause is still unknown, and further investigation is needed to determine the best course of action.

Recommendation

Apply a workaround by auto-advancing next_run_at when a slot is overdue, as this seems to be a potential solution to the issue. This can help mitigate the problem until the root cause is identified and fixed.

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

claude-code - 💡(How to fix) Fix [BUG] Routines (RemoteTrigger) scheduler stalls: next_run_at freezes in the past, scheduled fires never execute [1 comments, 2 participants]