Skip to main content
Reference

Scheduled Tasks Reference

Field-level reference for scheduled tasks: cron expression syntax, storage location, runtime limits, and auto-expiry rules

Scheduled tasks let Qoder CLI CN automatically trigger a prompt or slash command at a specified time. This page covers the cron expression format, storage location, and runtime limits. For the usage guide, see Scheduled Tasks.

Cron expression format

Scheduled tasks use standard 5-field cron expressions, interpreted in the local time zone of the machine running the CLI:
┌───────── minute (0-59)
│ ┌─────── hour (0-23)
│ │ ┌───── day of month (1-31)
│ │ │ ┌─── month (1-12)
│ │ │ │ ┌─ day of week (0-6, 0 = Sunday; 7 also treated as Sunday)
│ │ │ │ │
* * * * *
Supported field syntax:
SyntaxMeaningExample
*Wildcard, matches all* * * * * (every minute)
NSingle value0 9 * * * (every day at 9:00)
*/NStep, every N units*/15 * * * * (every 15 minutes)
N-MRange0 9-17 * * * (on the hour from 9 to 17)
N,M,...List0 9,12,18 * * * (at 9/12/18 daily)
L, W, ?, and name aliases are not supported. When both day-of-month and day-of-week are constrained, OR semantics apply — either match triggers (standard cron behavior).
Common examples:
ExpressionMeaning
*/10 * * * *Every 10 minutes
0 * * * *Every hour on the hour
0 9 * * *Every day at 9:00
0 9 * * 1-5Weekdays at 9:00
0 0 */2 * *Every 2 days at 0:00

Storage location

Persistent scheduled tasks are stored in .qoder/scheduled_tasks.json under the project. File format:
{
  "tasks": [
    {
      "id": "a1b2c3d4",
      "cron": "0 9 * * *",
      "prompt": "/standup",
      "createdAt": 1700000000000,
      "recurring": true
    }
  ]
}
Task fields:
FieldDescription
idAn 8-digit hexadecimal task identifier.
cronA 5-field cron expression.
promptThe prompt text or slash command enqueued when triggered.
createdAtCreation timestamp (milliseconds).
lastFiredAtLast trigger timestamp (milliseconds; written back for recurring tasks).
recurringWhether the task is recurring.

Task types

  • One-shot tasks (recurring false or absent): deleted automatically after firing once.
  • Recurring tasks (recurring: true): fire repeatedly on the cycle, rescheduled from the current time, until explicitly deleted or automatically expired.

Runtime limits and expiry

  • Maximum task count: at most 50 tasks; once the limit is reached, existing tasks must be deleted before new ones can be created.
  • Auto-expiry: recurring tasks expire and are cleaned up automatically 7 days after creation (one-shot tasks are deleted after firing).
  • Jittered scheduling: to avoid multiple sessions firing at the same instant, the scheduler adds deterministic jitter — recurring tasks are delayed by up to 10% of their interval (capped at 15 minutes); one-shot tasks aligned to 30-minute boundaries may fire up to 90 seconds early. Jitter is derived from the task ID and stable across restarts.
  • Missed tasks: if a task's next scheduled run time is already in the past (missed while the process was not running), a notice is shown at startup.
  • Single-process driving: within the same project directory, a file lock ensures only one process drives the scheduler, avoiding duplicate triggers.

Creating and deleting

  • Create, list, and delete tasks through the Agent's scheduled-task tools (just ask in natural language in the conversation).
  • Recurring tasks can be created quickly with /loop — see Loop Command Reference.
  • Recurring tasks can be deleted manually before their 7-day auto-expiry.

Next steps