Overview
Scheduled tasks allow Qoder CLI to automatically run a prompt or slash command at a specified time. You can schedule a task to run once at a future point in time, or repeatedly on a calendar schedule. This is ideal for scheduled inspections, periodic reports, and planned automation scenarios.
There are two types of scheduled tasks:
- One-shot task: Triggered once at the next matching time, then automatically deleted.
- Periodic Task: Triggered repeatedly according to a Cron schedule until deleted or automatically expired.
Creating Scheduled Tasks
In an interactive session, describe the time and the action in natural language, and Qoder will create the scheduled task for you. For example:
/loop. See Loop Tasks.
Cron Expression
Scheduled tasks use a 5-field Cron Expression:
*, Single Value N, Step */N, Range N-M, List N,M,.... In the day-of-week field, 7 is treated as Sunday (equivalent to 0).
L, W, ?, and Name Alias (such as MON) are not supported, nor is there a seconds field.
Examples:
| Cron | Meaning |
|---|---|
*/5 * * * * | Every 5 minutes |
0 * * * * | Every hour on the hour |
0 9 * * * | Every day at 9:00 AM |
30 14 28 2 * | February 28 at 2:30 PM (once in the current year) |
0 10 * * 1 | Every Monday at 10:00 AM |
0 9 * * 1-5 | Weekdays at 9:00 AM |
All times are interpreted in the local time zone where the CLI is running. For example, 0 9 * * * means 9:00 AM every day in the CLI's time zone.
Storage and Persistence
The persistence behavior of scheduled tasks falls into two categories:
- persistent task: Written to
<project>/.qoder/scheduled_tasks.jsonin the project root directory, and persists across process restarts. - in-session task: Stored only in memory, and disappears when the current session ends.
Execution Limits
Scheduled tasks have the following limits:
- Maximum number of tasks: Up to 50 tasks. Once the limit is reached, you must delete existing tasks before creating new ones.
- Periodic Task auto-expiration: Periodic tasks automatically expire 7 days after creation, unless deleted earlier. Tasks that need to run long-term must be recreated.
- Minimum granularity: Since there is no seconds field, the minimum scheduling granularity is 1 minute.
- Single-process driven: A file lock ensures that only one process drives the scheduling for the same project directory, preventing duplicate triggers.