Skip to content

Emit canonical Claude cache metrics#31

Merged
Andrew Kent (realark) merged 1 commit into
mainfrom
trace-claude-canonical-cache-metrics
Jul 1, 2026
Merged

Emit canonical Claude cache metrics#31
Andrew Kent (realark) merged 1 commit into
mainfrom
trace-claude-canonical-cache-metrics

Conversation

@Qard

Copy link
Copy Markdown
Contributor

Summary

  • emit Braintrust canonical cache metrics from Claude Code usage instead of raw Anthropic cache metric names
  • make Anthropic prompt and total token counts inclusive of cache read/write tokens
  • preserve aggregate-only fallback and prefer 5m/1h split cache write metrics when Claude Code exposes the TTL breakdown
  • document the canonical metric shape and update fixture/unit assertions

Validation

  • bash plugins/trace-claude-code/test/run_tests.sh test_common test_post_tool_use test_fixture_replay test_stop_hook
  • make test

@Qard
Stephen Belanger (Qard) marked this pull request as ready for review June 29, 2026 13:44
@Qard Stephen Belanger (Qard) added the bug Something isn't working label Jun 29, 2026
@realark
Andrew Kent (realark) merged commit 9ac9513 into main Jul 1, 2026
1 check passed
@realark
Andrew Kent (realark) deleted the trace-claude-canonical-cache-metrics branch July 1, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants