CLAUDE LABJP
2.1.273 — A round of connection work landed together: five opt-in headers for LLM gateways, and a notice when Claude Code stops trying to reconnect an MCP server09/29 — The date beside claude-sonnet-4-5 is 12 days out, but it is an earliest-possible estimate. The model is still Active, and public retirements get at least 60 days noticeMCP — People keep asking to reconnect a dropped server without ending the session. The disconnect is now announced, but reattaching is still something you do by handNEW — A scheduled task ran some days and not others. The cause was that only one folder had been bound to itWINDOWS — When Cowork fails on its very first task, check developer mode and the setup state before going looking for a causeHANDOFF — Before a long draft gets too heavy for one chat, decide on the three things the summary must carry into the next one2.1.273 — A round of connection work landed together: five opt-in headers for LLM gateways, and a notice when Claude Code stops trying to reconnect an MCP server09/29 — The date beside claude-sonnet-4-5 is 12 days out, but it is an earliest-possible estimate. The model is still Active, and public retirements get at least 60 days noticeMCP — People keep asking to reconnect a dropped server without ending the session. The disconnect is now announced, but reattaching is still something you do by handNEW — A scheduled task ran some days and not others. The cause was that only one folder had been bound to itWINDOWS — When Cowork fails on its very first task, check developer mode and the setup state before going looking for a causeHANDOFF — Before a long draft gets too heavy for one chat, decide on the three things the summary must carry into the next one
Articles/API & SDK
API & SDK/2026-07-10Advanced

Don't Trust the Confidence Score: Per-Class Calibration and Abstain Routing for Vision Classification

Overall accuracy looked fine while individual categories quietly collapsed. Here is how I calibrated Claude Vision's self-reported confidence per class and routed abstentions to a human queue.

Claude API121Vision3ClassificationEvaluationIndie Dev22

Premium Article

I was staring at a spreadsheet of classification results when I stopped scrolling. Overall agreement read 92.3%. But when I filtered down to the "animal" category alone, it was 71% — and the model had returned confidence values around 0.9 on most of that wrong 29%.

Confidently wrong. That turned out to be the worst failure mode of all.

For the wallpaper app I run as an indie developer, newly added images are sorted into 30 categories by Claude Vision. I wrote about the initial setup in automating wallpaper category classification with the Claude Vision API. What emerged after months of actually running it was this pattern: the aggregate looks healthy while a handful of classes rot underneath.

This article is the cleanup. It covers calibrating confidence per class and routing everything below the line into a human review queue.

"Confidence: 0.9" Is Not a Probability

Let's get the premise straight. When you ask for structured output containing confidence: 0.92, that number is not a probability. It is a plausible-looking number the model generated as text.

NameWhat it actually isUsable as a probability?
Self-reported confidenceA number the model wrote as a stringNot as-is
Logprob-derived probabilityToken generation probabilityApproximately, after calibration
Calibrated scoreMapped to empirical accuracy on a validation setYes

That does not make it useless. Self-reported confidence is usually meaningful as an ordering. A prediction at 0.95 is more likely correct than one at 0.65. What fails is the reading "0.9 means 90% correct."

So trust only the ordering, and measure from a validation set where the line has to be drawn to hit your precision target. That is what calibration means in practice.

Is 400 Images Enough?

I relabeled 412 images by hand. The eight most frequent of the 30 categories account for just over half of them; tail categories like "retro" and "minimal" have only five to nine each.

Which raised an honest question: can a threshold learned from six images mean anything?

My answer is that it can, but you have to change how you pick it. For thin classes, fine-grained optimization just overfits the validation set. So I split the classes into two tiers by support.

TierValidation imagesHow the threshold is chosenCategories
Thick20 or moreSearched individually11
ThinFewer than 20Share one conservative threshold (0.93)19

Thin classes are poor candidates for auto-acceptance anyway. Give them a conservative shared line and send the rest to a human. That is enough.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Self-reported confidence used with a single global threshold silently breaks your smallest classes
How to search for the lowest threshold that still meets a precision target, per class, with working code
Routing abstentions into a prioritized human queue, and catching calibration drift week over week
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $15 for lifetime access
View Membership →

Related Articles

API & SDK2026-07-13
Full-Size or Downscaled? A Per-Image Resolution Rule for Opus 4.7's High-Resolution Vision
Opus 4.7 finally read the fine texture in my wallpapers, so I sent everything at full size. My weekly image tokens jumped 2.4x. Here is the preflight that decides resolution and model per image, with the measured savings.
API & SDK2026-07-12
When You Give an API Key an Expiration Date, Expiry Becomes a Plan Instead of an Accident
The Console now lets you set expiration dates on API keys. Here is how to fold planned expiry into unattended operations — with overlapping dual keys and a local expiry ledger — so your nightly jobs never go dark.
API & SDK2026-05-15
Automating Wallpaper Classification with Claude Vision API — Accuracy, Cost, and a Batch Job That Survives Interruptions
A firsthand account of automating wallpaper category classification with the Claude Vision API. Honest numbers on accuracy and cost, plus the batch design that stopped me re-paying for the same images.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links