Skip to content

plan: add cache token stats to /stats Models tab for all users#1

Open
stephenc222 wants to merge 2 commits intomainfrom
claude/research-prompt-cache-imKKX
Open

plan: add cache token stats to /stats Models tab for all users#1
stephenc222 wants to merge 2 commits intomainfrom
claude/research-prompt-cache-imKKX

Conversation

@stephenc222
Copy link

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants