claude-code - 💡(How to fix) Fix [Bug] OTEL data missing COST_USD field in API request events (v2.1.122+) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56098Fetched 2026-05-05 05:58:16
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

Bug Description Note that we see this across our telemetry data.

Claude Code client versions 2.1.122 and newer stopped emitting the COST_USD field on API request events. Token counts and model names still come through fine - only the cost field is NULL.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.118
  • Feedback ID: 84929ac9-4496-484f-ba32-b612103ed12a

Errors No explicit errors, it is missing data.

extent analysis

TL;DR

The issue may be resolved by upgrading the Claude Code client version to one that is known to emit the COST_USD field on API request events.

Guidance

  • Verify the version of the Claude Code client being used to confirm it is 2.1.122 or newer, as these versions are reported to have the issue.
  • Check the API request events for any other missing fields to determine if the issue is isolated to the COST_USD field.
  • Test with an older version of the Claude Code client (e.g., 2.1.118) to see if the COST_USD field is emitted correctly.
  • Review the telemetry data to confirm that the issue is consistent across all instances of the Claude Code client with versions 2.1.122 and newer.

Notes

The issue seems to be specific to the COST_USD field and does not affect other fields such as token counts and model names. The cause of the issue is not explicitly stated, but it appears to be related to the version of the Claude Code client.

Recommendation

Apply workaround: Use an older version of the Claude Code client (e.g., 2.1.118) until a fixed version is available, as this version is reported to emit the COST_USD field correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING