loop-cron

loop-cron is a skill for Claude Code from EmpiricaAI/empirica. It costs 118 tokens per session (2,392 once invoked), scanned A, original, MIT.

A setup guide for recurring background work driven by Claude Code’s /loop command. It connects scheduled loops to Empirica’s registry so they can be seen and controlled from other terminals.

In plain words
What is it for?
Use it for cron or interval loops that need status visibility, pause and resume controls, execution heartbeats, and durable scheduling.
Why use it?
It makes scheduled jobs observable, pausable, resumable, and trackable across session restarts instead of leaving them hidden in one terminal.

Skill for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: mentions Claude Code.

Part of the empirica plugin — 17 skills, 2 commands, 4 agents shipped together

Good fit Use it for cron or interval loops that need status visibility, pause and resume controls, execution heartbeats, and durable scheduling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/empiricaai/empirica/loop-cron
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 EmpiricaAI/empirica --skill loop-cron
Clone the repo
git clone --depth 1 https://github.com/EmpiricaAI/empirica

Made for: Claude Code.

Or install empirica, the plugin that ships this one along with the rest of its 17 skills, 2 commands, 4 agents.

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-cron

README.md
[![agentmods](https://agentmods.dev/badge/skills/empiricaai/empirica/loop-cron/github.svg)](https://agentmods.dev/skills/empiricaai/empirica/loop-cron)
Your own site
<a href="https://agentmods.dev/skills/empiricaai/empirica/loop-cron"><img src="https://agentmods.dev/badge/skills/empiricaai/empirica/loop-cron/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-cron

Your own site · 80×15
<a href="https://agentmods.dev/skills/empiricaai/empirica/loop-cron"><img src="https://agentmods.dev/badge/skills/empiricaai/empirica/loop-cron.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,392 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 pass 7 Sept 2026
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.00118 $0.02392
Opus 5 $0.00059 $0.01196
Sonnet 5 $0.00024 $0.00478
Haiku 4.5 $0.00012 $0.00239

Measured 10d ago against content hash a9536ac813f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

loop-cron 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 10d 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.

empirica/plugins/claude-code-integration/skills/loop-cron/SKILL.md · 249 lines

How it starts

The opening of the file, as written. The whole thing — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Loop-Cron Wiring

Claude Code's built-in /loop skill drives periodic work via CronCreate. On its own, those loops are invisible to other terminals — you can't see what's scheduled, can't tell when one last ran, and can't pause them without killing the process. Empirica's loop registry fixes that with three CLI calls layered into the cron prompt.

This skill is the prompt template for cron-mode loops that integrates with the registry.


When to Use

You're about to start a cron-mode loop with /loop (or already have one running) and:

  • You want it visible in empirica status --all
  • You want to pause/resume from any terminal without killing the process
  • You want a heartbeat trail for "did it actually run, did it succeed"
  • You want it to survive a Claude Code session restart cleanly

If your loop is one-shot or interactive ("dynamic mode"), skip this — it applies to scheduled (cron/interval) loops only.


Cron Prompt Template (self-scheduling)

Per PROPOSAL_LOOP_SELF_SCHEDULING.md: the body owns the schedule. Each fire installs the next fire as a one-shot at the timestamp the backoff math returns. There is no recurring cron — pause means the scheduler is silent (no token bleed).

When invoking /loop in cron mode, prepend these CLI lines to your task prompt. Variables: {NAME} (loop identifier, no spaces), {INTERVAL} (base cadence, e.g. 15m), {DESC} (one-line description).

At start (idempotent — safe to call every fire):
  empirica loop register --name {NAME} --kind cron --interval "{INTERVAL}" \
    --description "{DESC}" \
    --backoff exponential --base-interval {INTERVAL} --max-interval 4h

Check pause — exit silently AND don't schedule next fire if paused:
  PAUSED=$(empirica loop status {NAME} --output json | jq -r .paused)
  if [ "$PAUSED" = "true" ]; then
    empirica loop heartbeat {NAME} --status ok --result paused \
      --message "skipped, paused"
    exit 0   # CRITICAL: exit without scheduling next; loop is genuinely off
  fi

[... your actual work here, capturing $RESULT as found|empty|fail ...]

At end — heartbeat with result, then schedule + install the next fire:
  empirica loop heartbeat {NAME} --status ok --result $RESULT \
    --message "$SUMMARY"

  NEXT_CRON=$(empirica loop schedule-next {NAME} --output json | jq -r .cron_one_shot)

  # Install the next one-shot using your scheduler:
  # Claude Code:    CronCreate(cron=$NEXT_CRON, recurring=false,
  #                            prompt='<this whole template again>')
  # systemd-user:   systemd-run --user --on-active=$INTERVAL ...
  # at-queue:       echo '<command>' | at -t $(date -u -d "$NEXT_FIRE" +%Y%m%d%H%M)

  # Then heartbeat back the scheduler-returned job_id so pause can cancel:
  empirica loop heartbeat {NAME} --status ok --result $RESULT \
    --next-scheduled-job-id "$JOB_ID" --scheduler-kind cron-create

On failure:
  empirica loop heartbeat {NAME} --status fail --result fail \
    --message "{error}"
  # Failure retries at base — schedule-next still returns base interval.

Read the full file on GitHub · 249 lines

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. 10d ago First seen · 249 lines · 118 tokens per session scan A a9536ac813f7

Subscribe to this mod's changes

loop-cron is a skill published in the GitHub repository EmpiricaAI/empirica (247 stars, last pushed today), licensed MIT. It adds 118 tokens to every session and 2,392 once invoked, about $0.0006 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-08-30.