Qwen-code loop
Create a recurring loop that runs a prompt on a schedule. Usage - /loop 5m check the build, /loop check the PR every 30m, /loop run tests (defaults to 10m). /loop list to show jobs, /loop clear to cancel all.
install
source · Clone the upstream repo
git clone https://github.com/QwenLM/qwen-code
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/QwenLM/qwen-code "$T" && mkdir -p ~/.claude/skills && cp -r "$T/packages/core/src/skills/bundled/loop" ~/.claude/skills/qwenlm-qwen-code-loop && rm -rf "$T"
manifest:
packages/core/src/skills/bundled/loop/SKILL.mdsource content
/loop — schedule a recurring prompt
Subcommands
If the input (after stripping the
/loop prefix) is exactly one of these keywords, run the subcommand instead of scheduling:
— call CronList and display the results. Done.list
— call CronList, then call CronDelete for every job returned. Confirm how many were cancelled. Done.clear
Otherwise, parse the input below into
[interval] <prompt…> and schedule it with CronCreate.
Parsing (in priority order)
- Leading token: if the first whitespace-delimited token matches
(e.g.^\d+[smhd]$
,5m
), that's the interval; the rest is the prompt.2h - Trailing "every" clause: otherwise, if the input ends with
orevery <N><unit>
(e.g.every <N> <unit-word>
,every 20m
,every 5 minutes
), extract that as the interval and strip it from the prompt. Only match when what follows "every" is a time expression —every 2 hours
has no interval.check every PR - Default: otherwise, interval is
and the entire input is the prompt.10m
If the resulting prompt is empty, show usage
/loop [interval] <prompt> and stop — do not call CronCreate.
Examples:
→ interval5m /babysit-prs
, prompt5m
(rule 1)/babysit-prs
→ intervalcheck the deploy every 20m
, prompt20m
(rule 2)check the deploy
→ intervalrun tests every 5 minutes
, prompt5m
(rule 2)run tests
→ intervalcheck the deploy
, prompt10m
(rule 3)check the deploy
→ intervalcheck every PR
, prompt10m
(rule 3 — "every" not followed by time)check every PR
→ empty prompt → show usage5m
Interval → cron
Supported suffixes:
s (seconds, rounded up to nearest minute, min 1), m (minutes), h (hours), d (days). Convert:
| Interval pattern | Cron expression | Notes |
|---|---|---|
where N ≤ 59 | | every N minutes |
where N ≥ 60 | | round to hours (H = N/60, must divide 24) |
where N ≤ 23 | | every N hours |
| | every N days at midnight local |
| treat as | cron minimum granularity is 1 minute |
If the interval doesn't cleanly divide its unit (e.g.
7m → */7 * * * * gives uneven gaps at :56→:00; 90m → 1.5h which cron can't express), pick the nearest clean interval and tell the user what you rounded to before scheduling.
Action
- Call CronCreate with:
: the expression from the table abovecron
: the parsed prompt from above, verbatim (slash commands are passed through unchanged)prompt
:recurringtrue
- Briefly confirm: what's scheduled, the cron expression, the human-readable cadence, that recurring tasks auto-expire after 3 days, and that they can cancel sooner with CronDelete (include the job ID).
- Then immediately execute the parsed prompt now — don't wait for the first cron fire. If it's a slash command, invoke it via the Skill tool; otherwise act on it directly.