Repository navigation
Replies: 1 comment
|
+1. My case: two Claude accounts as separate instances, a Max plan (work, default Right now the Usage page shows one combined "Claude Code" row, so I can't tell the two apart. The proposal (sub-rows per instance, nothing changes with a single instance) sounds like exactly the right scope. Happy to test it on Linux desktop (Manjaro, GNOME) if that helps. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
I run three Claude accounts in T3 Code as separate provider instances, each with its own home (
~/.claude,~/.claude-work,~/.claude-side). The Usage page puts all of that spend on one "Claude Code" row, so I can't see which account is driving cost or tokens. The same applies to anyone with multiple Codex homes.The server already scans each instance's transcript directory separately, and every bucket carries
sourcePath. The only thing lost is which instance a directory belongs to, so the client can't label it.Proposal
instance({ id, displayName?, accentColor? }) toUsageSource. It is additive, so there is no contract version bump, and older clients ignore it.UsageServicesets it where each instance's transcript directory is resolved. If two instances share a directory, the first instance wins.mergeUsagereturns per-instance totals (cost, tokens, sessions, shares), keyed by provider + instance id, so the same instance on two environments shows as one row. Summaries from older servers withoutsourcePathstill attribute correctly when a provider has one source.mergeUsage; no UI change unless you want one.Overall: 7 files, about 275 lines, including tests (an extended multi-account case in
UsageService.test.tsand a new merge case inusageMerge.test.ts).Evidence
I have this working on a branch. Over 30 days on my machine, the per-account totals match an independent script that reads each home directory, to within a few cents:
~/.claude)Would you accept a PR along these lines? I'm happy to change the scope, for example splitting the chart series by account too, or dropping the web UI and only exposing the data.
All reactions