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

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,640 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.

agentmods
npx agentmods add skills/x-cmd/x-cmd/loop
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00013 $0.00197
Sonnet 5 $0.00005 $0.00079
Haiku 4.5 $0.00003 $0.00039

Measured 2d ago against content hash eac6df3133f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 2d 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. 2d 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,640 stars, last pushed yesterday), licensed Apache-2.0. It adds 25 tokens to every session and 394 once invoked, about $0.0001 per session on Opus 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

warpctrl

Control and inspect the currently running local Warp application with the warpctrl CLI. Use this skill whenever the user asks the agent to manipulate Warp's own windows, tabs, panes, sessions, input buffer, themes, or UI surfaces; open a file in Warp; inspect local Warp state; or explain how to invoke Warp Control…

warpdotdev/warp · 69 tokens

cross-platform-cloud-verification

Orchestrates cost-conscious cloud verification across available operating-system and architecture runners after cheaper checks pass. Use whenever a code change, bug fix, build, packaging flow, native dependency, UI behavior, filesystem behavior, or test has material cross-platform implications, even if the user only…

warpdotdev/warp · 92 tokens

change-keybinding

Customize Warp keyboard shortcuts (keybindings, keymappings) by editing the user's keybindings.yaml file. Use when the user asks to remap a key combination, rebind an action, change a shortcut, or remove a default keybinding (e.g. "change ctrl+space to ctrl+s", "rebind the command palette to cmd+p", "remove the…

warpdotdev/warp · 82 tokens

create-tab-config

Create new Warp tab config TOML files from natural-language requests. Use when the user wants a new tab config, a new tab layout, or asks for a slash command to generate a tab config.

warpdotdev/warp · 44 tokens

pipedream-workflows

Use when pipedream serverless workflows — triggers, code steps, pre-built actions, data stores, HTTP. Use when working with pipedream workflows.

oyi77/1ai-skills · 38 tokens

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