claude-code - 💡(How to fix) Fix Feature request: Support Quartz-style cron (`#`, `L`) in Routines/scheduled triggers [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#48842Fetched 2026-04-16 06:49:25
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2commented ×1

The Routines (scheduled remote triggers) scheduler accepts only standard 5-field POSIX cron. This makes common "nth weekday of month" schedules impossible to express cleanly — requests like "2nd Friday of every month" degrade into either an over-firing trigger or a fixed date that drifts onto weekends.

Quartz-style # (nth occurrence) and L (last) notation would solve this without changing the default parser behavior for existing users.

Error Message

Error shape suggests a Go-based parser (robfig/cron-like) running in POSIX mode

Root Cause

The Routines (scheduled remote triggers) scheduler accepts only standard 5-field POSIX cron. This makes common "nth weekday of month" schedules impossible to express cleanly — requests like "2nd Friday of every month" degrade into either an over-firing trigger or a fixed date that drifts onto weekends.

Quartz-style # (nth occurrence) and L (last) notation would solve this without changing the default parser behavior for existing users.

Fix Action

Fix / Workaround

Workarounds considered (all worse)

RAW_BUFFERClick to expand / collapse

Summary

The Routines (scheduled remote triggers) scheduler accepts only standard 5-field POSIX cron. This makes common "nth weekday of month" schedules impossible to express cleanly — requests like "2nd Friday of every month" degrade into either an over-firing trigger or a fixed date that drifts onto weekends.

Quartz-style # (nth occurrence) and L (last) notation would solve this without changing the default parser behavior for existing users.

Observed

Tested via the /schedule skill on 2026-04-15 (claude-code CLI):

1. POSIX cron uses OR when both DoM and DoW are restricted (expected per spec). Submitted cron: 0 15 8-14 * 5 ("2nd Friday" attempt — days 8–14 AND Friday). API accepted it. next_run_at came back as 2026-04-17T15:06:45Z — that's the 3rd Friday of April 2026, matching only the DoW clause. Confirms OR semantics, which will cause this trigger to over-fire ~11x/month instead of 1x/month.

2. Quartz # syntax is rejected. Submitted cron: 0 15 * * 5#2. API response:

HTTP 400
invalid cron expression "0 15 * * 5#2":
failed to parse int from 5#2: strconv.Atoi: parsing "5#2": invalid syntax

Error shape suggests a Go-based parser (robfig/cron-like) running in POSIX mode rather than with v3 / Quartz extensions enabled.

Proposed

Enable Quartz-compatible extensions on the day-of-week field:

  • <n>#<k> — kth occurrence of weekday n in the month (e.g., 5#2 = 2nd Friday)
  • <n>L — last occurrence of weekday n in the month (e.g., 5L = last Friday)

Either switch the parser to robfig/cron v3 with a permissive option, or layer a Quartz-aware parser (e.g., gronx, cronexpr) in front of the current one.

Workarounds considered (all worse)

  • Fixed date (0 15 10 * *): loses weekday semantics; ~2/7 months lands on a weekend
  • Weekly + agent-side date check: wastes ~80% of agent spawns firing just to exit; adds a new failure surface (agent gets the date math wrong)
  • Multiple triggers: clunky, doesn't scale, still requires per-month edits

Use case

Monthly hygiene reminders, weekly on-call rotations ("every 2nd Tuesday"), and release cadences ("last Thursday of the month") — all common patterns that POSIX cron genuinely can't express.

Environment

  • Claude Code CLI, /schedule skill
  • Date observed: 2026-04-15

extent analysis

TL;DR

Enable Quartz-compatible extensions on the day-of-week field to support schedules like "2nd Friday of every month".

Guidance

  • Consider using a Quartz-aware parser like gronx or cronexpr to support the desired syntax, such as 5#2 for the 2nd Friday of the month.
  • If using the robfig/cron parser, explore switching to version 3 with a permissive option to enable Quartz extensions.
  • Verify that the chosen parser correctly handles the new syntax and doesn't break existing POSIX cron expressions.
  • Test the updated parser with various schedules, including edge cases like the last day of the month or the first day of the week.

Example

No code snippet is provided as the issue doesn't imply a specific programming language or implementation details.

Notes

The proposed solution relies on the assumption that the robfig/cron parser is being used, and that switching to version 3 or using a Quartz-aware parser will resolve the issue. However, the exact implementation details are not provided, and further investigation may be necessary to ensure a seamless integration.

Recommendation

Apply a workaround by using a Quartz-aware parser, as it seems to be the most straightforward solution to support the desired schedules without breaking existing functionality. This approach allows for a more flexible and expressive scheduling system.

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 Feature request: Support Quartz-style cron (`#`, `L`) in Routines/scheduled triggers [1 comments, 2 participants]