Conversation
Cost was previously computed with a single flat rate (Sonnet-based claudeStatus.pricing.* defaults) regardless of which model produced each entry, overestimating Haiku usage ~3x and underestimating Opus usage up to 5x. Each JSONL entry carries message.model, so price entries by it. - jsonlReader: built-in per-model rate table (Fable/Mythos 5, legacy Opus <=4.1, Opus 4.5+, Haiku, Sonnet) with resolveModelPricing() and entryCost(); UsageEntry gains a model field - New setting claudeStatus.pricing.useModelPricing (default true); unknown models and disabled mode fall back to manual pricing.* rates - All cost consumers (readAllUsage, projectCost, prediction, heatmap) now take CostOptions from config; prediction and heatmap previously ignored user pricing settings entirely and always used defaults - AggregatedUsage gains costByModel5h; dashboard token breakdown lists per-model 5h cost - l10n: EN/JA/ZH for the setting description and dashboard label - Docs: DATA.md pricing tables, SETTINGS.md, README (EN/JA/ZH), CHANGELOG - Tests: rate resolution, fallback, entryCost toggle, model parsing Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ZLCLQeudf1LQBnBSyyr4f
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Costs were computed with one flat rate — the Sonnet-based
claudeStatus.pricing.*defaults — regardless of which model produced each entry. That overestimates Haiku 4.5 usage ~3× and underestimates Opus usage up to 5×. Every JSONL entry carriesmessage.model, so this PR prices each entry by its model.Changes
Built-in per-model rates (
resolveModelPricing()injsonlReader.ts, first match wins, per 1M tokens; cache read = 0.1× input, cache write = 1.25× input per Anthropic's published pricing):fable,mythosclaude-3-opus,opus-4-0/1,opus-4-2025opushaikusonnetclaudeStatus.pricing.useModelPricing(boolean, defaulttrue). Unrecognized models (e.g.<synthetic>) — and every entry when disabled — fall back to the manualclaudeStatus.pricing.*rates, so the old behavior is one toggle away.CostOptions:readAllUsage,projectCost,prediction,heatmapnow takeconfig.costOptions. This also fixes a pre-existing inconsistency: prediction and heatmap previously ignored the user'spricing.*settings and always used the hardcoded defaults.sonnet-4-5: $0.42,haiku-4-5: $0.03), fed by a newcostByModel5haggregate.package.nls*+l10n/bundle.l10n.*).docs/DATA.md(model-aware + manual pricing tables),docs/SETTINGS.md, README settings tables (EN / JA / ZH), CHANGELOG.Tests
New suites cover rate resolution per family (including the legacy-Opus-before-generic-Opus ordering), fallback for unknown/missing models, the
useModelPricingtoggle inentryCost, andmodelparsing inreadUsageEntries.npm run lint✅,npm run compile✅, unit suites (43 tests) ✅ via mocha;@vscode/test-electroncannot download VS Code in this sandbox — please rely on CI for the extension-host suites.Note: since costs are estimates, displayed totals will change for users mixing models (they become more accurate). Called out in the CHANGELOG.
🤖 Generated with Claude Code
https://claude.ai/code/session_012ZLCLQeudf1LQBnBSyyr4f
Generated by Claude Code