[BUG] CLI: after /login → "Anthropic Console account", OTel and API request metadata carry no identity (organization.id, user.* empty; metadata.user_id.account_uuid = "")
What's wrong
After signing in with /login → Anthropic Console account, the CLI emits every OTel log, span and metric without organization.id, user.account_uuid, user.account_id or user.email. This holds both after an in-session login and after a fresh start on the stored credentials.
It isn't limited to telemetry. With OTEL_LOG_RAW_API_BODIES=1, the CLI's own Messages API requests show an empty account in the request metadata:
"metadata":{"user_id":"{\"device_id\":\"<device>\",\"account_uuid\":\"\",\"session_id\":\"<session>\"}"}
The account is known locally: after the same login, ~/.claude.json → oauthAccount is fully populated (accountUuid, emailAddress, organizationUuid = the Console org, billingType: "prepaid"). The auth event emitted at login also carries the correct organization.id and user.email. Only the process's runtime identity is empty.
The other two sign-in paths work correctly on the same machine and install:
| /login choice | organization.id / user.* on OTel | metadata.user_id.account_uuid |
|---|---|---|
| Claude account (Team plan) | present | — (not captured) |
| Anthropic Console account | empty on every signal | "" (8 of 8 requests) |
| Console, "create API key" | present (Console org) | populated (3 of 3 requests) |
This is the same symptom as #57908 (web client, closed stale). The cloud-session variant was fixed in v2.1.259 (#88490), but the local CLI Console-account path still has it on 2.1.283.
What should happen
After a Console-account login, the CLI should attach the signed-in account's organization.id, user.account_uuid, user.account_id and user.email to OTel, and send the account UUID in metadata.user_id, as it does for the other two login paths.
Steps to reproduce
- Configure OTLP export to a local sink (any OTLP/HTTP receiver that logs payloads), with
OTEL_LOGS_EXPORTER=otlp,OTEL_TRACES_EXPORTER=otlp,OTEL_METRICS_EXPORTER=otlp,CLAUDE_CODE_ENABLE_TELEMETRY=1,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1,OTEL_LOG_RAW_API_BODIES=1. - Start
claudesigned in with a Claude (Team) account and send a prompt → events carryorganization.idanduser.email. - Run
/login→ Anthropic Console account → complete the browser flow. Anauthevent arrives withorganization.id= the Console org. - Send a prompt → every subsequent
api_request,user_prompt, span and metric has noorganization.id/user.*.api_request_bodyshowsaccount_uuid: "". /exitand startclaudeagain (stored Console-account credentials) → identity is empty from the first event (managed_settings_resolved,trigger=startup), and noauthevent is emitted./login→ Console, create API key → from the next prompt,organization.id,user.*andmetadata.user_id.account_uuidare populated.
Reproduced in four separate processes/sessions under a custom CLAUDE_CONFIG_DIR, and again with the default config directory (no CLAUDE_CONFIG_DIR). In the default directory, identity was also empty from startup and metadata.user_id.account_uuid was "". Results are identical each time.
Impact
Organizations that bill Claude Code usage through a Console org can't attribute that usage to a person or an org from telemetry. All the org-level and user-level fields are missing. Only the anonymous user.id remains, and nothing distinguishes this spend from usage on another org. cost_usd is still reported, so the spend is visible but unattributable.
Also observed (possibly related)
A running process that was emitting blank identity after a Console-account login switched to emitting the Team org's organization.id mid-session, with no /login and no auth event in that process. This coincided with a /login to the Team account in a different claude process using the same config directory. In one instance, the config directory's keychain entry (Claude Code-credentials-<hash>) was rewritten at 09:57:30 UTC by the other process's login. The idle process sent its next request at 09:59:40 UTC, already under the Team org. This happened twice. So a process's telemetry identity (and presumably its billing account) can change because of another process's login, with no auth event in the affected process.
Environment
- Claude Code version: 2.1.283
- Platform: Anthropic API (first-party)
- OS: macOS (Darwin 25.6.0, arm64)
- Terminal: Orca (
terminal.type=Orca) - Reproduces with and without
CLAUDE_CONFIG_DIR - Is this a regression? Unknown
Related: #57908, #88490, #90288
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗