Feature request: Support Quartz-style cron (`#`, `L`) in Routines/scheduled triggers

Resolved 💬 2 comments Opened Apr 16, 2026 by siznax Closed May 25, 2026

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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗