opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Separate context window and session stats in sidebar

Open R44VC0RP opened this issue 3 weeks ago • 0 comments

Issue

On some /compact instances the session costs would be reset and the token count isn't ongoing which is nice for visuals.

Summary

  • Split the sidebar Context section into two: Context (current window) and Session (cumulative)
  • Context shows tokens and % used from the last assistant message (resets on compaction)
  • Session shows total tokens across all messages and cumulative spend (only increases)
  • Improves visibility into both current context usage and overall session costs
image

Changes

  • Added sessionTokens memo that sums tokens from all assistant messages
  • Moved spend to Session section alongside total tokens
  • Kept Context section focused on current LLM context window

R44VC0RP avatar Dec 28 '25 20:12 R44VC0RP