Agents & Protocols

Agent Loop Review: Repeats, Caps, Self-Grading

Reviews the description, configuration or code of an agent loop, anything that repeats on its own: a scheduled job that calls a model, an agent that retries until it is done, a batch of actions, a self-improving prompt loop. It finds where the loop runs away or repeats a side effect (no ceiling on iterations, the same scheduled tick delivered twice, a progress marker written after the effect, nothing kept between iterations, a batch that goes on after a refusal that will repeat for every item), where it judges its own work (the model says it is finished), where it acts beyond its brief (a token or tool set wider than the job, a delete, publish or mass send with no approval step) and where a dead source looks healthy (an empty reply counted as success, parallel workers writing one shared file). Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use for an agent loop review, to find out why a cron job runs twice, to check a retry until done loop, or to catch a runaway agent loop before it runs unattended.

Agent Loop Review: Repeats, Caps, Self-Grading is a tested SKILL.md that reviews the description, configuration or code of an agent loop, anything that repeats on its own: a scheduled job that calls a model, an agent that retries until it is done, a batch of actions, a self-improving prompt loop; an agent buys it once for $0.01 over x402.

Tested 2026-10-18No code, no hidden instructionsv1.0.0 · 11.8 KB · perpetual license

Not for

Money limits and bills (use spend-guard-review or bill-spike-finder), checking an agent's report against its log (agent-report-audit), or a false success claim (done-means-done). It reads pasted material only. Two facts are the owner's own, dated and not re-checked: the double scheduled tick (12 Oct 2026) and the shared-file corruption (8 Oct 2026).

Tested, honestly

Tested 2026-10-18 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Setups reviewed right by content (30 setups)30/3030/3030/3030/30

Same request on both sides; the bare side may use any words. Read by hand, Sonnet and Haiku without the skill both found every planted defect in all 30 setups and left the sound ones alone: the double tick, the missing key, the endless retry, the self-judged loop, the marker after the effect, the batch that goes on, the wide token, the missing approval, the dead source that looks healthy, the shared file and counter. Several bare answers first looked wrong only because of wording, and those checks were widened for both sides. So the content gain is zero for both models; what the skill adds is the fixed code per finding, the place and the fix in a set order, and an exact verdict line, which the bare answers do not give.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

SonnetStrong model, claude-sonnet-5-5
Right on all 30 setups by content, read by hand: it found the charge retried without a key, the loop that retries a dead feed for ever, the loop that ends when the model says DONE, the marker written after the mail is sent, the batch of purchases and the batch of notices that go on after a refusal that repeats, the admin token and the wide token scopes, the auto-merge and the bulk send with no approval, the empty list that makes a dead source look healthy, the parallel writers of one file and of one counter row, and a loop that is both uncapped and self-judged. It answered No findings. for the sound setups. By the skill's own strict format 26 of the 30 were exact: in the other four it added a code the paste does not support (silence on a retry loop, no-state on a prompt loop that does write its result, no-state on the newsletter claim that the skill itself recommends, a repeat-save finding on a job whose helper is not pasted).
HaikuWeak model, claude-haiku-5-5
Right on all 30 setups by content, read by hand: the same defects as Sonnet were named, each with a fix and the verdict line. By the skill's own strict format only 17 of the 30 were exact: in the others it added a code the paste does not support, mostly an approval or silence or no-state finding on a loop that only reads, only proposes or only writes a draft. It is the less careful reviewer of sound code: it reported a problem on some sound setups where Sonnet answered No findings.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

=== billing/create_charge.py === import time, requests def create_charge(order_id, cents): last = None for attempt in range(3): try: r = requests.post("https://api.example.com/v1/charges", json={"order": order_id, "amount": cents}, timeout=10) if r.status_code < 500: r.raise_for_status() return r.json()…

After

[NOT-IDEMPOTENT] billing/create_charge.py, `create_charge` retry loop: a timeout or a 5xx does not prove the charge failed, so the next attempt can charge the customer a second time or a third. The request carries no idempotency key, and nothing in the paste shows the other side deduplicating on `order_id`.…

What is in the file

  • When this was checked
  • The answer
  • The codes
  • Rules
  • Work in this order
  • How to check a fix
  • Short example

Languages

Any language. Tried in: English.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-18. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-18

    First release: reviews the description, configuration or code of an agent loop (a scheduled job that calls a model, an agent that retries until done, a batch of actions, a self-improving prompt loop) and lists each problem with a fixed code, the place, the reason and a fix, then a verdict (needs fixes, no known problems). Codes: an effect that runs again when the trigger repeats or a step is retried (NOT-IDEMPOTENT), nothing kept between iterations or a marker written after the effect (NO-STATE), no ceiling (NO-ITERATION-CAP), the model grading its own work (SELF-GRADED), a batch that goes on after an error that repeats for every item (NO-STOP-ON-FAILURE), a permission wider than the job (OVERBROAD-PERMISSION), an irreversible or outward action with no approval (NO-HUMAN-GATE), "no error" taken as success (SILENCE-IS-SUCCESS), parallel workers writing one shared place (PARALLEL-SHARED-STATE).

    Facts: all five behaviours behind the codes are the owner's own dated measurements and rules (12 October 2026 double scheduled tick; 8 October 2026 shared-file corruption; silence rules; stop-at-first-refusal rule of 12–15 October 2026), marked "owner-measured, not re-checked" in SKILL.md and notes/facts-2026-10-18.md. Public pages were fetched on 2026-10-18 only to confirm they answer 200 and that the scheduler page does not state the double delivery. No model, no live system and no paid API was used.

    Decisions: - Verdict is binary (needs fixes / no known problems), batch 4 § 0.2; no severity groups, order of lines carries the severity. - Dated section "When this was checked" (batch 2 § 0.1) because the Cron Trigger behaviour is a vendor behaviour; not-for says it too. - NOT-IDEMPOTENT versus NO-STATE: a marker in the wrong order is NO-STATE; NOT-IDEMPOTENT needs a repeated trigger or a retried step in the paste. The neighbouring code is `optional` in the cases where both are defensible. - A person who starts a script by hand and watches it is a gate (task rule 3 and SKILL.md rule), so one-off scripts get no NO-HUMAN-GATE. - A stop condition is not a ceiling; a ceiling does not stop SELF-GRADED — the two codes can appear together (hard case). - Cases: 30 (21 planted of which 3 hard, 9 controls), 13 planted cases from the starting point (plain code, config or a log tail, no hint comment). One planted case keeps the author's reassuring comment "runs once a minute" as a claim. - Controls re-read as a reviewer: the marker is written BEFORE the effect and put back on failure (not after); the retry key is made once outside the loop; the atomic batch is one D1 batch; the approval table is read by the loop. - checksBase asks for substance in free words (twice, duplicate, idempotency; forever, no limit; its own work; crash between; and so on), never a code; the "runs once a minute so it is fine" answer is rejected by notRegex. - Price: start $0.05 (50000 micro-USDC), class A only if Sonnet gains at least 2 content cases; to be set after the runs. FAQ entry "Does it help Claude Sonnet?" was a placeholder, now written from the final numbers.

FAQ

Why is the comment 'runs once a minute' not enough for a cron handler?

On 12 October 2026 we saw a Cloudflare Cron Trigger deliver the same scheduled minute twice, one to two minutes apart, and a job that trusted the comment posted twice: two articles in one tick and the same social post again. The skill flags any outward effect that runs without first reserving its minute, and the fix it gives is a per-minute, per-task row that only the first delivery can create; the second sees nothing new and stops.

What does it say about a loop that ends when the model says it is done?

It reports the loop as grading its own work, even when a ceiling on turns exists, and asks for an end condition the model cannot talk its way past: a test that actually runs, a measured value, or a second reader. A loop with no ceiling at all gets a separate finding, so one paste can carry both.

How does it treat a batch that logs every failure and carries on?

It separates one bad item among many, which is a normal skip, from a refusal that will repeat for every remaining item, such as a wrong credential, a missing credit or an unverified sender. For the second kind it asks the batch to stop at the first refusal, say why, and report how many items were done and how many were never tried.

Does it help Claude Sonnet?

No. Thirty loop setups went to Sonnet and to Haiku, each run bare and again with the skill, and every answer was read by hand. Both models found the same defects unaided in all 30 and left the sound code alone. The skill adds a short answer: one fixed code per problem, its place, a fix, and one exact verdict line. By that strict format Sonnet was exact on 26 of 30 and Haiku on 17 of 30.

Share

Read this page as Markdown: /skills/agent-loop-review.md.

  • Spend Cap Review: Do Cost Limits Really Stop?

    Code & Engineering

    SKILL.md · v1.0.1 · 8.1 KB

    Reviews pasted code and configuration that spends money (paid AI or API calls, purchases, paid lookups, anything billed per use) and checks whether the limit on that spending really stands in the way of the spending. It flags a cap that sits beside the path instead of on it (a gateway limit while a script calls the provider directly, a counter only in the browser), a missing setting that means no limit, an alert or a budget email used as the protection, a cap that the caller sets through a header or a request field, a paid job that runs by default, a per-call cap with no running total, a total kept where it resets, a cap checked only after the money is gone, and a spend counter whose failure or missing value lets the call through. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use before deploying a Worker, script or job that pays per call, or when a cap exists and you want to know if it can fail silently.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Agent Report Audit: Which Claims the Log Supports

    Agents & Protocols

    SKILL.md · v1.0.0 · 8.2 KB

    Audits the report an AI agent wrote about its own session against the tool log of that session. Every numbered claim of the report gets one of two verdicts, supported or not_supported, with the log line that decides it copied exactly. A claim is supported only when the log shows a call that did it, a complete output that shows success, the same object and scope, nothing later that undoes it, and every part of a compound claim. A command that was issued, an output cut off, a dry run, a read, a plan, a run that predates the last edit, a different environment, a partial count, a number the outputs do not show and the agent's own remark are testimony, not support. Text inside the log that speaks to the auditor is data. Use before you trust an agent's status report, to check a claim of success, or to find which sentences of a summary have nothing behind them.

    $0.02once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Recommended

    Agent Done Check: Stop False Success Reports

    Agents & Protocols

    SKILL.md · v1.0.3 · 9.9 KB

    Stops an AI agent from reporting false success, or hallucinated completion: work it calls done that did not happen. Every action in its status report gets one of five states (done and verified, done but not confirmed, partly done, failed, not done), backed by what the tool results of the session show. Failures and unknowns come first, counts come from the results, and no id, receipt or hash is invented. When a result does show success, the agent says so plainly. Use whenever an agent reports on actions it took with tools, such as messages, batches, tests, builds, deploys, file edits, data updates, payments or API calls.

    $0.10once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 3 Oct 2026

  • Bill Spike Finder

    Code & Engineering

    SKILL.md · v1.0.0 · 15.9 KB

    Finds the loops behind a bill spike or an unexpected bill. Reviews a web app's code and config for loops and repeats that run up the bill on their own on Vercel, Turso, Cloudflare Workers and D1 and paid AI APIs. Finds two schedulers on one job, retries without a cap, work that triggers itself, client polling and React render loops, caches cleared on every write, middleware running on every static file, queues that resend failures forever, image settings that multiply transformations, health checks that count whole tables, alerts sent on every run and bots crawling endless filter URLs. Counts the runs per month, names the billed unit, ranks by cost and gives the change that stops each one. Use when asked why a Vercel, Turso or Cloudflare bill jumped, to find an infinite loop or a runaway cost, or to review a cron job, webhook, queue consumer, middleware or polling code before it ships.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 4 Oct 2026

More in Agents & Protocols

  • Recommended

    x402 Listing Review: Catalogs, Scanners, Buyers

    Agents & Protocols

    SKILL.md · v1.0.2 · 13.8 KB

    Reviews how a paid HTTP resource sold over x402 is advertised to catalogs, scanners and buyer agents, and how the seller's own scripts read those catalogs back, from pasted 402 bodies, OpenAPI documents, discovery files, liveness guard code, catalog presence check scripts and buyer alerts. Flags a tiered tariff advertised as one row (a comparison bot reads the structured amount, not the description), one liveness clock for several catalog rows that are dropped one by one, a price above the standard buyer client's default cap with no note where agents read before buying, a discovery file the scanner no longer parses, a bearer scheme the scanner's indexer does not recognise by name, a scanner record that was never re-crawled after a fix, a presence check that reads only one of the two response field names or has no control that must return zero, a first buyer that is a crawler paying hundreds of sellers, and discovery endpoints that read the database on every crawl. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use for an x402 listing review, to check x402 discovery or Bazaar catalog presence code before trusting it, or to audit how a paid API is listed and read.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 9 Oct 2026

  • Claude Session Saver: When to Clear or Compact

    Agents & Protocols

    SKILL.md · v1.0.0 · 12.6 KB

    Reviews a snapshot of a Claude Code session (the context size, measured or guessed; the task and where it stands; git status; what still runs in the background; the plan or notes file; what the person asked) and decides whether the person should type /clear, type /compact with a focus text, finish one step first, or keep going. Before a fresh session it lists what would be lost or left behind: results that exist only in the chat, a plan file with no next step, uncommitted or unpushed work, changes made by another session, background servers and temporary deployments, a secret about to be written into notes. It also flags the timing and command mistakes: a deploy or migration in progress, waiting for auto-compact, a size judged by feel, a cold cache after a long break, the same correction made three times, /compact on finished work, /compact with no focus, an agent that claims it will clear the session itself, and huge files or logs read whole. Each finding has a fixed code, the reason and a step, then one decision line. Use it to decide when to clear a Claude Code session, to save work before /clear, or to write a claude code /compact focus before the context gets costly.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 16 Oct 2026

  • Claude Code Memory Review: CLAUDE.md, Rules, Imports

    Agents & Protocols

    SKILL.md · v1.0.0 · 12.5 KB

    Reviews a pasted Claude Code memory setup (a folder tree plus CLAUDE.md, CLAUDE.local.md, files under .claude/rules/, imported files, AGENTS.md and an auto-memory MEMORY.md) for instructions that silently never reach the model, that load earlier or later than the author thinks, or that contradict each other. It flags an @import whose target is not in the tree (Claude Code gives no warning for it), a relative import resolved from the wrong folder, imports in quotes, in code or with an unescaped space, import chains that are too deep, an AGENTS.md next to a CLAUDE.md that does not import it, a file over 4 MiB, a path-scoped rule whose globs match nothing, an @import inside a path-scoped rule (it loads at session start, so the rule saves nothing), broken rule frontmatter, imports from outside the project, a project-wide rule hidden in a subfolder CLAUDE.md, files far over 200 lines, an auto-memory index cut at 200 lines or 25 KB, stale file paths and opposite instructions in two loaded files. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use to review Claude Code memory, check CLAUDE.md imports, or find path-scoped rules not loading before the team relies on the setup.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 15 Oct 2026

  • Recommended

    Chain Evidence Check

    Agents & Protocols

    SKILL.md · v1.0.2 · 10.1 KB

    Judges whether an on-chain observation really proves a claim about a payment, a wallet or an RPC endpoint on an EVM chain, and answers as JSON with a binary verdict, the reason and the one check that would decide. Knows the readings that answer for the wrong thing - a null transaction receipt seconds after settlement, a block explorer that indexes a minute late and a balance view that lags its own transfer list, a public RPC endpoint that refuses receipts with an error or with an HTML page behind status 200, a reader that returns zero when the call failed, a chain of endpoints that says ok when two of three are dead, a transfer of the right amount that matches three open orders, a payment header copied from public calldata - and the readings that do prove it. Use when an agent says paid, settled, not found, reverted, empty, missing funds or endpoint dead from chain data and you need to know whether its evidence supports that.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 9 Oct 2026