Claude Code – Initial considerations on cache and token optimization

Blackboard with a math lesson written on it

Over the last few weeks, I have been exploring more in Claude Code and the user community growing around it.

I’ve been experimenting with common tasks such as implementing small features and debugging old code, but also experimenting (in a quite non-scientific way) with the different “hyperparameters” one can tune to get the best out of the tool – different models, efforts, skills, .md definitions.

Some of the internals remain puzzling to me. However, through trial and error, several aspects of my workflow are converging toward a state that feels both predictable and productive.

The community sentiment has been quite detrimental:
  • when Opus 5 was released, criticism of the model’s verbosity and tendency to circle around problems was widespread. Those opinions still seem to persist.
  • there is the issue of usage and token consumption within the five-hour and weekly limits. Many users feel that tokens are being consumed too quickly. Adding to the pressure, rival companies have either reduced the price of their models, as OpenAI did, or increased their model performance, as DeepSeek and OpenAI have done.
Token usage has been THE topic, particularly around August 18.

Many users were already mourning the end of their productivity due to the end of the 50% increase in weekly limits. As of this writing, Anthropic extended it until the end of August 2026 (and who knows if this will be extended further and further due to the market competition).

However, since August 18 that one more thing has caught my eye: an open session in my terminal that I did not end, close or clear – and is well over its cache TTL of 1 hour – has now announced how many tokens will be read / (cache) written before we proceed with that conversation. 

I am not 100% sure if this was implemented before, but never caught my eye like this time.

Avoiding to proceed with a long old session is one of the behaviors that saves me from “burning through 50% of my 5-hour window with one prompt” and is now available, loud and clear, in your session.

In my flow, I also try to do the following:

  • Keep a session before a /clear under the cache TTL (usually 1 hour)
  • Aim for a ratio of cache read tokens to other tokens of at least 10:1
  • Avoid too long contexts: anything over 200k tokens should be compacted or resumed for a follow-up session
  • Have clear goals – mid-development improvements and bugs found go to an handoff file (jointly with a resume of what was done) which will be processed by a new session

Which other practices and ideas do you usually follow when interacting with AI (coding) assistants?

Picture of Nelson Eiró

Nelson Eiró

Senior Data Engineer

LinkedIn

Add comment: