# Loop

Create a loop that runs a prompt now and follows up either on a fixed schedule or...

- Repository: https://github.com/QwenLM/qwen-code (28858 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add QwenLM/qwen-code --skill loop -g -a claude-code -y`
Codex: `npx skills add QwenLM/qwen-code --skill loop -g -a codex -y`
Cursor: `npx skills add QwenLM/qwen-code --skill loop -g -a cursor -y`
Gemini CLI: `npx skills add QwenLM/qwen-code --skill loop -g -a gemini-cli -y`

## Description

Create a loop that runs a prompt now and follows up either on a fixed schedule or through self-paced wakeups. Usage - /loop check the build, /loop 5m check the build, /loop check the PR every 30m. /loop list to show jobs, /loop clear to cancel all.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# /loop, run a prompt repeatedly

## Subcommands

If the input (after stripping the `/loop` prefix) is exactly one of these keywords, run the subcommand instead of scheduling:

- **`list`**, call CronList and display the results. Done.
- **`clear`**, call CronList, then call CronDelete for every job returned. Confirm how many were cancelled. Done.

## Parsing

Parse the input after removing the `/loop` prefix:

1. **Empty input** (no prompt, no interval): the **autonomous path**, run a self-paced autonomous loop. See the Autonomous mode section.
2. **Leading interval token**: if the first whitespace-delimited token matches `^\d+[smhd]$` (e.g. `5m`, `2h`), this is the fixed-interval recurring path. The rest is the prompt.
3. **Trailing "every" clause**: otherwise, if the input ends with `every <N><unit>` or `every <N> <unit-word>` (e.g. `every 20m`, `every 5 minutes`, `every 2 hours`), this is the fixed-interval recurring path. Extract that interval and strip it from the prompt. Only match when what follows "every" is a time expression, `check every PR` has no interval.
4. **Prompt-only input**: otherwise, the entire input is the prompt and this is the prompt-only self-paced path.

If an interval was given but the prompt is empty (e.g. `/loop 5m`), this is a fixed-interval **autonomous** loop, see the Autonomous mode section.

Examples:

The rest: https://github.com/QwenLM/qwen-code/blob/HEAD/packages/core/src/skills/bundled/loop/SKILL.md
