{"slug":"retry-backoff-review","name":"Retry Backoff Review","version":"1.0.0","updated_at":"2026-10-26T21:00:46.508Z","use_when":"Reviews ONE piece of retry code, or a written retry design for an agent or a service client, and lists only the five mistakes that turn a failure into an outage or a double write, one line each with a fixed code, the place, why it hurts and the fix - or exactly No findings. It catches waits that grow without a random part, a loop with no limit on tries or on total time, a POST repeated with no idempotency key, a 429 or 503 answer whose Retry-After header is never read, and retries on client errors that cannot change. It leaves out the safe look-alikes, such as a GET retried with a cap and jitter, a retry set of 408, 429 and server errors only, and a wait taken straight from Retry-After. Use to review the retry loop of an API client, to audit how an agent calls tools that fail, or before shipping a client to production.","not_for":"Circuit breakers, queue-based retries, library defaults and the server side of rate limiting. It reads one pasted piece of retry code or a short written design and judges only how a single failed call is repeated. It does not judge what the call does after the last try fails, nor how an agent decides to stop its whole run.","languages":["en"],"tags":["retry","backoff","jitter","idempotency","rate-limits","agents"],"category":"agents","category_url":"https://aiskills402.com/categories/agents","keywords":["retry loop","idempotency key","retry-after header"],"faq":[{"q":"Statuses worth retrying: which ones?","a":"Timeouts reported as 408, too-many-requests answers and server errors. That set is the skill's own policy, stated in its text, and a loop that retries a 404 or a 422 gets a line for it."},{"q":"Does a PUT that is repeated get reported?","a":"No. RFC 9110 lists PUT and DELETE as idempotent, so only a call that creates or changes something without such a guarantee, such as a plain POST, needs a key."},{"q":"Which code did the trial use?","a":"A Python charge loop that doubles its wait without end beside a capped, randomised read; a JavaScript order sync that ignores Retry-After and retries every 4xx; and a clean report fetch. Sonnet and Haiku saw each file once."},{"q":"What does a sound retry loop earn?","a":"The lone sentence No findings. Anything wrong appears on its own row instead: the code name, the spot in the paste, the harm done and the repair."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"import random, time, requests\n\ndef post_charge(payload):\n    delay = 1\n    while True:\n        r = requests.post(URL + \"/charges\", json=payload, timeout=10)\n        if r.status_code < 500:\n            return r\n        time.sleep(delay)\n        delay *= 2\n\ndef get_profile(user_id):\n    for attempt in range(5):\n        r = requests.get(f\"{URL}/users/{user_id}\", timeout=5)…","output_excerpt":"NO-JITTER — `post_charge`: `time.sleep(delay)` with `delay *= 2` — the wait grows by a fixed rule, so clients that failed together retry together — add a random part, e.g. `time.sleep(random.uniform(0, delay))`, and cap the delay at a maximum…"}],"page_url":"https://aiskills402.com/skills/retry-backoff-review","markdown_url":"https://aiskills402.com/skills/retry-backoff-review.md","image_url":"https://cdn.aiskills402.com/og/skills/retry-backoff-review/99968a71.png","related_url":"https://api.aiskills402.com/v1/skills/retry-backoff-review/related","purchases_count":null,"tested":{"date":"2026-10-26","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"Right on all 3 cases, read by hand. On the charge loop it gave the missing random part, the endless loop and the repeated POST to the charges endpoint, and left out the capped profile read with jitter that sits beside it. On the order sync it found the ignored Retry-After header and the retry of every client error, and left out the PUT, which is idempotent, and the jittered six-try loop. On the clean report fetch it answered exactly No findings, so the wait read from Retry-After and the single POST passed."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"Right on all 3 cases, read by hand. It matched the strong model on both planted files, with fixes that name the exact line to change, and kept the capped read and the PUT out. On the clean fetch it answered exactly No findings. Its charge answer is longer than the strong model's but stays one line per code."},"note":"Light test: three cases (two planted, one clean), one run per model; no comparison without the skill. The three inputs were written by us; each planted one carries a safe look-alike and neither planted case has a comment pointing at the defect. Facts come from public sources (an AWS article and RFC 9110), read on 26 October 2026; the set of retryable statuses is our own policy. There are no owner-measured facts.","report_url":null},"price_usd":"0.01","price_micro":10000,"size_bytes":6188,"sha256":"c555d7abdd3cff46d41d50f4c035632712ee16e89f6b7d5cc7cbc1461f4b0ead","outline":["What the public sources say, as read on 26 October 2026","The answer","The codes","Rules","Work in this order","Short example"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/retry-backoff-review/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"Retry Backoff Review for API Clients","seo_description":"Reviews retry code for missing jitter, endless loops, repeated POSTs without a key, ignored Retry-After and retried client errors. Pay $0.01 once, in USDC.","versions":[{"version":"1.0.0","date":"2026-10-26","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-26\n\nFirst release, written in the second light-test batch of 26 October 2026 (three cases, price $0.01). The idea is ours; no foreign skill was opened, facts come from public sources (see notes/ideas.md). Output: see the skill description.\n\nTest: three cases written by hand (two planted, each with a safe look-alike, one clean control), one run on Claude Sonnet and one on Claude Haiku, no run without the skill, no iteration on the skill rules after the runs. `test/control.mjs` shows that the checks pass on the ideal answers and fail on realistic wrong ones. See `test-summary.json` for the verdicts read by hand.\n"}]}