Skip to main content
Task automation

Repeating Tasks

Overview

/loop lets Qoder CLI CN run the same prompt or slash command repeatedly. It suits polling status, continuous checks, and periodic repeated actions — for example "check the deployment every 5 minutes" or "look at the PR queue every half hour." /loop has two modes:
  • Fixed interval: give a time interval, and Qoder converts it into the corresponding recurring schedule and creates a scheduled task.
  • Dynamic pacing: give no interval, and the Agent decides the timing of the next check on its own based on task progress — good for monitoring tasks with no fixed rhythm, like "watch CI until it goes green."
If you need a more precise calendar schedule (such as "every Monday at 9 AM"), use scheduled tasks instead — see Scheduled Tasks.

Command format

/loop [interval] <prompt>
  • interval: optional time interval. When specified, the task runs at a fixed interval; when omitted, dynamic pacing mode kicks in and the Agent decides the timing of the next run.
  • prompt: the prompt or slash command to run repeatedly.
Examples:
/loop 5m /babysit-prs
/loop 30m check the deploy
/loop 1h /standup 1
/loop monitor CI pipeline       # no interval — dynamic pacing
/loop check the deploy every 20m
After creation, Qoder runs the prompt once immediately instead of waiting for the first cycle.

Interval syntax

In fixed-interval mode, an interval consists of a number plus a unit, with four supported units:
UnitMeaningExample
sseconds30s
mminutes5m
hhours2h
ddays1d
The minimum granularity is 1 minute. Since the underlying scheduler has no seconds field, seconds are rounded up to the nearest whole minute — e.g. 30s is treated as 1m, and Qoder tells you the actual rounded interval. Interval-to-Cron conversion rules:
IntervalResulting scheduleNotes
Nm (N ≤ 59)every N minutes
Nm (N ≥ 60)rounded to hoursmust divide 24 hours evenly
Nh (N ≤ 23)every N hours
Ndevery N days at midnight (local time)
Nsrounded up to minutesminimum 1 minute
If an interval doesn't divide its unit evenly (e.g. 7m produces an uneven gap from :56 to :00, and 90m can't be expressed on the hour), Qoder picks the nearest clean interval and tells you what it rounded to before creating the task.

Two ways to write it

The interval can go at the beginning, or be expressed with a trailing every clause:
  • Leading interval: /loop 5m check the deploy → interval 5m, prompt check the deploy.
  • Trailing every clause: /loop check the deploy every 20m → interval 20m, prompt check the deploy. Natural phrasings like every 5 minutes and every 2 hours are also supported.
Note that every counts as an interval only when followed by a time expression. For example, in /loop check every PR the every is not a time expression — it is treated as part of the prompt, and the whole command enters dynamic pacing mode.

Automatic expiry and cancellation

A fixed-interval /loop creates a recurring task that expires automatically 7 days after creation. If you need it to run long-term, recreate it after expiry. After successful creation, Qoder tells you what was scheduled, the corresponding cycle, the automatic expiry time, and the task id used for cancellation. To stop early, ask Qoder to cancel the loop task by that id. In dynamic pacing mode, the loop ends when the Agent no longer schedules the next wake-up. For the full parameters, defaults, and expiry rules, see Loop Command Reference.