The parameter format, interval units, dynamic pacing mode, and cancellation for /loop
/loop makes Qoder CLI CN run a prompt or slash command repeatedly: with an interval specified, it runs at a fixed interval through the scheduled task system; without an interval, it enters dynamic pacing mode, where the Agent decides the timing of each wake-up on its own. This page covers its parameter format, interval conversion, and cancellation. For the usage guide to looped execution, see Repeating Tasks.
Usage
[interval](optional): the execution interval. Specifying it means fixed-interval mode; omitting it enters dynamic pacing mode, where the Agent decides the timing of the next run based on the task (each between 60 seconds and 1 hour).<prompt>(required): the prompt text or slash command to run repeatedly. Empty input shows the usage message.
Interval units
In fixed-interval mode, an interval consists of a number plus a unit suffix:
| Suffix | Unit | Description |
|---|---|---|
s | seconds | Rounded up to the nearest minute (minimum granularity 1 minute). |
m | minutes | Every N minutes. |
h | hours | Every N hours. |
d | days | Every N days (triggered at local midnight). |
The minimum granularity is 1 minute. Second-based intervals are rounded up to ceil(N/60) minutes, and you are notified of the rounding.
Parsing rules
/loop parses input in this priority order:
- Leading token: if the first word matches
^\d+[smhd]$(such as5m,2h), it is taken as the interval and the rest as the prompt, entering fixed-interval mode. - Trailing every clause: otherwise, if the input ends with
every <N><unit>orevery <N> <unit-word>(such asevery 20m,every 5 minutes), the interval is extracted and removed from the prompt, entering fixed-interval mode. This matches only wheneveryis followed by a time expression —check every PRcontains no interval. - Dynamic pacing: otherwise, dynamic pacing mode kicks in with the entire input as the prompt, and the execution rhythm is decided by the Agent; if the Agent no longer schedules the next wake-up, the loop ends.
Examples
Interval-to-cron conversion
In fixed-interval mode, intervals convert to cron schedules by these rules:
| Interval pattern | Cron expression | Description |
|---|---|---|
Nm (N ≤ 59) | */N * * * * | Every N minutes |
Nm (N ≥ 60) | 0 */H * * * | Converted to hours (H = N/60, must divide 24) |
Nh (N ≤ 23) | 0 */N * * * | Every N hours |
Nd | 0 0 */N * * | Every N days at midnight |
Ns | treated as ceil(N/60)m | Cron's minimum granularity is 1 minute |
7m producing uneven gaps, or 90m being inexpressible in cron), the nearest clean interval is chosen and you are told the rounding result before the task is created.
Cancellation and expiry
- Fixed-interval loop tasks expire automatically 7 days after creation.
- You can manually delete the corresponding scheduled task before expiry (ask the Agent in natural language, providing the task ID).
- In dynamic pacing mode, the loop ends when the Agent no longer schedules the next wake-up.
- After a loop task is created, the prompt runs once immediately without waiting for the first cron trigger.
Next steps
- /loop usage guide: Repeating Tasks.
- The underlying scheduled task mechanism: Scheduled Tasks Reference.