skip to content

A Claude Code session schedules `0 9 * * *` with CronCreate; it fires around 9:20 daily and is gone a week later — why?

level: seniorimportance: should knowfreq 8%

answer

  1. same offset every day
  2. derived from the task ID
  3. local time, not UTC
  4. seven days, one final fire
  5. session-scoped, restored on resume

basics

~10 s

Recurring CronCreate tasks get a deterministic jitter of up to 30 minutes after the scheduled time, and they expire seven days after creation, firing one final time before deleting themselves.

solid answer

~40 s

Two documented behaviours. **Jitter**: recurring tasks fire up to 30 minutes after their scheduled time (up to half the interval if they run more often than hourly), and the offset is derived from the task ID, so it is the same 9:20 every day; when timing matters the docs recommend an off-peak minute like `3 9 * * *`. **Expiry**: recurring tasks expire seven days after creation — they fire once more and delete themselves — so a long-lived check must be recreated or moved to a Desktop task or a routine. Times are local, not UTC, and the tasks are session-scoped: they fire only while the session runs and idles, and `--resume` restores them unless expired.

go deeper

for a junior

Recall the two numbers: recurring tasks can fire up to 30 minutes late, and they expire after seven days.

for a middle

Explain that the offset comes from the task ID, that times are local, and what CronCreate, CronList and CronDelete each do.

for a senior

Diagnose a quiet schedule from first principles: jitter, expiry, the session exiting, a busy turn with no catch-up, and what resume restores.

for a principal

Decide when a session-scoped scheduler is acceptable at all, and when the bounded lifetime is a feature that stops forgotten loops from spending budget.

## The setup and the three tools In a Claude Code session you ask for a dependency check every morning at nine. Claude calls **`CronCreate`** with the 5-field cron expression `0 9 * * *`, the prompt, and a flag saying it recurs. Two surprises follow: the check fires at roughly 9:20 every day, and a week later it is gone from `CronList`. Neither is a bug. Both are documented properties of Claude Code's **session-scoped scheduler**, which three tools drive: | Tool | What it does | | :- | :- | | `CronCreate` | Schedules a task: a 5-field cron expression, the prompt, and whether it recurs or fires once | | `CronList` | Lists the session's tasks with their IDs, schedules and prompts | | `CronDelete` | Cancels a task by its 8-character ID | `/loop` with an interval and natural-language requests ("remind me at 3pm…", "cancel the deploy check job") all land on these tools. A session holds up to **50** scheduled tasks. The scheduler checks every second, enqueues due tasks at low priority, and fires them **between turns** — if Claude is mid-response, the prompt waits for the turn to end. ## Why 9:20: deterministic jitter To stop every session hitting the API at the same wall-clock moment, the scheduler adds an offset: - **Recurring tasks** fire **up to 30 minutes after** the scheduled time, or up to half the interval for tasks that run more often than hourly. An hourly job at `:00` may fire anywhere up to `:30`. - **One-shot tasks** scheduled for the top or bottom of the hour fire **up to 90 seconds early**. - The offset is **derived from the task ID**, so the same task always gets the same offset. That is why it is 9:20 every day rather than a different time each morning. The docs' advice when timing matters is to pick a minute that is not `:00` or `:30` — `3 9 * * *` instead of `0 9 * * *` — which also means the one-shot early-fire offset does not apply. All times are interpreted in your **local timezone**. `0 9 * * *` means 9am wherever Claude Code is running, not UTC. Someone who blames the twenty minutes on UTC conversion is looking at the wrong mechanism: a timezone mix-up shifts a fire by the zone's UTC offset, not by a steady twenty minutes. ## Why it vanished: the seven-day expiry **Recurring tasks expire seven days after creation.** The task fires one final time and then deletes itself. This bounds how long a forgotten loop can run. It applies to fixed `/loop` tasks and to self-paced loops alike. For a check that must run for months: 1. Cancel and recreate it before it expires, or 2. Move it to a durable scheduler — a Desktop scheduled task or a cloud routine. ## Session scope and resume These tasks belong to the session, which adds more ways for a schedule to go quiet: - Tasks fire only while Claude Code is **running and idle**. Close the terminal and they stop, unless you backgrounded the session, which carries `/loop` tasks into a background session. - There is **no catch-up**: if a fire time passes while Claude is busy on a long request, the task fires **once** when Claude becomes idle, not once per missed interval. - On `claude --resume` or `--continue`, Claude Code **restores** `CronCreate` tasks, except recurring tasks that have expired and one-shot tasks whose time has passed. A **self-paced `/loop` is not restored**; run `/loop` again. - Setting `CLAUDE_CODE_DISABLE_CRON=1` disables the scheduler entirely: the cron tools and `/loop` become unavailable and already-scheduled tasks stop firing. ## Cron syntax limits `CronCreate` accepts standard 5-field expressions with `*`, single values, steps (`*/15`), ranges (`1-5`) and lists (`1,15,30`). Extended syntax such as `L`, `W`, `?` and name aliases like `MON` or `JAN` is not supported. Day-of-week uses `0` or `7` for Sunday. When both day-of-month and day-of-week are constrained, a date matches if **either** matches, following vixie-cron semantics. ## Common mistakes - Reading the offset as random noise and expecting it to vary day to day. - Blaming UTC for a 20-minute delay. - Expecting a recurring task to run until the session closes, however long that is. - Expecting `--resume` to bring back a self-paced loop.

  • The morning check must run for months. What do you change?
    Session-scoped tasks can't do it: recurring ones expire after seven days and need the session alive. Either cancel and recreate the task before it expires, or move it to a durable scheduler — a Desktop scheduled task on your machine or a cloud routine, both of which persist across restarts.
  • Claude was busy on one request through two of a task's fire times. How many runs happen?
    One. Scheduled prompts fire between turns, so they wait for the current turn to end, and there is no catch-up: a task whose time passed while Claude was busy fires once when it becomes idle, not once per missed interval.
  • How do you inspect and cancel these tasks?
    Ask Claude what scheduled tasks you have, or rely on `CronList`, which shows IDs, schedules and prompts. Cancel one by its 8-character ID with `CronDelete`, or by describing it. `CLAUDE_CODE_DISABLE_CRON=1` turns the whole scheduler off.

  • Claude Code evaluates cron expressions in UTC, which explains the delay.
  • The jitter is random, so the fire time changes every day.
  • Recurring scheduled tasks run for as long as the session stays open.
  • A missed fire is replayed once for every interval that was missed.
  • claude --resume restores every task, self-paced loops included.