Session profiles: how workload type affects cache performance #23
cnighswonger
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We analyzed three long-running sessions from the same Max 5x account to understand how workload type affects prompt cache behavior.
The data
What we learned
Coding sessions bust cache more often. Both coding agents (Code Agent and E3B) had significantly worse cache hit rates than the research session, despite running on the same account with the same plan. The difference is workload: coding generates large file reads, diffs, and tool results that change the context rapidly. Research generates shorter, text-heavy turns that are more cache-friendly.
Cold start frequency scales with workload intensity. E3B (467 calls, 1 cold start per 39 calls) was worse than Code Agent (7,911 calls, 1 per 68) despite being shorter. More intensive coding = more frequent cache busts.
The interceptor is the key variable. Cache Agent ran with claude-code-cache-fix stabilizing the prefix. The other two ran without it. The 99.4% vs 96-98% gap represents millions of tokens of unnecessary cache creation — real dollars under per-token billing.
The cache hit rate improved over time in the interceptor session (99.2% → 99.9%), contradicting the assumption that longer sessions necessarily degrade. Without the interceptor, the coding sessions showed no such improvement.
What this means for you
If you're doing heavy coding work (large file reads, frequent edits, agent tool use), expect cache hit rates in the 96-98% range without optimization. The interceptor raises that to 99%+. The difference is small in percentage terms but large in token cost — at 3 billion cache_read tokens, every percentage point matters.
If your workload is lighter (research, writing, issue management), cache hit rates are naturally higher even without the interceptor, but the interceptor still helps on the margin.
Share your data
We'd love to see more session profiles. If you're running the interceptor + claude-code-meter:
Post your output here (it's aggregate only, no prompts or content). The more workload types we see, the better we understand the cache dynamics.
Data from Max 5x account, Opus 4.6, March-April 2026.
Beta Was this translation helpful? Give feedback.
All reactions