You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Usage cost by provider does not sum multiple instances of the same provider #24039
Configure two or more instances of the same driver (here: Claude), each used for real work in the selected date range.
Open the Usage page and switch the metric to cost.
Compare the provider row for that driver (for example "Claude Code") with the cost of each instance's own transcripts.
Not yet reduced to a deterministic repro: reported from a live setup.
Expected behavior
The provider row shows the sum of cost across all instances of that driver.
Actual behavior
The provider row does not add up the usage of the multiple instances of the same provider. The total is lower than the sum of the instances. How much lower, and whether only one instance counts, was not measured.
Impact
Minor to major: the cost figure and its share of total cost are wrong for anyone who runs several accounts of one provider, which is the case multi-instance support is built for.
Environment
macOS, two Claude instances. App version not recorded. Code read against main @ d7a8d6f.
Suspected area (unverified)
Not confirmed. Places worth checking first:
apps/server/src/usage/UsageService.tsresolveTranscriptDirs: one transcript directory per instance, skipped when provider + realpath(dir) was already seen. Instances that resolve to the same directory count once. The directory comes from homePath, then CLAUDE_CONFIG_DIR, then ~/.claude (apps/server/src/provider/Drivers/claudeUsage.ts).
apps/server/src/usage/usageAggregation.ts drops records with a repeated dedupeKey, so overlapping or copied transcript folders lose records.
apps/web/src/components/usage/UsagePage.tsx (provider rows) reads merged.providers.find(entry.provider === provider), so totals group by driver kind, not by instance. Check that the merge keeps every instance's totals.
A server test with two Claude instances that have separate homePath values and different transcripts would show which layer drops the cost.
Tested the web Usage → Cost page on Linux at 66ee628e08, using two Claude instances with separate homePath directories containing two disjoint real transcripts, over the same 30-day window. After refreshing: instance A alone showed $0.53 (1 session), B alone $0.17 (1 session), and both together $0.70 (2 sessions). This did not reproduce the undercount.
Please provide the affected app version, selected date range, each instance’s measured expected cost versus the displayed Claude total, and whether their homePath/CLAUDE_CONFIG_DIR values resolve to separate directories. An anonymized pair of transcript usage records that should both count would help distinguish missing-instance scanning from repeated-message deduplication. Remove credentials and message content.
Activity
juliusmarminge commentedon Oct 23, 2026
Tested the web Usage → Cost page on Linux at 66ee628e08, using two Claude instances with separate homePath directories containing two disjoint real transcripts, over the same 30-day window. After refreshing: instance A alone showed $0.53 (1 session), B alone $0.17 (1 session), and both together $0.70 (2 sessions). This did not reproduce the undercount.
Please provide the affected app version, selected date range, each instance’s measured expected cost versus the displayed Claude total, and whether their homePath/CLAUDE_CONFIG_DIR values resolve to separate directories. An anonymized pair of transcript usage records that should both count would help distinguish missing-instance scanning from repeated-message deduplication. Remove credentials and message content.
github-actions commentedon Oct 31, 2026
Closing: no reply in 7 days after we asked for more information. Comment with the missing details and we will reopen.