Skip to content

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

Context window useTokens per request in a 128K window, compaction at 100K: REQ 4812 91K, REQ 4809 48K, REQ 4801 117K, REQ 4795 61K; 1 request past the compaction line.032K64K96K128KREQ 4812REQ 4809REQ 4801REQ 4795SYSTEMHISTORYTOOLSDOCSOUTPUT
Context window use
RequestSystem (K)History (K)Tools (K)Docs (K)Output (K)Total (K)
REQ 48123421226891
REQ 4809318814548
REQ 480136114309117
REQ 479538440661

Sample data: context of four requests on a 128K scale, split into system, history, tools, docs and output

Size
Legend
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

chart/081-context-ruler
plot · context ruler
Layer
system
Type
Rectangle
Size
15 × 18
Fill
data/cat-9
Radius
3
Group
Marks · 21

Layers

081 / Context ruler

chart/081-context-ruler
plot · 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

Are requests compared?

One request in detail.

Yes: Keep the context ruler

Is it the split, not the trend?

Usage over time.

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

size
legend
Property = propValuesDefault
size"xs" · "s" · "m" · "l""xs"
legendtrue · falsetrue
color"cat-1" · "cat-2" · "cat-3" · "cat-4""cat-1"
npx shadcn add @chartory/context-ruler
context-ruler.tsx
import { 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.

Code
Get the code

EmberPreset

ChartoryDefault preset

Pick the blocks, the size and the preset for your own widget.

Read the Hearth widget docs

FAQ

Context ruler questions.

What people ask before they put a context ruler in a dashboard.

Something else?

hello@usechartory.com
  • In tokens, 0 to 128K in steps of 32K, so a request near the end of the ruler is near the model's limit.

Related types

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.