Skip to main content

Module scheduler

Module scheduler 

Source
Expand description

Session-scoped cron scheduler matching Claude Code’s /loop semantics.

The scheduler holds Tasks in memory and (optionally) persists them to disk so a --resume <session_id> can restore them. Each tick advances due tasks: recurring tasks have their next_fire updated; one-shot tasks are removed after firing. Recurring tasks expire 7 days after creation; their final fire is delivered, then they are removed.

See https://code.claude.com/docs/en/scheduled-tasks for the spec.

Re-exports§

pub use cron::CronExpr;
pub use maintenance::resolve_prompt;
pub use maintenance::BUILT_IN_MAINTENANCE_PROMPT;

Modules§

cron
5-field cron grammar wrapper.
jitter
Deterministic jitter for scheduled task fire times.
maintenance
Built-in maintenance prompt + loop.md discovery.
store
JSON persistence for super::Scheduler state.

Structs§

Fire
What Scheduler::tick returns for each due task.
Scheduler
Session-scoped cron scheduler.
Task
A scheduled prompt + its cadence + bookkeeping fields.
TaskId
8-character base32 task identifier.

Enums§

Schedule
What kind of cadence a Task runs on.
SchedulerError

Constants§

ALIAS_DISABLE_VAR
Crate-specific alias honored alongside CLAUDE_DISABLE_VAR.
CLAUDE_DISABLE_VAR
Env var that disables the scheduler entirely (matches Claude Code spec).
DEFAULT_MAX_TASKS
Session-scoped cap on concurrent tasks (matches Claude Code spec).
RECURRING_EXPIRY
Recurring tasks expire this long after creation.