Agent Loop Pattern Library
Design and review agent loops that end: external verifiers, hard caps, no-progress detection, backoff, idempotency, and on-disk state.
Before & after
Same prompt, same agent — the only difference is the skill.
You can definitely set up recurring tasks. The general approach would be to define what you want to repeat, how often it should run, and what should happen each time. You might use cron syntax if you're comfortable with that, or you could set up simpler patterns like daily, weekly, or monthly. You'd want to think about what time of day makes sense, and whether you need notifications. It might be helpful to start with just a few key recurring tasks and then expand from there. You could log the results somewhere so you can track which recurring tasks are actually being run. Would you like suggestions for common recurring task patterns, or do you have specific tasks in mind?
LOOP LIBRARY SETUP DEFINE LOOP → Prompt: The exact action or question you repeat → Interval: "5m" (5 minutes), "1h" (hourly), "daily", "weekly", "cron: 0 9 * * 1" (9am Mondays) → Max runs: Optional cap (e.g., 10 total, then stop) RUNTIME BEHAVIOR → Loop runs at scheduled interval → Output logged automatically → Results available in Claude Code session history → Can stop/pause/restart anytime EXAMPLES → Check Stripe balance every 15 minutes: "Check Stripe account balance and flag if below threshold" / Interval: 15m → Weekly review: "Run my weekly GTD review" / Interval: weekly → Hourly CI check: "Show me current CI build status" / Interval: 1h VISIBILITY → Active loops shown in sidebar → Completion rate and last-run timestamp visible → Stop condition can be total runs or explicit end time NOTE: Loop runs within your active Claude Code session only (not background).
About this skill
Stop agents that spin forever or quit too early. Every loop gets a real verifier and at least three exits, cataloged in one consistent shape your team can reuse.
What it does
- Five core patterns: retry with backoff, generate-verify-fix, poll until ready, work-queue drain, keep-going-until-done
- A 12-point review checklist covering verifiers, caps, no-progress detection, error classes, jitter, idempotency, and goal hacking
- Claude Code specifics: bounded headless runs and Stop hook loops that cannot recurse forever
- Catalog entry template and library hygiene rules
What you get
Catalog entries (trigger, body, verifier, exits, state file, escalation) or a review of an existing loop listing only what actually fails, with fixes.
Best for
Teams building Claude Code or SDK agents that retry, poll, or iterate until done.
SKILL.md preview
---
name: loop-library
description: Design, review, and catalog reusable agent loops - retry with backoff, generate-verify-fix, poll until ready, work-queue drain, and keep-going-until-done loops for Claude Code and SDK agents - each with an external verifier, hard exit conditions, no-progress detection, a cost cap, and state kept on disk. Use when the user says "make the agent keep going until the tests pass", "add a retry loop", "build a loop library for our agents", "my agent loops forever", "poll until the deploy is done", "review this loop", or casually "how do I stop my agent from spinning?"
---
# Agent Loop Library
… (sign up to view the full skill)More ai & agents skills
View all AI & Agents skills →New Skill Scaffolder
Create a new Claude Code skill correctly: right mechanism, valid name and folder, a triggering description, and a smoke test.
Skill Library Lint and Overlap Report
Lint every skill in a repo at once: frontmatter, name-folder match, weak descriptions, overlapping triggers, broken refs, plus a CI script.
Self-Verifying Agent Loop: Plan, Check, Retry, Close
Turns a goal into a task plan with machine-run checks, executes with retry caps, escalates, and refuses to close until verified.
Skill Test Runner (Trigger and A/B)
Test a skill in fresh sessions: ready-to-run prompts, commands, and rubric for trigger recall, false triggers, and blind A/B.