Skip to main content
Task Automation

Loop Task (/loop)

Overview

/loop enables Qoder CLI to repeatedly run the same prompt or slash command at fixed time intervals. It is ideal for scenarios such as polling status, continuous checking, and periodic repetitive actions, for example, "check deployments every 5 minutes" or "check the PR queue every half hour". /loop is a simplified entry point for scheduled tasks: you only need to provide a time interval, and Qoder will convert it into the corresponding periodic schedule and create the task. If you need a more precise calendar schedule (e.g., "every Monday at 9 AM"), please use scheduled tasks. See Scheduled Execution Task.

Command Format

/loop [interval] <prompt>
  • interval: Optional time interval. If not specified, it defaults to 10 minutes (10m).
  • prompt: The prompt or slash command to run repeatedly.
Example:
/loop 5m /babysit-prs
/loop 30m check the deploy
/loop 1h /standup 1
/loop check the deploy          # No interval specified, defaults to 10m
/loop check the deploy every 20m
Once created, Qoder will execute the prompt immediately rather than waiting for the first interval to begin.

Interval Syntax

An interval consists of a number followed by a unit. Four units are supported:
UnitMeaningExample
sSeconds30s
mMinutes5m
hHours2h
dDays1d
The minimum granularity is 1 minute. Since the underlying scheduler does not support second-level fields, seconds are rounded up to the nearest whole minute. For example, 30s is treated as 1m, and Qoder will inform you of the actual rounded interval. Interval to Cron conversion rules:
IntervalCorresponding ScheduleDescription
Nm (N ≤ 59)Every N minutes
Nm (N ≥ 60)Rounded to hoursMust evenly divide 24 hours
Nh (N ≤ 23)Every N hours
NdMidnight every N days (local time)
NsRounded up to minutesMinimum 1 minute
If the interval does not evenly divide its unit (e.g., 7m would result in uneven intervals from :56 to :00, and 90m cannot be expressed in whole hours), Qoder will select the nearest clean interval and inform you of the rounded value before creation.

Two Formats

The interval can be placed at the beginning or expressed using an every clause at the end:
  • Interval at the beginning: /loop 5m check the deploy → interval 5m, prompt check the deploy.
  • every clause at the end: /loop check the deploy every 20m → interval 20m, prompt check the deploy. Natural expressions like every 5 minutes and every 2 hours are also supported.
Note that every is treated as an interval only when followed by a time expression. For example, in /loop check every PR, every is not a time expression and will be treated as part of the prompt, with the interval defaulting to 10m.

Automatic Expiration and Cancellation

Tasks created with /loop are periodic tasks and will automatically expire 7 days after creation. If long-term execution is required, simply recreate the task upon expiration. Upon successful creation, Qoder will display the scheduled content, the corresponding cycle, the automatic expiration time, and the task ID for cancellation. To stop it early, simply ask Qoder to cancel the corresponding loop task using this ID. For complete parameters, default values, and expiration rules, see the /loop Command Reference.
Loop Task (/loop) - Qoder