Context ruler
What fills a model's context window.
Definition · Updated Nov 2, 2026
A context ruler draws each request's context as a bar on a token scale, split into system, history, tools, documents and output. You see what takes the room and how close each request is to the limit. Use it for LLM apps and agents.
Pay once. Every update included.
Live preview
Sample data: context of four requests on a 128K scale, split into system, history, tools, docs and output
- Data shape
- Tokens per part, per request
- Good for
- LLM context use, agent requests
- Avoid when
- There is no context limit
- Sizes
- XS, S, M and L, re-laid out from the data
Anatomy
Inspect it like the Figma file.
The same layers, names and tokens as the component. Select one to read its size, fill and style.
Layers
081 / Context ruler
- Layer
- system
- Type
- Rectangle
- Size
- 15 × 18
- Fill
- data/cat-9
- Radius
- 3
- Group
- Marks · 21
Layers
081 / Context ruler
- Layer
- history
- Type
- Rectangle
- Size
- 118 × 18
- Fill
- data/cat-2
- Radius
- 3
- Group
- Marks · 21
Layers
081 / Context ruler
- Layer
- history
- Type
- Rectangle
- Size
- 65 × 18
- Fill
- data/cat-2
- Radius
- 3
- Group
- Marks · 21
Sizes
Re-laid out, never scaled.
The same data at XS, S, M and L. Every size is redrawn from the data, so text and line weights never shrink.
M against S
Width360 px480 px
Plot328 px440 px
Labels99
Marks2121
Height212 px246 px
Same tokens at every size: text styles, 1 px lines and mark radius stay put.
When to use
What fills the window.
Three signs it fits, and three signs another type fits better.
Is there a token limit?
Parts of one total, no limit.
Yes: Keep the context ruler
Code and Figma
One name in Figma and in code.
Every Figma property is a prop with the same name and values. One command installs it.
Figma
chart/081-context-ruler
npx shadcn add @chartory/context-rulerimport { ContextRuler } from "@/components/chartory/context-ruler"import { requestContext } from "./request-context"export function RequestContext() { return ( <ContextRuler data={requestContext} size="m" legend={true} /> )}Hearth widget
Context ruler as a widget.
The chart in a Hearth card with a hero number and two blocks. One token set, light and dark.
EmberPreset
ChartoryDefault preset
Pick the blocks, the size and the preset for your own widget.
Read the Hearth widget docsFAQ
Context ruler questions.
What people ask before they put a context ruler in a dashboard.
Something else?
hello@usechartory.comIn tokens, 0 to 128K in steps of 32K, so a request near the end of the ruler is near the model's limit.
Five, named in the legend: system, history, tools, docs and output.
One data object in the sample’s shape: tokens per part, per request. The docs page lists every field and links its JSON Schema; the sample data comes with the component, so you can start from it and swap in your own.
Series take the preset’s data colours in order, and states such as up, down or warning take its status colours. Change the preset in Figma or in code to recolour every chart at once.
XS, S, M and L, in light and dark. Each size is laid out again from the data, so text and lines keep their size.
Yes. It plays in when it scrolls into view, and when the data changes every mark moves from its old place to its new one. With reduced motion on, it does not move.
Yes. The React component is free in the public registry in Hearth, no token needed; Signal comes with Code and Complete. The Figma component comes with Figma and Complete.
Ask for it by name. The MCP server tells the agent what data it needs and runs the same command: npx shadcn add @chartory/context-ruler. You review the diff.
Related types
Other ways to show part of a whole.
The same question, a different shape of answer. Every type ships in Figma and in code.
Same family
Part of a whole
16 types in Chartory answer this question.