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
Two Claude Code accounts on one Mac are common (personal Max plan + employer Team plan, switched via CLAUDE_CONFIG_DIR). Today this breaks in two independent, silent ways:
Attribution: even once a second root is scanned, everything merges into one undifferentiated total. The transcripts themselves carry no account/org field on any line, so a jsonl parser cannot attribute usage — the root is the only attribution boundary that exists on disk.
Real-world numbers from my machine: default root 1,334 session files / 701MB (personal Max 5x), second root invisible — including sessions from the same evening missing from todayTotalTokens.
Proposal
Layered on top of per-provider scan folders (#177/#187), not competing with it:
Root → account mapping: each Claude config root contains .claude.json with an oauthAccount block (email, org name, org type). Read it once per root (cached by mtime) and tag the root with that identity.
Entry tagging: add an optional accountKey (the root it came from, resolved to the account identity when known) to LocalUsageReader.Entry / the provider snapshot. Dedup stays global by entry ID.
Display: default UI unchanged (one merged total — the companion aggregates everything, per the no-provider-branch rule). Add a per-account breakdown in the popover's Claude section when more than one account is present, mirroring how scopedLimitEntries extends the limits list.
This composes with #187's per-provider folders: those PRs contribute the roots; this contributes what the roots mean. It also complements #199 (account labeling on the official limits), which covers the OAuth side of the same two-account confusion.
Open questions
Is an account dimension on Entry acceptable, or would you rather keep Entry flat and aggregate per-root at the provider-snapshot level? (Snapshot-level is smaller; entry-level survives cache merging.)
.claude.json is large (can be several MB) — proposal reads only the oauthAccount object via JSONSerialization on a mtime-gated cache. Any concerns?
Happy to implement after alignment — flagging the design first since this touches Entry and the cache format.
Problem
Two Claude Code accounts on one Mac are common (personal Max plan + employer Team plan, switched via
CLAUDE_CONFIG_DIR). Today this breaks in two independent, silent ways:~/.claude-tradeengage) is invisible — its tokens never reach the egg. Extend additional scan folders to every provider, not just Claude #177 / feat: add per-provider additional scan folders (#177) #187 / Add user-configurable additional scan folders with wildcard support #162 address finding the folders; this issue is about what happens after they're found.Real-world numbers from my machine: default root 1,334 session files / 701MB (personal Max 5x), second root invisible — including sessions from the same evening missing from
todayTotalTokens.Proposal
Layered on top of per-provider scan folders (#177/#187), not competing with it:
.claude.jsonwith anoauthAccountblock (email, org name, org type). Read it once per root (cached by mtime) and tag the root with that identity.accountKey(the root it came from, resolved to the account identity when known) toLocalUsageReader.Entry/ the provider snapshot. Dedup stays global by entry ID.scopedLimitEntriesextends the limits list.This composes with #187's per-provider folders: those PRs contribute the roots; this contributes what the roots mean. It also complements #199 (account labeling on the official limits), which covers the OAuth side of the same two-account confusion.
Open questions
Entryacceptable, or would you rather keepEntryflat and aggregate per-root at the provider-snapshot level? (Snapshot-level is smaller; entry-level survives cache merging.).claude.jsonis large (can be several MB) — proposal reads only theoauthAccountobject viaJSONSerializationon a mtime-gated cache. Any concerns?Happy to implement after alignment — flagging the design first since this touches
Entryand the cache format.