[BUG] Desktop Code sessions do not apply server-managed OTel env settings from the admin console
Preflight Checklist
- [x] I searched existing issues, including #67657 and #46204
- [x] This is a single bug report
- [x] The issue reproduces after fully quitting and restarting the Desktop app
What is wrong?
Server-managed settings configured in the Claude organization admin console are saved and active, but a local Code session in the Claude Desktop app does not apply the OTel environment settings. No telemetry from the Desktop Code session reaches the configured collector. The standalone Claude Code CLI on the same machine and account exports successfully.
This differs from #67657: that issue now has evidence that recent Desktop builds apply the exporter endpoint and headers from a local MDM managed-settings.json file while losing OTEL_RESOURCE_ATTRIBUTES. In this reproduction, the admin-console-delivered settings do not appear in the Desktop Code child process at all, and zero events are exported.
Environment
- macOS 26.4.1 arm64
- Claude Desktop 1.32352.0
- Desktop-bundled Claude Code 2.1.229
- Organization-managed Claude account
- Managed settings source: Claude organization admin console, not a local MDM file
- Session type: Desktop app, local Code session
Managed settings
The organization admin console shows an active saved version of settings.json. The env block includes the documented OTel settings:
- CLAUDE_CODE_ENABLE_TELEMETRY=1
- OTEL_LOGS_EXPORTER=otlp
- OTEL_EXPORTER_OTLP_ENDPOINT=<redacted>
- OTEL_EXPORTER_OTLP_HEADERS=<redacted>
- OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
- OTEL_METRICS_EXPORTER=none
The endpoint and authorization value are intentionally omitted. The JSON is nested under env and is accepted by the admin UI.
Steps to reproduce
- In the organization admin console, open Claude Code > Managed settings.
- Save a valid settings.json with the OTel env settings above.
- Confirm the admin UI shows the saved version as active.
- Fully quit the Claude Desktop app.
- Relaunch it and create a new local Code session.
- Send a short prompt.
- Inspect the spawned bundled CLI process and the configured collector.
Actual behavior
- The Desktop app spawns the bundled CLI with --setting-sources=user,project,local and --settings {}.
- The spawned process has the Desktop-provided OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES, but none of CLAUDE_CODE_ENABLE_TELEMETRY, OTEL_LOGS_EXPORTER, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, or OTEL_EXPORTER_OTLP_PROTOCOL.
- The local remote settings cache is an empty JSON object.
- No prompt, API request, tool decision, or tool result event from the Desktop Code session reaches the collector.
- Fully quitting and restarting the app, then starting a new local Code session, does not change the result.
- The standalone CLI on the same machine exports prompt, API request, tool decision, and tool result events successfully, confirming that the collector and downstream pipeline are healthy.
- No error or warning is shown in the Desktop UI.
Expected behavior
The server-managed env settings saved in the organization admin console should be fetched and applied to Desktop local Code sessions before OTel initialization, as documented by the admin UI and server-managed settings documentation. The Desktop session should export to the configured OTLP endpoint, or surface an actionable error if the settings cannot be fetched or require approval.
Additional notes
The admin UI explicitly states that managed settings apply to CLI, IDE, and Desktop Claude Code. The current behavior is silent, so administrators can believe organization-wide telemetry is active while Desktop Code usage is completely absent.
Related issues: #67657, #46204, and #82332.