4 ms·
Cache ttl on max subscriptions is 1h, FYI.
by gck1 6mo ago
Cache ttl on max subscriptions is 1h, FYI.
- _blk 6mo agoThat'd be awesome but it doesn't reflect what I see. Do you have a source for that? What I see is if take a quick break the session loses ~5% right at the start of the next prompt processing. (I'm currently on max 5x)
- ethanj8011 6mo agoIt's true as far as I can tell, just by my own checking using `/status`. You can also tell by when the "clear" reminder hint shows up. Also if you look at the leaked claude code you can see that almost everything in the main thread is cached with 1H TTL (I believe subagents use 5 minute TTL)
- gck1 6mo agoNot at my workstation right now, but simply ask claude to analyze jsonl transcript of any session, there are two cache keys there, one is 5m, another 1h. Only 1h gets set. There are also some entries there that will tell you if request was a cache hit or miss, or if cache rewrite happened. I've had claude test another claude and on max 5x subscription, cache miss only happened if message was sent after 1h, or if session was resumed using /resume or --resume (this is a bug that exists since January - all session resumes will cause a full cache rewrite). However, cache being hit doesn't necessarily mean Anthropic won't just subtract usage from you as if it wasn't hit. It's Anthropic we're talking about. They can do whatever they want with your usage and then blame you for it.
- Fabricio20 6mo agoI have heard that if you have telemetry disabled the cache is 5 minutes, otherwise 1h. No clue how true that is however my experience (with telemetry enabled) has been the 1h cache.
- HarHarVeryFunny 6mo agoThey've acknowledged that as a bug and have fixed it.
- bashtoni 6mo agoOnly if you set `ENABLE_PROMPT_CACHING_1H`, which was mentioned in the release notes for a recent Claude Code release but doesn't seem to be in the official docs.
- andersa 6mo agoBruh. It's getting hard to track down all these MAKE_IT_ACTUALLY_WORK settings that default to off for no reason.
- deleted 6mo ago[deleted]
- ethbr1 6mo agoThat's the beginning of Googlification of feature evolution, via population statistics rather than quality. If it increases a KPI by 5% for 95% of users but torpedos the experience for 5%? Ship it.
- hnben 6mo agothat sounds like a win-win to me. on one hand 95% of users get an improved experience. While a competitor gets the chance to build a business for the remaining 5%.
- matheusmoreira 6mo agoFor me it's gotten to the point where I have a wrapper script that applies like 5 environment variables and even patches the system prompt strings prior to every Claude Code invocation. After the Claude Code source code leak someone discovered that some variables are read directly from the process environment. Can't even trust that setting them in ~/.claude/settings.json will work! I've actually started asking Claude itself to dissect every Claude Code update in order figure out if it broke some part of the Rube Goldberg machine I was forced to set up.
- g4cg54g54 6mo agosubusers supposedly get it automatic again after the fix (and now also with `DISABLE_TELEMETRY=1`) but if you are api user you must set `ENABLE_PROMPT_CACHING_1H` as i understood and when using your own api (via `ANTHROPIC_BASE_URL`) ensure `CLAUDE_CODE_ATTRIBUTION_HEADER=0` is set as well... https://github.com/anthropics/claude-code/issues/50085 https://github.com/anthropics/claude-code/issues/50085 and check out the other neckbreakers ive found pukes lots of malicious compliance by feels... :/ [BUG] new sessions will *never* hit a (full)cache #47098 https://github.com/anthropics/claude-code/issues/47098 https://github.com/anthropics/claude-code/issues/47098 [BUG] /clear bleeds into the next session (what also breaks cache) #47756 https://github.com/anthropics/claude-code/issues/47756 https://github.com/anthropics/claude-code/issues/47756 [BUG] uncachable system prompt caused by includeGitInstructions / CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS -> git status https://github.com/anthropics/claude-code/issues/47107 https://github.com/anthropics/claude-code/issues/47107