r/opencode • u/RndRedditPerson • 29d ago
Opencode context stats and token cache hit
Other harnesses have /context command to see stats of the context - how many tokens are in system prompt, how many for tools, etc.
How to get that in Opencode?
Also, how do you see cache hit ratio? Using Claude, Copilot subs, and Deepseek API, and couldn't find anywhere whats the cache stats of each model...
2
Upvotes
View all comments
1
u/UnusualJackfruit159 29d ago edited 29d ago
Not sure about individual tool spending, but the web console and API reports token spending per model in the week/month time frames. Best possible resolution seems to be requests/h via web console, apparently not exported in API. I built myself a little tool to monitor these and tell me current best models/$:
https://github.com/codesam88/opencode-models
Not very sophisticated, but better (perhaps) than browsing their website every couple days and trying to sort/map tables in my head..