loop

loop is a skill for Claude Code, Codex from x-cmd/x-cmd. It costs 25 tokens per session (394 once invoked), scanned A, original, Apache-2.0.

A scheduler for running a command or monitoring task repeatedly at a chosen interval. It uses cron, a standard system service for timed jobs, and can store or notify you about results.

In plain words
What is it for?
Use it to monitor something every few minutes, hours, or days, configure where results go, and later cancel the scheduled job.
Why use it?
It removes the need to remember recurring checks or run them manually. It also runs the task immediately so you can see an initial result.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to monitor something every few minutes, hours, or days, configure where results go, and later cancel the scheduled job.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/x-cmd/x-cmd/loop
About the project

X-CMD is a POSIX-shell toolkit that provides reusable shell modules and on-demand command-line packages for bash, zsh, ash, and dash. It is designed for people and AI agents that need shell utilities, integrations, and agent-related workflows, and the catalogue contains a large collection of skills for using it.

x-cmd/x-cmd · 4,717 stars · on GitHub · x-cmd.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add x-cmd/x-cmd --skill loop
Clone the repo
git clone --depth 1 https://github.com/x-cmd/x-cmd

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/x-cmd/x-cmd/loop/github.svg)](https://agentmods.dev/skills/x-cmd/x-cmd/loop)
Your own site
<a href="https://agentmods.dev/skills/x-cmd/x-cmd/loop"><img src="https://agentmods.dev/badge/skills/x-cmd/x-cmd/loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/x-cmd/x-cmd/loop"><img src="https://agentmods.dev/badge/skills/x-cmd/x-cmd/loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 394 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 3
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00394
Opus 5.5 $0.00010 $0.00158
Sonnet 5.5 $0.00005 $0.00079
Haiku 4.5 $0.00003 $0.00039

Measured 1mo ago against content hash eac6df3133f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

mod/slash/lib/preset/loop/SKILL.md · 74 lines

What it actually says

Loop Runner

Trigger

Use when:

  • User says /loop <interval> <prompt>
  • User wants recurring monitoring or periodic execution

Steps

Step 1: Parse Arguments

/loop <interval> <prompt>

Interval patterns:

Pattern Cron Expression
Nm (N ≤ 59) */N * * * *
Nh (N ≤ 23) 0 */N * * *
Nd 0 0 */N * *

Round non-dividing intervals to nearest clean value.

Step 2: Clarify Intent

Ask user:

  1. What to monitor (parse prompt)
  2. How to execute (which x-cmd module or command)
  3. Where to store results

Step 3: Configure Notification

Ask before creating:

  • Memory (default) — store for later review
  • Mailbox — notification on new results
  • Other user-specified method

Step 4: Create Cron Job

x cron add \
    --name "loop-$(date +%Y%m%d%H%M%S)" \
    --desc "<description>" \
    "<cron-expression>" \
    "<full-command>"

Step 5: Execute Immediately

Run the command now; do not wait for first cron fire.

Step 6: Confirm

Report to user:

  • Job name and cron expression
  • Human-readable cadence
  • Monitoring target
  • Result storage location
  • Cancellation: x cron rm <name>

Constraints

  • Always ask about result storage before creating
  • Always execute immediately
  • Round messy intervals and inform user
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 74 lines · 25 tokens per session scan A eac6df3133f2

Subscribe to this mod's changes

loop is a skill published in the GitHub repository x-cmd/x-cmd (4,717 stars, last pushed 7d ago), licensed Apache-2.0. It adds 25 tokens to every session and 394 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

completion-script-generator

Generates shell completion scripts for CLI tools. Parses command structure from help output, commander/yargs configs, or manual specification. Produces completions for bash, zsh, and fish that follow each shell's conventions.

curiositech/windags-skills · 50 tokens

dnanexus-integration

DNAnexus cloud genomics platform. Build apps/applets, manage data (upload/download), dxpy Python SDK, run workflows, FASTQ/BAM/VCF, for genomics pipeline development and execution.

synthetic-sciences/openscience · 49 tokens

latchbio-integration

Latch platform for bioinformatics workflows. Build pipelines with Latch SDK, @workflow/@task decorators, deploy serverless workflows, LatchFile/LatchDir, Nextflow/Snakemake integration.

synthetic-sciences/openscience · 45 tokens

lambda-gpu-cloud

Safely inspect and operate Lambda Cloud GPU instances through the documented Cloud API and SSH, with explicit approval before billable or destructive actions.

synthetic-sciences/openscience · 32 tokens

modal-serverless-gpu

Run approved CPU or GPU work through OpenScience computejob on the user's configured Modal account. Use for isolated scientific scripts, dependency provisioning, durable outputs, logs, status, cancellation, and recovery. Never invoke the Modal SDK or CLI directly.

synthetic-sciences/openscience · 54 tokens

tensorpool-gpu-cloud

Safely inspect and operate TensorPool GPU clusters and jobs using the current tp CLI, with explicit approval before any billable or destructive action.

synthetic-sciences/openscience · 34 tokens