Feature request: support selecting / switching the Claude organization
Summary
ClaudeMeter currently has no way to choose which Claude organization it reports
usage for. On accounts that belong to more than one organization (e.g. a
personal org plus one or more team/enterprise orgs), the app silently locks onto
whichever org happens to be returned first by the Claude API and offers no UI
to change it. Users on the "wrong" org see usage numbers that don't match
claude.ai/settings/usage, with no obvious cause or remedy.
This request asks for an organization picker (and/or automatic use of the
account's currently active org).
Environment
- App: ClaudeMeter (Homebrew cask
eddmann/tap/claudemeter)
- Bundle ID:
com.eddmann.ClaudeMeter
- macOS menu-bar build, session-key auth (claude.ai cookie)
- Account: member of multiple organizations
Current behavior
- User configures a session key (auto-import or manual paste).
- The menu bar shows usage for one organization.
- That organization is not the one the user wants, and there is no setting
anywhere in the app to change it.
- None of the obvious user-side actions have any effect:
- Switching the active org inside claude.ai in the browser.
- Re-importing / re-pasting the session key.
- Clearing and re-adding the session key.
Expected behavior
When an account belongs to multiple organizations, the user can either:
- pick the target organization explicitly from a list (preferred), and/or
- have the app follow the account's currently active organization,
and the menu-bar usage updates to that organization.
Root cause
The organization is resolved once and cached, with no path back to the other
orgs the account can see.
Org resolution — ClaudeMeter/Services/UsageService.swift
The org id is chosen in this priority order:
settings.cachedOrganizationId (if set, always wins)
sessionKey.organizationId (typically nil for a manually pasted key)
organizations.first from GET /api/organizations
The usage call is then made against
…/organizations/{organizationId}/usage.
Where the cache is written — ClaudeMeter/App/AppModel.swift,
validateAndSaveSessionKey(_:)
On every session-key save, the app fetches the org list and unconditionally
takes the first element:
let organizations = try await usageService.fetchOrganizations(sessionKey: sessionKey)
guard let firstOrg = organizations.first,
let orgUUID = firstOrg.organizationUUID else {
throw AppError.organizationNotFound
}
...
settings.cachedOrganizationId = orgUUID
fetchOrganizations (UsageService.swift) already retrieves all
organizations via GET /api/organizations (OrganizationListResponse), but only
.first is ever used; the rest are discarded.
Reset path — AppModel.clearSessionKey() sets
settings.cachedOrganizationId = nil, but the next setup re-runs the
organizations.first logic and lands on the same org again.
Why each workaround fails
| Action |
Why it has no effect |
| Switch active org in claude.ai |
The server-side order of GET /api/organizations does not change, and cachedOrganizationId takes precedence regardless. |
| Re-import / re-paste session key |
Re-runs validateAndSaveSessionKey, which again picks organizations.first. |
| Clear + re-add session key |
clearSessionKey() nils the cache, but re-setup re-pins to the first org. |
| Re-auth Claude Code CLI |
This app reads a claude.ai sessionKey cookie, not the CLI OAuth token, so the CLI's org is irrelevant. |
Current manual workaround (for reference)
The only way to change the org today is to overwrite the cached UUID directly in
UserDefaults (key app_settings, field cached_organization_id, domain
com.eddmann.ClaudeMeter) and relaunch. This requires knowing the target org's
UUID (e.g. from https://claude.ai/api/organizations) and is clearly not a
user-facing solution. It also gets wiped by "Clear session key".
Proposed solution
- Organization picker in Settings.
- After a session key validates, call the existing
fetchOrganizations() and
present all returned orgs (name + UUID) in a Picker, similar to the
existing refresh-interval / icon-style pickers in SettingsView.
- Persist the selected UUID to
settings.cachedOrganizationId.
- Default the selection to
organizations.first to preserve current behavior
for single-org accounts.
- Re-selectable without re-auth.
- Allow changing the org from Settings at any time without clearing the
session key, writing the new UUID to cachedOrganizationId and forcing a
refresh.
- Optional: show org name in the menu / Settings so the user can confirm at
a glance which org is being tracked.
- Optional: "follow active org" mode that re-resolves the active org on each
refresh instead of caching, for users who switch orgs frequently.
Acceptance criteria
- A multi-org account can select any of its organizations from the app UI.
- The selected org persists across relaunch.
- The org can be changed later without removing the session key.
- Single-org accounts see no change in behavior or extra prompts.
- The currently tracked org is identifiable from the UI.
Implementation notes
Most of the plumbing already exists:
fetchOrganizations() already returns the full OrganizationListResponse.
AppSettings.cachedOrganizationId is already persisted and already consumed
with top priority by UsageService.
The main work is UI (a picker + a "tracked org" label) plus a settings-change
hook that updates cachedOrganizationId and triggers refreshUsage(forceRefresh:),
rather than only writing it inside validateAndSaveSessionKey.
Feature request: support selecting / switching the Claude organization
Summary
ClaudeMeter currently has no way to choose which Claude organization it reports
usage for. On accounts that belong to more than one organization (e.g. a
personal org plus one or more team/enterprise orgs), the app silently locks onto
whichever org happens to be returned first by the Claude API and offers no UI
to change it. Users on the "wrong" org see usage numbers that don't match
claude.ai/settings/usage, with no obvious cause or remedy.This request asks for an organization picker (and/or automatic use of the
account's currently active org).
Environment
eddmann/tap/claudemeter)com.eddmann.ClaudeMeterCurrent behavior
anywhere in the app to change it.
Expected behavior
When an account belongs to multiple organizations, the user can either:
and the menu-bar usage updates to that organization.
Root cause
The organization is resolved once and cached, with no path back to the other
orgs the account can see.
Org resolution —
ClaudeMeter/Services/UsageService.swiftThe org id is chosen in this priority order:
settings.cachedOrganizationId(if set, always wins)sessionKey.organizationId(typically nil for a manually pasted key)organizations.firstfromGET /api/organizationsThe usage call is then made against
…/organizations/{organizationId}/usage.Where the cache is written —
ClaudeMeter/App/AppModel.swift,validateAndSaveSessionKey(_:)On every session-key save, the app fetches the org list and unconditionally
takes the first element:
fetchOrganizations(UsageService.swift) already retrieves allorganizations via
GET /api/organizations(OrganizationListResponse), but only.firstis ever used; the rest are discarded.Reset path —
AppModel.clearSessionKey()setssettings.cachedOrganizationId = nil, but the next setup re-runs theorganizations.firstlogic and lands on the same org again.Why each workaround fails
GET /api/organizationsdoes not change, andcachedOrganizationIdtakes precedence regardless.validateAndSaveSessionKey, which again picksorganizations.first.clearSessionKey()nils the cache, but re-setup re-pins to the first org.sessionKeycookie, not the CLI OAuth token, so the CLI's org is irrelevant.Current manual workaround (for reference)
The only way to change the org today is to overwrite the cached UUID directly in
UserDefaults(keyapp_settings, fieldcached_organization_id, domaincom.eddmann.ClaudeMeter) and relaunch. This requires knowing the target org'sUUID (e.g. from
https://claude.ai/api/organizations) and is clearly not auser-facing solution. It also gets wiped by "Clear session key".
Proposed solution
fetchOrganizations()andpresent all returned orgs (name + UUID) in a
Picker, similar to theexisting refresh-interval / icon-style pickers in
SettingsView.settings.cachedOrganizationId.organizations.firstto preserve current behaviorfor single-org accounts.
session key, writing the new UUID to
cachedOrganizationIdand forcing arefresh.
a glance which org is being tracked.
refresh instead of caching, for users who switch orgs frequently.
Acceptance criteria
Implementation notes
Most of the plumbing already exists:
fetchOrganizations()already returns the fullOrganizationListResponse.AppSettings.cachedOrganizationIdis already persisted and already consumedwith top priority by
UsageService.The main work is UI (a picker + a "tracked org" label) plus a settings-change
hook that updates
cachedOrganizationIdand triggersrefreshUsage(forceRefresh:),rather than only writing it inside
validateAndSaveSessionKey.