plan: add cache token stats to /stats Models tab for all users#1
Open
stephenc222 wants to merge 2 commits intomainfrom
Open
plan: add cache token stats to /stats Models tab for all users#1stephenc222 wants to merge 2 commits intomainfrom
stephenc222 wants to merge 2 commits intomainfrom
Conversation
The ODK component in /stats already receives cacheReadInputTokens and cacheCreationInputTokens in its usage prop but doesn't render them. This plan describes adding cache read, cache write, and cache hit rate to the per-model display, visible to both API and subscription users. https://claude.ai/code/session_017tJSn9vuqQJY7yQv2Hoqoa
Adds a patch script and test suite that modifies the compiled cli.js to show prompt cache read, cache write, and cache hit rate in the /stats Models tab for all users (API and subscription). The ODK component already receives cacheReadInputTokens and cacheCreationInputTokens in its usage prop but does not render them. The patch adds: - Cache R: / Cache W: token counts on the per-model line - Cache hit: percentage (cacheRead / totalInput * 100) - Only shown when cache data > 0 (no noise for non-cached sessions) scripts/patch-stats-cache.js - applies the patch to cli.js scripts/test-patch-stats-cache.js - 11 assertions across 5 test cases https://claude.ai/code/session_017tJSn9vuqQJY7yQv2Hoqoa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ODK component in /stats already receives cacheReadInputTokens and
cacheCreationInputTokens in its usage prop but doesn't render them.
This plan describes adding cache read, cache write, and cache hit rate
to the per-model display, visible to both API and subscription users.
https://claude.ai/code/session_017tJSn9vuqQJY7yQv2Hoqoa