Net Wt.
Did the snacks get smaller? I diffed 10 releases of a USDA barcode database to find the products that got lighter, then went after the ones the diff could not see. Built in 2026 with AI coding agents I direct.
- Data
- 10 USDA releases
18.6M rows - Stack
- DuckDB · SQL · Python
Claude for the label eval - Checks
- 562 automated tests
2 agent audits - Code
- Private repo
on request
At least 39 products got lighter and kept their barcode. Others moved to a new, lighter one.
Both ranges come from a rule I set before the audits. The low end is the tier-A count times the bottom of the audit's 95% interval; the high end is every A and B count times the top. Read label by label, the first audit confirms 53 of the same-barcode products and leaves room for at most 84. The second detector exists because the first one missed every shrink in the news (section 05).
Source: USDA FoodData Central, Branded Foods. Brands and their data providers send the label data; USDA standardizes it, posts a new copy about twice a year, and never weighs a pack. I used the ten releases from Oct 2021, the first with a package-weight field, to Apr 2026. No price claims: the Bureau of Labor Statistics already counts downsizing in the CPI.
Every one, with its receipt.
Each tag is one product. Tap it for the two USDA rows behind it, with links to the records.
Order: press reports at the same sizes first, then hand-picked household names, then other press mentions, then audit passes, then the rest. Tags the audit rejected stay in, marked, at the end, unless the press reported them at these sizes. Tier B means one soft flag; on a new barcode, that the ingredient list changed too.
Ten releases, one diff, and the rule written down before the full run.
USDA publishes a database of packaged foods, by barcode, with the net weight each manufacturer declared. A new copy comes out about twice a year. Line the copies up by barcode and a product that got lighter shows up as two rows that disagree.
- SourceFoodData Central Branded Foods, 10 releasesOct 2021 to Apr 2026, each zip hashed at download and checked again before ingest
- Ingest18,552,601 rows into column-pruned parquetOne release at a time, on an external SSD, on a laptop
- Parse32,698 distinct weight strings, 99.4% read as a weight or volume"9 1/4 OZ/262.2 g", "1 PT/437 mL", "8 - 0.84 oz (24 g)"
- LedgerDuckDB pairs each barcode with its next row6,281,824 pairs compared
- RuleCommitted before the ten-release diffA rough trial on two releases came first. A, B and C tiers; C is shown, never counted
- AuditAn agent rater on a 97-event sample, a second on 30Precision per pair kind with Wilson intervals; section 04
- EvalClaude reads net weight off 219 label photosScored against the USDA row; lesson 04
- TripwireA re-check of 500 barcodes against the live APIBuilt and replay-tested, not switched on yet; it would open an issue when a declared weight moves
The checkpoint said 210. The audit cut it to a range.
The checkpoint, on a three-release slice, counted 210 shrink events and cleared the plan's bar of 200. Counted once, they were 147; lesson 03 says why that matters. The full ledger counts each change once. An agent rater then read 97 of its events against the raw rows, and a second re-read 30 of them blind (kappa 0.73). About two in three were real downsizes. The rest were data-entry errors (15), the same amount written a new way (6), barcodes reused for another product (5), and 4 the rows could not settle.
- I wrote the event rule down and committed it before the ten-release diff; a rough trial on two releases came first. Every change since is logged with its reason.
- Headline counts are floors or ranges. Every rate measured on a sample carries its n and its interval.
- Every count and rate from the data is filled in from one summary file, never typed. The docs are built the same way.
- A weight that drops and comes back never counts, and neither does one that changes along with a new name or recipe. A small change to the name puts an event in tier B, which counts only toward the top of the range.
- When a fix changes the events, an audit label carries over only if its event is the same two rows at the same tier. A Lindt bar read as a shrink because one row lost its gram figure. Once the rule compared both rows in a unit they share, the shrink went away, and so did its label.
It found none of the ten shrinks in the news.
I took 10 downsizes the press reported, from Gatorade to Tropicana, and looked for each one in the ledger. It found 0 of 10 (95% interval 0% to 28%).
| Reported downsize | Sizes | What the USDA data shows |
|---|
The year is the first report I found, and each name links to it.
In 6 of the 10, both sizes are in the data, each on its own barcode, and no barcode carries both. That is how barcodes are supposed to work: the GS1 standard calls for a new barcode whenever the declared net content changes. The old row stays in the database as it was, so a diff that follows one barcode never sees a change.
So I followed the product's name instead of its barcode.
The second detector groups barcodes by brand, category and product name. A step is a new barcode, first seen in a later release, 2% to 20% lighter than the nearest size in its family. The new size has to be new to the family, and the old size has to stop getting new barcodes. A family with more than four sizes is tier C and never counts. I wrote this rule after a first look at the data and before the first audit label.
A new size is often just a new size. So the rule also runs in reverse and counts new barcodes 2% to 25% heavier, the mirror image of the lighter band. That count is the baseline. Lighter beats heavier 1.6 to 1.
Then the same kind of audit: 100 sampled steps, each with both raw rows and the size history of the barcodes the rule could use, read by an agent rater. A second re-read 30 of them blind (kappa 0.76).
About one in four held up as one pack replacing another. Most of the rest were two sizes sold side by side (25) or two products that share a name (34). So the range is wide: at least 22 steps, and up to 128.
Of the ten press cases, it finds none at their sizes. Gatorade's smaller bottle was never new: the 28 fl oz sits beside the 32 fl oz, under the same flavor names, from the first release on. Double Stuf and Wheat Thins should have been easy, since each got its smaller barcode inside the data's window. But in each, the old and new rows' names differ by a word or two, and the rule pairs only exact names.
Known flaws, logged and left for the next pass so the audit still means what it did: the size cap sees only the barcodes the rule could use, so 26 steps escaped tier C; two steps are label rounding, marked in the aisle; and a one-word difference in a name splits a family.
Six lessons.
The database mostly stopped moving in 2023
In the Apr 2026 release, 96.8% of barcodes were last published before 2024, and 318 of the 348 new-barcode steps land in the 2022 and 2023 releases. USDA's record pages say why: it stopped receiving updates from Label Insight, the source of 97.0% of the rows with a weight, on November 16, 2023. So the stretch that matters runs from Oct 2021 to late 2023.
The gate passed on the wrong unit
The plan said to stop if a three-release slice showed fewer than 200 shrink events. The first build counted 176 and failed. The next counted 210 and passed, because the rule I had written counted a change once for every release it was copied into. Counted once, there were 147. By its own bar, the gate should have failed. I kept going, and the full ledger counts each change once.
A photo has a date too
Claude Opus 5.5 read the net weight off 219 Open Food Facts label photos of products whose weight never changed in the data. It matched the USDA row 80% of the time (75% to 85%). Claude Sonnet 5.5, the faster, cheaper model, got 79% (74% to 84%) from the same photos and 45% (38% to 51%) from the product name alone, so the photo does the work. The misses are hard to score: 81 of the 219 photos went up before their barcode's first USDA row was published, so a mismatch can mean the pack changed, not a misread. A photo of a turkey breast tub, uploaded in Jan 2022, says 8 oz; its USDA row, first in the Oct 2023 release, says 9 oz/255 g. Either could be right.