component
TuxContextMeter
Token-utilization indicator with cost breakdown. A compact badge shows the current percentage of the model's context window; hover reveals input/output token counts + cost detail. Tone-codes ok under 60%, warn from 60–85%, alert over 85% — so long research sessions get a visible signal as they approach the context limit. Lives well in a session-header actions slot.
ok band
Under 60% used
Hover the pill to see the breakdown popover.
<tux-context-meter
:used="48000"
:max="200000"
model-label="opus-4-7 · 200k context"
:breakdown="{
input: { tokens: 40000, cost: '$0.20' },
output: { tokens: 8000, cost: '$0.40' },
totalCost: '$0.60',
}"
/>warn band
60–85% used
Amber tone signals "starting to fill" — a visual nudge to think about compacting context before the limit.
<tux-context-meter
:used="142000"
:max="200000"
model-label="opus-4-7"
:breakdown="{
input: { tokens: 118400, cost: '$0.59' },
output: { tokens: 23600, cost: '$1.18' },
totalCost: '$1.77',
}"
/>alert band
Over 85% used
Red tone signals "approaching limit" — actions like switching models, summarizing, or starting a new session should be obvious.
<tux-context-meter
:used="186000"
:max="200000"
model-label="opus-4-7 · approaching limit"
:breakdown="{
input: { tokens: 162000, cost: '$0.81' },
output: { tokens: 24000, cost: '$1.20' },
totalCost: '$2.01',
}"
/>