[BUG] OTEL event/log organization.id doesn't match `~/.claude.json` > `.oauthAccount.organizationUuid`
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude Code
- Claude CLI version: 1.0.59
- Operating System: macos 15.5
- Terminal: iterm + vscode terminal
Bug Description
When experimenting with otel logging, I tried switching between anthropic console api keys and a personal claude code max 5x subscription. I see the change taking effect in the ~/.claude.json file, but the logs still report as the anthropic console organization ID, even when using my personal claude subscription
Steps to Reproduce
- Login through claude subscription, set up OTEL logging, make a request
- Note that organization.id doesn't match what's in the json file
- Swap to anthropic api key
- Note that it now matches
Expected Behavior
Org UUID matches the logged in org, even if the same account (ID'd by uuid) exists in both organization
Actual Behavior
Org ID only is the anthropic org
Additional Context
Discovered while setting up otel logging, and tried to self-correct using OTEL_RESOURCE_ATTRIBUTES, which didn't propagate to logs, but did show correctly in the traces I am manually creating with otel-cli
Related: https://github.com/anthropics/claude-code/issues/4338
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗