Context window meter
How full a model’s context window is and with what: system prompt, tools, files and conversation against the limit and the room kept for the reply, warnings at 80% and 95%, and Compact with the room it will win back. A small version sits in a composer.
Context windowClaude Sonnet 5.5 · 200k
84%151k / 200k
- System prompt3,2002%
- Tools (14)11.8k6%
- Files (6)64.4k32%
- Conversation71.9k36%
- Kept for the reply16.0k8%
- Free32.7k16%
Over 80%. Long answers may be cut short.
When to use
- Assistants that work with long conversations or many files.
- Developer tools that show what a request sends.
When not to use
- Plan usage and billing; use the usage meter.
Installation
pnpm dlx shadcn@latest add @caliper/context-window-meter
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
contextUsage
0 props
No props of its own; it accepts the native props of its root element.
ContextWindowMeter
7 props
Keyboard
- Keyboard and focus come from Radix popover: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.
Accessibility
It exposes status semantics, with aria-label, aria-hidden and aria-describedby kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/context-window-meter.mdThe index of every part is at /llms.txt.