[BUG] Env var loading order of operations regression for managed-settings.json

Resolved 💬 4 comments Opened Jan 5, 2026 by rbonestell Closed Feb 21, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I believe there has been a regression some point at 2.0.76 or before that has once again broken the order-of-operations for loading env vars from the managed-settings.json file for OTEL_ env vars:
https://github.com/anthropics/claude-code/issues/13803

The claude instance sees all of the proper values for the keys configured in the env section of managed-settings.json, but it is not reporting ANY OTEL data to the configured OTEL service. When the env vars are configured in the shell before launching claude everything works as expected.

What Should Happen?

  • Claude Code should load any and all env values from the managed-settings.json file before initializing OTEL resources.
  • When properly configured, Claude Code should ship OTEL data to the configured server/service.

Error Messages/Logs

There are no relevant messages or logs from Claude Code, I believe this is due to Claude Code not properly loading the env vars before attempting to initialize OTEL resources.

Steps to Reproduce

  1. Add OTEL-specific env vars to the managed-settings.json file for Claude Code, example:

``json
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": "https://otlp.datadoghq.com/v1/metrics",
"OTEL_EXPORTER_OTLP_LOGS_ENDPOINT": "https://otlp.datadoghq.com/v1/logs",
"OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "delta",
"OTEL_METRIC_EXPORT_INTERVAL": "60000",
"OTEL_EXPORTER_OTLP_HEADERS": "dd-api-key=REDACTED"
}
``

  1. Start Claude Code
  2. Observe that no OTEL data is transmitted to configured endpoints

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.70

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗