[GH-ISSUE #1999] [langsmith]: LangSmith traces from Claude Code do not expose cost, token usage, or detailed model metadata #252

Open
opened 2026-02-17 17:19:29 -05:00 by yindo · 0 comments
Owner

Originally created by @adhishthite on GitHub (Dec 21, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/1999

Type of issue

issue / bug

Language

Python

Description

I followed the documentation here: https://docs.langchain.com/langsmith/trace-claude-code

Tracing is working correctly and I can see requests in LangSmith. However, the trace UI does not surface key metadata that is expected for cost and usage analysis.

Observed behavior

  • Traces only display the model name as claude-sonnet-4-5
  • The following fields are missing or not visible:
  • Token usage (prompt, completion, total)
  • Cost per call / aggregated cost
  • Any breakdown of usage across runs

As a result, it is not possible to:

  • Identify top-cost traces
  • Compare usage across runs
  • Audit model-level spend

Expected behavior

When tracing Claude Code via LangSmith, I would expect parity with other LLM providers, including:

  • Token usage metrics
  • Cost visibility (or at least token-based cost attribution)
  • Clear model metadata beyond just the model name

Question / clarification needed

  • Is this a current limitation of Claude Code tracing?
  • Is additional configuration required to enable token + cost tracking?
  • Are there plans to expose this metadata in LangSmith for Claude models?

Here are a couple of traces made explicitly with Claude Opus 4.5:

Happy to provide more trace IDs or additional details if needed.

Originally created by @adhishthite on GitHub (Dec 21, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/1999 ### Type of issue issue / bug ### Language Python ### Description I followed the documentation here: https://docs.langchain.com/langsmith/trace-claude-code Tracing is working correctly and I can see requests in LangSmith. However, the trace UI does not surface key metadata that is expected for cost and usage analysis. ### Observed behavior - Traces only display the model name as claude-sonnet-4-5 - The following fields are missing or not visible: - Token usage (prompt, completion, total) - Cost per call / aggregated cost - Any breakdown of usage across runs As a result, it is not possible to: - Identify top-cost traces - Compare usage across runs - Audit model-level spend ### Expected behavior When tracing Claude Code via LangSmith, I would expect parity with other LLM providers, including: - Token usage metrics - Cost visibility (or at least token-based cost attribution) - Clear model metadata beyond just the model name ### Question / clarification needed - Is this a current limitation of Claude Code tracing? - Is additional configuration required to enable token + cost tracking? - Are there plans to expose this metadata in LangSmith for Claude models? Here are a couple of traces made explicitly with Claude Opus 4.5: - https://smith.langchain.com/public/b94a6831-b75b-4862-958b-3449bc644f10/r - https://smith.langchain.com/public/d27b3746-9ad6-49fe-b12f-e1c743d32ac3/r Happy to provide more trace IDs or additional details if needed.
yindo added the langsmithexternal labels 2026-02-17 17:19:29 -05:00
yindo changed title from [langsmith]: LangSmith traces from Claude Code do not expose cost, token usage, or detailed model metadata to [GH-ISSUE #1999] [langsmith]: LangSmith traces from Claude Code do not expose cost, token usage, or detailed model metadata 2026-06-05 17:25:52 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#252