Agent skill

Recurring Prompt Loop

by XiaomiMiMo in XiaomiMiMo/MiMo-Code

Turns a prompt with an interval such as 5m or every 2 hours into a cron job and runs the prompt once right away, rounding awkward intervals to clean ones.

MITAuto-check passedProductivity & Automation

Install Recurring Prompt Loop

skills CLI
$ npx skills add XiaomiMiMo/MiMo-Code --skill loop -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install XiaomiMiMo/MiMo-Code loop --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/loop .claude/skills/loop && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
loop
GitHub stars
14k
Token cost
~1.3k tokens
SKILL.md length
734 words
Files
1
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

Turns a prompt with an interval such as 5m or every 2 hours into a cron job and runs the prompt once right away, rounding awkward intervals to clean ones.

  • Works in 7 steps: Parse the input → Special: empty prompt with autonomous… → Map interval → 5-field cron expression → …
  • Running a check or prompt on a fixed schedule
  • SKILL.md covers 1. Parse the input, 2. Special: empty prompt with…, 3. Map interval → 5-field cron… and 4. Call the cron tool, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill handles the `/loop` command. It reads the interval from a leading token like `5m`, `2h`, `1d` or `30s`, or from a trailing clause such as every 20m or every 5 minutes, and defaults to `10m` when neither appears. Input with no prompt body gets a one-line usage hint and nothing is scheduled. The agent registers the job through the `cron` tool and runs the prompt once immediately, so you see activity before the first scheduled tick.

Intervals are mapped to five-field cron expressions in UTC. Seconds round up to at least one minute, and minutes, hours and days must divide their cycle cleanly. When they do not, such as `7m` or `5h`, the agent picks the nearest clean value and tells you what it chose and why. In projects that have opted into autonomous-loop mode, an interval with no prompt schedules a self-directed tick instead. The excerpt is cut off after the rounding rules.

When your agent uses it

  • Running a check or prompt on a fixed schedule
  • Babysitting a long task by re-checking it every few minutes
  • Setting up a recurring daily or hourly agent task with the loop command

Example prompts

  • “/loop 5m check whether the staging deploy has finished and tell me when it has.”
  • “Run the dependency audit every 2 hours and summarize new findings.”
  • “/loop 7m watch the build queue. Round the interval if it needs to.”

Requirements

  • A runtime that provides a `cron` tool

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Parse the input
  2. Special: empty prompt with autonomous opt-in
  3. Map interval → 5-field cron expression
  4. Call the cron tool
  5. Execute the prompt once immediately
  6. Examples
  7. Do not

What it can do on your machine

Read from SKILL.md and the folder at commit 6babeb0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Recurring Prompt Loop loads about 1.3k tokens when it runs. Until then it costs about 105 tokens; SKILL.md has 734 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~105
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from XiaomiMiMo/MiMo-Code at commit 6babeb0, republished under its MIT licence (© XiaomiMiMo). 734 words, ~1,314 tokens.

Download SKILL.mdSave it as .claude/skills/loop/SKILL.md (or your agent's skills folder).
name
loop
description
Schedule a prompt to fire on a fixed cadence (recurring loop). Use when the user asks to "run X every N minutes/hours/days", "loop X", "babysit Y", "be proactive about Y every N", or invokes `/loop` directly. Parses `[interval] <prompt>`, picks a clean cron expression, registers the job via the `cron` tool, and executes the prompt once immediately so the user sees activity without waiting for the first cron tick.

/loop — schedule a recurring prompt

This skill turns a free-form [interval] <prompt> line into a cron tool call and runs the prompt once right away.

1. Parse the input

The user's text is whatever appears after /loop . Apply the three rules below in order and stop at the first match.

  1. Leading interval token. If the first whitespace-separated token matches the regex ^\d+[smhd]$ (case-insensitive), that token is the interval. Examples: 5m, 2h, 1d, 30s. The rest of the input is the prompt.

  2. Trailing every <N><unit> clause. Otherwise, look for a clause at the end of the input of the form every <N><unit> or every <N> <unit-word> where <unit> is s|m|h|d and <unit-word> is second(s)|minute(s)|hour(s)|day(s). Strip the clause; what's left is the prompt; the captured <N><unit> is the interval. Examples: every 20m, every 5 minutes, every 2 hours.

  3. Default. No interval found → interval is 10m, the whole input is the prompt.

If the input is empty, or is only an interval with no prompt body, reply with a one-line usage hint (/loop [interval] <prompt>) and stop. Do not schedule anything.

2. Special: empty prompt with autonomous opt-in

When the user types /loop <interval> (interval only) and the project has explicitly opted into autonomous-loop mode (a session-level flag the runtime sets), the prompt body is the sentinel <<autonomous-loop>>. The scheduler expands this sentinel at fire time into a self-directed tick instruction. If autonomous mode is not enabled, treat empty as the usage-hint case above.

3. Map interval → 5-field cron expression

PatternCron expression
Nstreat as ceil(N/60)m; minimum is 1m
Nm where N is 1–59 and divides cleanly (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30)*/N * * * *
Nm where N ≥ 60 and N/60 divides 24 (1, 2, 3, 4, 6, 8, 12)0 */(N/60) * * *
Nh where N is 1–23 and divides 240 */N * * *
Nd where N divides 31 sensibly (1, 2)0 0 */N * *

Cron fields are UTC. These interval patterns are timezone-agnostic; the Nd row fires at midnight UTC, not local midnight.

Rounding rule. If N does not divide its wrap-around cleanly (e.g. 7m, 90m, 5h, 7d), pick the nearest interval that does and tell the user explicitly what you rounded to and why. Acceptable nearby values:

  • minutes < 60: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30
  • hours: 1, 2, 3, 4, 6, 8, 12
  • days: 1, 2

Examples of rounding messages:

  • 7m → "rounding 7m to 6m so the fires stay evenly spaced; */7 skews at the hour wrap"
  • 90m → "rounding 90m to 2h; cron's hour field can't express 1.5h"
Show full SKILL.md (306 more words)Show less

4. Call the cron tool

With the parsed cron expression and prompt, invoke the cron tool's schedule verb. Use whichever call form the tool's own prompt describes — pass cron and prompt as required, leave durable: false (the default; only set true when the user explicitly asked the job to persist across sessions), leave it recurring (the default; one-shot is wrong for /loop — one-shots come from natural-language scheduling).

The cron tool returns a job id. Mention it briefly so the user can cancel with /loops cancel <id>.

5. Execute the prompt once immediately

After the cron call succeeds, do not wait for the first scheduled tick. Run the prompt body once right now:

  • If the prompt starts with / (e.g. /loop 5m /standup → prompt is /standup), invoke it as a slash command — load the corresponding skill or command via the skill tool.
  • Otherwise, act on the prompt directly in this turn.

This is the "don't make the user wait" rule. The cron job carries the recurring behavior; the immediate run is for responsiveness.

6. Examples

User inputIntervalCronPrompt
/loop 5m /babysit-prs5m (leading)*/5 * * * */babysit-prs
/loop check the deploy every 20m20m (trailing)*/20 * * * *check the deploy
/loop /standup every 2 hours2h0 */2 * * */standup
/loop tidy inbox10m (default)*/10 * * * *tidy inbox
/loop 30s ping30s → 1m*/1 * * * *ping
/loop 7m ping7m → 6m (rounded, explain)*/6 * * * *ping
/loop(usage hint)——
/loop 5mautonomous-only(if enabled)<<autonomous-loop>>

7. Do not

  • Do not invent intervals the user didn't ask for. If unsure, default to 10m and say so.
  • Do not pass --one-shot. This skill is for recurring loops.
  • Do not list active jobs in your reply. Use /loops for that.
  • Do not re-derive the cron expression in your reply unless the user asked. A one-line confirmation ("scheduled <prompt> every <interval>; job id <id>") is enough.

© XiaomiMiMo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/cli/src/skill/builtin/.bundle/loop of XiaomiMiMo/MiMo-Code.

Open the folder on GitHubat commit 6babeb0

Compare with similar skills

Recurring Prompt Loop next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Recurring Prompt Loop compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Recurring Prompt Loop this skillXiaomiMiMo/MiMo-Code14k—~1.3kAutomated safety check: PassMIT
Aeon Agent Setup and Managementaeonfun/aeon767—~8.8kAutomated safety check: WarnMIT
Harness 24hthu-nmrc/OpenHarness116—~3.6kAutomated safety check: PassApache-2.0
Autonomous Agent Harnessaffaan-m/ECC274k2 repos~2.9kAutomated safety check: PassMIT
AI Automation WorkflowsNeverSight/learn-skills.dev2161 repos~2.6kAutomated safety check: PassNone
Recurring Prompt LoopQwenLM/qwen-code28k—~2.5kAutomated safety check: PassApache-2.0

Similar skills

  • Sets up and manages an Aeon agent instance that runs skills on a schedule through GitHub Actions: starting, rescheduling, debugging, editing skills and mining chat history.

    767 GitHub stars~8.8k tokensUpdated yesterday
    Productivity & AutomationAuto-check: warnings
  • Harness 24h

    thu-nmrc/OpenHarness

    A production-grade framework for long-running, autonomous agents based on Harness Engineering principles.

    116 GitHub stars~3.6k tokensUpdated 6 mo ago
    Agent WorkflowsAuto-check passed
  • Transform Claude Code into a fully autonomous agent system with persistent memory, scheduled operations, computer use, and task queuing.

    274k GitHub starsUsed in 2 repos~2.9k tokens
    Agent WorkflowsAuto-check passed
  • AI Automation Workflows

    NeverSight/learn-skills.dev

    Build automated AI workflows combining multiple models and services.

    216 GitHub starsUsed in 1 repo~2.6k tokens
    Productivity & AutomationAuto-check passed
  • Recurring Prompt Loop

    QwenLM/qwen-code

    Runs a prompt now and repeats it on a fixed interval or through self-paced wakeups, with subcommands to list or clear scheduled loop jobs.

    28k GitHub stars~2.5k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Claude Codeを永続的なメモリ、スケジュール済み操作、コンピュータ使用、タスクキューイングを備えた完全自動エージェントシステムに変換します。スタンドアロンエージェントフレームワーク(Hermes、AutoGPT)を、Claude Codeのネイティブcrons、dispatch、MCPツール、メモリを活用して置き換えます。ユーザーが継続的な自動操作、スケジュール済みタスク、または自己指令…

    274k GitHub stars~859 tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed

More from XiaomiMiMo/MiMo-Code

All 22 skills in this repo
  • Paper Research on arXiv

    XiaomiMiMo/MiMo-Code

    Searches arXiv, fetches metadata, generates BibTeX, downloads PDFs and finds citations and related papers using a bundled Python script.

    14k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Agent Skill Creator

    XiaomiMiMo/MiMo-Code

    Interactive guide for creating, reviewing and fixing agent skills (SKILL.md folders), covering structure, frontmatter rules, trigger phrases and validation before sharing.

    14k GitHub stars~1.9k tokensUpdated 4 days ago
    Auto-check passed
  • DOCX Toolkit

    XiaomiMiMo/MiMo-Code

    Produces, edits and reads Microsoft Word files through python-docx and lxml, with a decision table for picking the lightest workflow for a given task.

    14k GitHub stars~2.4k tokensUpdated 4 days ago
    Auto-check passed
  • Drive MiMo Code

    XiaomiMiMo/MiMo-Code

    Lets one MiMoCode process drive another, headless with JSON events or interactively through tmux, to test behavior and visual regressions with parseable evidence.

    14k GitHub stars~3.9k tokensUpdated 4 days ago
    Auto-check passed
  • PDF Toolkit

    XiaomiMiMo/MiMo-Code

    Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.

    14k GitHub stars~1.7k tokensUpdated 4 days ago
    Auto-check passed
  • XLSX Spreadsheet Toolkit

    XiaomiMiMo/MiMo-Code

    Builds, edits, cleans, recalculates and reads Excel workbooks and CSV files with openpyxl and pandas, plus LibreOffice for recalculation and PDF export.

    14k GitHub stars~2.9k tokensUpdated 4 days ago
    Auto-check passed

Questions about Recurring Prompt Loop

What does Recurring Prompt Loop do?

Turns a prompt with an interval such as 5m or every 2 hours into a cron job and runs the prompt once right away, rounding awkward intervals to clean ones. This skill handles the `/loop` command. It reads the interval from a leading token like `5m`, `2h`, `1d` or `30s`, or from a trailing clause such as every 20m or every 5 minutes, and defaults to `10m` when neither appears.

When should I use Recurring Prompt Loop?

Recurring Prompt Loop fits situations like: running a check or prompt on a fixed schedule; babysitting a long task by re-checking it every few minutes; setting up a recurring daily or hourly agent task with the loop command.

How do I install Recurring Prompt Loop in Claude Code?

Run `npx skills add XiaomiMiMo/MiMo-Code --skill loop -a claude-code`. Or copy the skill folder (packages/cli/src/skill/builtin/.bundle/loop in XiaomiMiMo/MiMo-Code) into .claude/skills/loop in your project. Claude Code loads it when a task matches its description.

How do I install Recurring Prompt Loop in Codex?

Run `npx skills add XiaomiMiMo/MiMo-Code --skill loop -a codex`. Or copy the skill folder (packages/cli/src/skill/builtin/.bundle/loop in XiaomiMiMo/MiMo-Code) into .agents/skills/loop in your project. Codex loads it when a task matches its description.

Can I use Recurring Prompt Loop in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add XiaomiMiMo/MiMo-Code --skill loop -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/loop, .gemini/skills/loop, .github/skills/loop and .opencode/skills/loop in your project.

What does Recurring Prompt Loop need to run?

SKILL.md names no scripts, command-line tools or credentials: Recurring Prompt Loop is instructions for the agent only. Our summary lists: A runtime that provides a `cron` tool.

Does Recurring Prompt Loop access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Recurring Prompt Loop safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Recurring Prompt Loop use?

Recurring Prompt Loop is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Recurring Prompt Loop use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Recurring Prompt Loop?

Skills that share tags, products or a category with Recurring Prompt Loop: Aeon Agent Setup and Management (aeonfun/aeon, 767 stars), Harness 24h (thu-nmrc/OpenHarness, 116 stars), Autonomous Agent Harness (affaan-m/ECC, 274k stars) and AI Automation Workflows (NeverSight/learn-skills.dev, 216 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Recurring Prompt Loop?

XiaomiMiMo (a GitHub organization) maintains it in XiaomiMiMo/MiMo-Code, which has 13,601 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 3, 2026.

Source: XiaomiMiMo/MiMo-Code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.