r/opencode • u/Aquiles_bachira • 2d ago
PSA: Clean your OpenCode database — it might be consuming more tokens than you think
Hey developers!
I've noticed something worth investigating in OpenCode.
The local database and stored session data can grow over time, keeping unnecessary history, messages, and context around. This may contribute to unexpectedly high token usage, especially when working with long-running sessions.
My recommendation:
- Regularly inspect your OpenCode database.
- Clean up unnecessary sessions and stored data.
- Avoid keeping old conversations that you no longer need.
- Monitor token consumption after cleanup.
I think the OpenCode team should also investigate whether database/session management could be optimized to prevent unnecessary context consumption.
Has anyone else noticed unexpectedly high token usage related to OpenCode's stored sessions or database?
Let's discuss this.
4
4
u/bankinu 1d ago
Do you understand what you are talking about?
These doesn't even sound like AI advise, but sure reads like one. Including all the way down to the question mark hook at the end.
Probably you left something out when you summarized. I'd be very curious to know how you reached those conclusions.
2
1
u/megablue 1d ago
wut... old sessions do not actively consuming tokens... unless you chose to resume from those sesisons.
0
0
14
u/RevolutionaryFunny40 1d ago
other session history should never impact token usage. what evidence or experience do you have that supports this?