Code & Engineering

Bill Spike Finder

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.

Bill Spike Finder is a tested SKILL.md that finds the loops behind a bill spike or an unexpected bill; an agent buys it once for $0.05 over x402.

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

Not for

Cloud bills on AWS, GCP or Kubernetes; reading your live usage dashboards for you; choosing a plan or a provider. It reviews the code and config you show it, so a caller it cannot see, such as a monitor or a script on another machine, is named as an assumption rather than found.

Tested, honestly

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

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Short cases passed12/1212/1212/129/12

One run per model and case, the same checks for both sides, every failed answer read. Without the skill Haiku missed client polling, a page that fetches its own API and middleware that runs on every static file. Sonnet found every loop without the skill too; what the skill adds there is the arithmetic. On the real site's code both models found as much or more WITHOUT the skill: Sonnet 5 of 6 either way (without it the costliest query was put at 125 to 250 million rows a month, with it at 498 million), Haiku 3 of 6 without, 1 to 2 with.

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
Found the planted loop in all 11 cases that had one and answered 'No findings.' for the clean code. Each finding carried runs a month, the billed unit and a fix on the path: one scheduler plus a run key, a shared server cache for a polled route, a matcher that skips static files, a cap and a dead-letter queue, and removing a cache clear that ran on every page view. On the whole code of a real site (an earlier text of the skill) it named 5 of the 6 main causes behind 561 million rows read and put the costliest query at 498 million rows a month, against about 500 million measured.
HaikuWeak model, claude-haiku-4-5-20251001
Found the planted loop in all 11 cases that had one and answered 'No findings.' for the clean code; once it gave the right fix without the finding's code name, and one Bulgarian answer used a Russian word. On the whole code of a real site it did worse: 3 of the 6 main causes without the skill, 0 with an earlier text and 1 to 2 with this one. It latched onto a health endpoint, assumed an uptime monitor the code does not show, and once proposed a cleanup whose condition would delete the newest rows. For a whole-project review, use a strong model.

Full test summary

Example

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

English · claude-sonnet-5-5

Before

Notes: Next.js on Vercel (Pro), database on Turso (Developer plan). vercel.json: { "crons": [{ "path": "/api/tick", "schedule": "* * * * *" }] } After an outage in July we also added an external cron service that calls https://example.com/api/tick every minute, as a backup. app/api/tick/route.ts: import { db } from "@/lib/db"; import { JOBS } from "@/lib/jobs"; export async function GET() {…

After

# Review: surprise-bill-loops Two findings, ranked by cost. The first is the bigger one and also makes the second four times worse. **[DOUBLE-SCHEDULER]** `vercel.json` cron plus the external cron service, both calling `/api/tick` Runs: - Each scheduler fires 1,440 times a day, so 43,200 a month each and 86,400 together.…

Bulgarian · claude-sonnet-5-5

Before

Бележки: Cloudflare Workers Paid, D1. Езиков модел по API, плаща се на токен. Новини идват средно 6 пъти на ден. wrangler.jsonc (извадка): "triggers": { "crons": ["* * * * *"] } src/index.ts: export default { async scheduled(_e: ScheduledEvent, env: Env) { const { results } = await env.DB.prepare( "SELECT id, title, body FROM news ORDER BY published_at DESC LIMIT 30" ).all();…

After

## Находки **[AI-IN-LOOP]** `src/index.ts`, `scheduled()`: `callModel(...)` се вика при всяко изпълнение Runs: cron `* * * * *` е 60 × 24 × 30 = 43 200 изпълнения на месец. Новини идват 6 пъти на ден, около 180 на месец, така че само около 180 от 43 200 повиквания (0,4%) имат нов вход. Останалите 43 020 плащат за същия обзор на същите 30 новини. Meter: токени на модела.…

What is in the file

  • Hard rules
  • What each platform bills (checked October 2026; prices change, the mechanisms rarely do)
  • Finding codes
  • Report format
  • Work in this order
  • Short example

Languages

English, Bulgarian. Tried in: English, Bulgarian.

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-04. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-04

    First release: reviews a web app's code and config for loops and repeats that run up the bill on Vercel, Turso, Cloudflare Workers and D1 and paid AI APIs; eighteen finding codes, each with runs a month, the billed unit and a fix on the path, ranked by cost and added up against the bill the buyer reports.

FAQ

Do I need my usage numbers?

No, but they help. Without them it lists every trigger it can see in the code and config, counts the runs a month and states what it assumed about traffic and table sizes. With a top-routes or top-queries list from the platform it starts from the code those numbers point to.

What does it add for Claude Sonnet?

Claude Sonnet found every planted loop in our short cases with or without the skill, and on a real site's code it named five of the six causes either way. The skill changed the numbers: with it, Sonnet put the costliest query at 498 million rows a month against about 500 million measured; without it, at 125 to 250 million.

How does it do with a small model?

On short pieces of code it helps: Claude Haiku passed twelve of twelve with the skill and nine of twelve without. On a whole project it did worse with the skill than without, fixing on one endpoint and assuming a caller that was not there. For a whole-project review, run it on a strong model.

Can a budget alert do the same job?

No. An alert arrives after the money is spent, often a day later. Each finding here comes with a change on the path, such as one scheduler, a cap or a shared cache, and an alert is mentioned only as a second line after the fix.

Read more

Share

Read this page as Markdown: /skills/bill-spike-finder.md.

  • SQL Query Optimizer for D1, SQLite and Turso

    Code & Engineering

    SKILL.md · v1.0.1 · 9.8 KB

    Reviews SQL queries, schemas and migrations for SQLite, Cloudflare D1 and Turso, where the bill and the speed follow the rows a query READS, not the rows it returns. Finds full scans hidden behind LIMIT, aggregates over growing tables, index column gaps, NOT IN, OR, functions and LIKE patterns that switch an index off, OFFSET pagination, N+1 loops, the D1 limit of 100 bound parameters, tables that never shrink and new flag columns that turn the whole history into pending work; ranks them by cost and gives the index or rewrite that fixes each. Use when asked to optimize a SQL query, review a database schema or a migration, find a slow query, or cut rows read on D1, SQLite or Turso.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 3 Oct 2026

  • SQLite Search Builder

    Code & Engineering

    SKILL.md · v1.0.0 · 14.5 KB

    Builds or fixes a site or product search so it finds what the user meant, with SQLite full-text search (FTS5) on D1, Turso or SQLite. Word order, singular or plural, endings, case, punctuation and accents stop mattering ("cafe" finds "Café", "tomatoes" finds "tomato", "red tomato" finds "Tomato, red", "ab1042" finds "AB-1042"), and the start of a word is enough ("tom" finds "tomatoes"). Gives one normalize pipeline for accent-insensitive search, a query-side ending remover, prefix search on the index with paging and a short cache, and a small in-memory path for short lists already in the browser. Never loads a whole table to filter it per keystroke. It does not correct typos. Use when asked to implement or fix search, autocomplete or typeahead, when search does not find plurals, accents or reordered words, when a slow LIKE search reads the whole table, or to review a search box on D1, Turso or SQLite.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 4 Oct 2026

  • Code Review

    Code & Engineering

    SKILL.md · v1.0.4 · 6.0 KB

    Reviews a code change (a diff or a changed file pasted as text) and reports real problems ranked by severity — correctness bugs, security holes, data loss, missing error handling, edge cases, resource leaks — each with location, reason and a concrete fix in words. Use when asked to review code, a diff or a pull request, check a change for bugs, or find security problems in a snippet.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 30 Sep 2026