logoalt Hacker News

imdsm • today at 10:42 AM • 8 replies • view on HN

Not sure if this will help you but it helped me. I was using subagents and workflows for lots of long running tasks, and part of that work included running tests. If tests took longer than 5 minutes, the cache expired, and the whole thing was then being processed as uncached input.

I created a skill to better manage agents, including a way to keep the caches valid, and it has decreased my usage considerably. I now struggle to use my 100% each week and I hit claude hard. I have a reset expiring in 5 days and I'm trying to burn down the tokens (68% with 3d 8h left) quickly so I can use my reset before it expires.

Token efficiency just means understanding the way the system works. Best person to help with that... my old friend claude.


Replies

dotancohen • today at 11:25 AM

After I stopped letting Claude run tests, my token usage went from "gone by Wednesday" to "what can I automate this Saturday so my tokens won't go to waste".

➕ show 2 replies
RALaBarge • today at 11:52 AM

Yesterday in my CC there was an update that added a feature to auto compact immediately prior to the cache being invalidated.

➕ show 1 reply
olavgg • today at 10:45 AM

Yeah, I should see if I can create a similar skill. The tests do spend some time to complete.

Claude: Confirmed: 195M of the 212M cache tokens (92%) come from full re-writes after 5+ minute gaps, accounting for 77% of relative cost. Now I'll check the existing wrappers so the skill builds on them.

wolfy1993 • today at 11:32 AM

Don't suppose you would be happy to share the skill? Or is it fairly unique to your work flow?

I think the tests problem is really having an impact for me. Hadn't considered it before so thanks for flagging.

iamflimflam1 • today at 10:55 AM

Some to think about with both Claude and skills.

Can you invert things. What’s deterministic and what needs “thinking”?

Can you create a script that runs things chaining together the deterministic parts with calling out to Claude for glue that needs “thinking”.

raylad • today at 10:46 AM

How do you keep the caches valid?

➕ show 2 replies
nextaccountic • today at 11:06 AM

> including a way to keep the caches valid

Maybe doing bogus small requests to prevent the cache from expiring?

I mean in the API you can set the cache expiration time right? But I guess claude code can't do this

oblio • today at 11:23 AM

> my old friend claude.

Awfully new old friend.

➕ show 1 reply