Hacker News new | ask | show | jobs
by apt-apt-apt-apt 113 days ago
I'm finding that unexpected cache rewrites cost me huge.

I have 1h cache TTL set, and do nothing to cause rewrite (response in time, no model/effort/tool changes).

At 400K tokens in, I'll write a message, and /usage shows only a small increase in cache write. On the next message, cache writes shows 800K, and by the end, I often hit 2M cache writes with no explanation.

This seems to happen when: using /btw, asking it to review code, other random times. Anyone know what's going on?

3 comments

To not answer your question, I have a claude stop hook that my status line uses to tell me how close my cache is to expiring https://pastebin.com/JLXUG16Q

_entirely_ vibecoded don't @ me.

You may be running into a "known" bug with Claude Code: https://github.com/anthropics/claude-code/issues/63930
This happens all the time and drives me bananas.

It seems to be regular file edits rather than parallel tool calls.

I'm sitting on 1.6m cache write even now with 468k in /context. It drives my session costs above $100 regularly.

Can someone from Anthropic look into this?

Incentives to optimize cache-usage are only aligned between anthropic and you, dear user, when there is not enough compute available to serve the tokens fresh. Apparently enough compute is now available that frugal usage is no longer a requirement and user cost/profit maximization is now the name of the game. I would expect to see more and more "cache-busting" strategies implemented in order to both eek out marginal performance increases and to heavily increase profit.
I have long suspected but not confirmed that /btw uses a lower tier model like Haiku.

Depending on how you're triggering reviews, you may be using a sub-agent?

I don't use sub-agents, only the normal linear message-response flow.
it does not use haiku. you can just ask Claude (possibly not fable BC of cyber) to reverse engineer the obfuscated JS.
I've had Opus refuse to do work due to cybersecurity concerns as well. Quite frustrating when you're trying to fix an exploit--as soon as it reads the bad code, it just shuts down! I ended up cutting out more and more bits of the code until eventually Opus relented.