You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cache-miss attribution from the diagnostics field in transcripts #1804
Newer Claude Code transcripts carry message.diagnostics.cache_miss_reason on some
assistant records (types seen: previous_message_not_found, messages_changed,
tools_changed, system_changed, model_changed, unavailable). ccusage sums cache creation
and read tokens but does not surface why a cache was rebuilt. I wrote a small standalone
tool that does (https://github.com/CedricConday/cachemiss): per rebuild, the reason, the
tokens rewritten and the write premium, attributed to sub-agents via the subagents/
transcript files. If you would take a "cache misses" column or a --misses report in
ccusage, I would be glad to port the attribution logic; the reader and the inference rules
are about 300 lines with tests.
Requests a new cache-misses column or report using diagnostics cache_miss_reason. This is a new presentation surface, not a fix for incorrect reporting, with no maintainer endorsement, so it is an excluded feature request with low priority.
Thanks for the detailed write-up and for building cachemiss! The data is definitely real: I checked my own logs and message.diagnostics.cache_miss_reason shows up on a couple thousand assistant records across all six reason types you listed.
That said, we're going to keep this out of ccusage for now, for a few reasons:
New public surface. A cache-miss column or --misses report would add a new table/JSON contract that we'd need to keep stable long-term.
Undocumented source field.diagnostics is an internal Claude Code transcript field, so its shape can change or disappear without notice.
Claude-only. None of the other supported agents expose an equivalent, while ccusage aims to keep reports consistent across sources.
Scope. ccusage focuses on usage and cost accounting; explaining why a cache was rebuilt is closer to a cost-tuning diagnostic, which your standalone tool already does well.
If you'd like more visibility for cachemiss, a PR adding it to docs/guide/community-projects.md would be very welcome. Thanks again!
Activity
pullfrog commentedon Sep 26, 2026
github-actions commentedon Sep 26, 2026
Pullfrog triage: priority:low
Kind: feature request
Maintenance fit: excluded
Confidence: high
Requests a new cache-misses column or report using diagnostics cache_miss_reason. This is a new presentation surface, not a fix for incorrect reporting, with no maintainer endorsement, so it is an excluded feature request with low priority.
Decision: closed by the contribution gate.
ryoppippi commentedon Sep 27, 2026
Thanks for the detailed write-up and for building
cachemiss! The data is definitely real: I checked my own logs andmessage.diagnostics.cache_miss_reasonshows up on a couple thousand assistant records across all six reason types you listed.That said, we're going to keep this out of ccusage for now, for a few reasons:
--missesreport would add a new table/JSON contract that we'd need to keep stable long-term.diagnosticsis an internal Claude Code transcript field, so its shape can change or disappear without notice.If you'd like more visibility for
cachemiss, a PR adding it todocs/guide/community-projects.mdwould be very welcome. Thanks again!