Frugal

Cost is a property of the code. Why do we only learn it from the invoice?

Can a coding agent reason about money the way it already reasons about types and tests?

What I noticed

AmbleOut, an events catalogue on Vercel, exceeded its Fast Origin Transfer allowance: 18.46 GB against 10 GB. Nothing was broken. Every page worked. The code simply ran a server function for each visit to a listing page, and many of the visits were not from people.

Frugal later queried a week of production metrics. Three listing routes accounted for 93.6% of the bytes leaving the origin, and about 95% of CDN requests were cache misses. An earlier investigation in the application’s own repository named AI crawlers among the dominant visitors.

AmbleOut, 24–30 Nov 2026 (Vercel Observability)
Listing routeFunction invocationsOutbound origin bytes
/whats-on/[when]238,7068.93 GB
/category/[slug]198,3764.59 GB
/area/[slug]126,8004.78 GB
Three routes together563,882 (96.1%)18.31 GB (93.6%)

The question

Usage-based pricing quietly changes what a line of code is. A page that renders on demand is also a promise to pay, per visitor, for compute and bytes, to whoever turns up. The marginal cost of serving a visitor is no longer close to zero, and nobody who can send traffic is obliged to be a customer.

Engineers already ask a coding agent whether a change is correct and whether it is safe. Almost nobody asks whether it is affordable at ten times the traffic, partly because the answer sits in a billing console, weeks later, rather than in the code under review.

Make the equation explicit

An honest cost estimate is a conditional: requests × miss fraction × bytes per origin response. Frugal is built around writing that equation down, with its evidence and assumptions, rather than asserting a number. It is an Agent Skill, so an agent can use it, but every piece also runs standalone on the Python standard library with no network.

  1. Understand scan code and git diffs for billable resources
  2. Predict per-path equations, dated prices, scenarios, forecasts
  3. Prevent policies for money, bytes and cache effectiveness, run in CI
  4. Control a generated guard that reserves budget before expensive work runs

Evidence

  • Detection. Nine labelled findings across two small repositories, no false positives. These are fixtures, so this is a regression signal, not a measure of accuracy in the wild.
  • A model that was wrong. The warm-cache equation matched its synthetic replay. Reusing that estimate for a cold-key spike underestimated bytes by about 96%. An estimate is only as good as the regime it was fitted in.
  • Reservation under contention. In a 12-thread test, 100 of 250 attempts were admitted under a 1,000-unit budget, with zero recorded overshoot.
  • AmbleOut replay. In an archived local replay of the site, a 561-request human workload went from 480 to 9 simulated origin invocations, and from 28.7 MB to 0.63 MB of origin transfer.

What this does not show

  • The AmbleOut savings come from a replay, not a live before-and-after. Production savings are unmeasured, and the site’s database egress was unavailable to the study.
  • The evidence does not identify how the application was written as the cause of the crawler load. It establishes where the meter moved.
  • No guard or billing change was applied to AmbleOut by this study.
  • The central hypothesis, that explicit models plus deterministic policy checks beat a prose-only review, has comparative trials prepared and not yet run.
  • Several unrelated projects share the name; the repository’s research notes list them. Neighbouring tools such as Infracost and OpenCost solve adjacent problems and are meant to be used alongside it.

Why it might matter

Editorial reading.

Cost belongs in the feedback loop. Compilers moved correctness from production to the editor, and tests moved regressions from users to CI. Money is a defect category that has not made that move for most small teams, and agents that write code quickly make the gap more expensive.

An externality, hedged. If automated visitors can impose metered costs on a site that did not invite them, the burden falls on whoever runs it. Frugal does not argue about whether that is fair. It makes the exposure legible and lets the builder choose, for instance, between serving cached data and deferring optional work.

A trade-off, not a fix. The case study compares four architectures for the same pages: dynamic on visit, shared cache, static with bounded dynamic filters, and published data filtered on the client. Each moves the cost somewhere else, to the CDN, to the client or to freshness. The tool’s job is to show that move, not hide it.

Still open

  • Does an explicit model change what an agent recommends, or only how confident it sounds? The trial that would tell is written but unrun.
  • How should an estimate express that it was fitted under one traffic regime and may not survive another?
  • When the budget runs out, should a system refuse, degrade or defer, and who decides?

Role in the ecosystem

Links