Skip to content

Context

Context answers: how much of the model’s context window does a session start with, how fast does it grow, how close does it get to the limit, what fills it, and what does the prompt cache save or lose? It reads Claude Code, Codex and Grok sessions with the same figures. The page is at /context.

Terms such as cache read, cache write and long-prompt tier are in the Metric glossary. Every figure comes from the transcripts. The page reads no CLAUDE.md, AGENTS.md, .mcp.json or other configuration file. A token figure taken from a tool result’s size is an estimate and is labelled estimate wherever it appears.

The scope bar under the navigation carries the shared filters. Every figure, chart, table and tip on the page follows them, and the URL keeps them.

Control Values
Project All projects, or one project.
Time range 7d, 14d, 30d, 90d, All.
Source All, Claude Code, Codex, Grok.
Include automated sessions Off by default; on adds sessions that tools start in the background.

A session is in the view when it has a request in the range. Its own figures (starting context, growth, compactions) cover the whole session. See Filters for how the filters behave on every page.

Under the heading and the tips, three tabs hold the panels and drawers:

Tab Panels and drawers
Overhead and pressure (the default) Starting context, Window of a typical session, Window pressure
Growth and bloat Growth, What fills context, the Largest tool results drawer
Cache health Cost, with the cache chart, and the Sessions where caching broke drawer

The URL keeps the tab as tab=growth or tab=cache; the first tab writes nothing. Changing the tab replaces the history entry, as a filter does. A link to a panel or drawer by its id, such as /context#d-breaks, opens the tab that holds it and scrolls there. The URL keeps the id, so a reload opens the same place, and focus stays where it was.

Keyboard Only the selected tab is a tab stop. The left and right arrow keys select the previous and next tab and wrap around; Home and End select the first and last. Tab moves on to the tab’s panel.

Shows the view’s answer: “A typical session starts with N tokens of context, X% of its window.” The sessions that compacted are in the Growth tiles. The line under it says every figure comes from the transcripts; its How measured toggletip says the figures are the prompt tokens of each session’s first turn, and that no configuration file is read.

Every section’s hint is one line. Method text sits behind a How measured toggletip at the end of the hint; see Data tables.

With no measured session, the heading reads “No {agent} session{ in project} with a measured start in the last N days.” (or “… yet.” for All). The agent is “agent”, “Claude Code”, “Codex” or “Grok”, by the Source filter.

Shows a notice, “The store holds sessions from before this version”, when either of these holds in the view:

  • some tool calls have no result size;
  • some sessions that compacted have no recorded first compaction.

Figures It gives the counts (“N of M tool calls carry a result size”) and says to stop the app and run ai-ledger rebuild. The figures on the page still cover the rows that have them. See Troubleshooting and the CLI reference.

Context's Tips strip: each tip that fired as a short item above the tabs.Context's Tips strip: each tip that fired as a short item above the tabs.

Shows tips from six fixed rules, as one strip of short items under the heading. The app sets the thresholds; nothing is learned or generated. A tip shows only when its rule fires on the view. When none fires, the strip reads “Nothing stands out in this view.” Each item carries its severity mark: ● critical or ▲ warning. Tips run most severe first, and within a severity in the order below.

Figures The strip shows at most four items, so the tabs and the first bar of Starting context stay on the first screen of a 1440 × 900 window, with the strip expanded too; Show N more reveals the rest. Selecting an item opens it under the strip: a label naming the kind of finding (Starting context, Compactions, Window limit, Tool results, Prompt cache or Long prompts) and the severity, the evidence, the advice and a count of the matching sessions. One item is open at a time; selecting it again closes it. When a new view moves the open item behind Show N more, it closes.

Tip (title) Fires when Severity
Sessions start with a large context A project’s median starting context is 30,000 tokens or more. Warning
Sessions compact repeatedly A session compacted 3 or more times. Warning; critical at 6 or more
Sessions reach the limit of the window A session peaked at 80% or more of its window. Critical
Tool results fill the context A main-thread tool result is 100,000 bytes or more. Warning; critical at 400,000 bytes or more
The prompt cache breaks within sessions A session has 2 or more cache breaks. Warning
Requests are priced on the long-prompt tier The long-prompt-tier cost is at least $1 and at least 10% of the view’s estimated cost. Warning

The evidence of the large-start tip names the five projects with the largest medians with their window shares, counts the rest, and lists the MCP servers that the transcripts record as called in those projects, fewest calls first. A server that is configured but never called leaves no trace in a transcript, so it is not listed.

The advice names the commands of the agents that ran the matching sessions:

Tip Claude Code sessions Codex sessions Grok sessions
Sessions start with a large context Trim CLAUDE.md or AGENTS.md; compare with .mcp.json or claude mcp list. Trim AGENTS.md; compare with ~/.codex/config.toml or codex mcp list. Trim the instruction files and review the configured MCP servers, with no file or command named.
Sessions compact repeatedly A new session or /clear between tasks, /compact before the context fills. A new session with /new between tasks, /compact before the context fills. A new session between tasks, a compaction before the context fills, with no command named.
Tool results fill the context A remedy per tool, and a subagent for bulk reading. A remedy per tool, with no subagent. A remedy per tool, with no subagent; run_terminal_command takes the shell remedy.
Requests are priced on the long-prompt tier /compact or a new session before the threshold. /compact or /new before the threshold. None: Grok’s price-table entry has no threshold, so no Grok request counts as a long prompt.

When sessions of more than one agent match, the advice names each command for its agent.

Controls Selecting the count opens the Sessions matching list: the 20 newest matching sessions, with how many more are left out, each with its title, project, source and start time. Selecting a session opens its session sheet. The open tip is in the URL, and browser Back closes it.

Context's Starting context panel: what a session begins with, per project.Context's Starting context panel: what a session begins with, per project.

Shows the prompt tokens of each session’s first turn, which is what the model read before any work. The section’s How measured toggletip states how many sessions have a measured start and how many have a known window; a share of the window covers only sessions with a known window.

Figures

  • Starting context by project table. One row for the whole view (when there is more than one project) and one per project:
    • Median, 10th percentile, 90th percentile: the spread of starting context over the project’s sessions.
    • 10th to 90th percentile: a bar on one token scale for every row, a tick at the median, and a dashed line at 30,000 tokens, the mark of the large-start tip.
    • Share of window: the median share of the model’s window, with the window size.
    • Sessions: sessions measured. A project with none shows no figure, not zero.
  • Median start by week: the weekly median of starting context with its 25th to 75th percentile band, one point per week of session start. A week with fewer than 3 sessions has a hollow dot and is read as resting on few sessions. A week with no session is a gap, not a joined line. Weeks sit in equal slots by date.

Controls Selecting a project row opens its project sheet. On the weekly chart, hover or the arrow keys read a week: a tooltip shows its median, percentile band and sessions. A week with no session is read too, as “Week of Nov 9: no session started.” The reading stays on its week when a newer week arrives. Show data table lists week, median, 25th and 75th percentile, and sessions.

Context's window grids: a small grid of a typical session's window for each of the busiest projects.Context's window grids: a small grid of a typical session's window for each of the busiest projects.

Shows the window of a typical session as the Project page draws it: a grid of 200 cells, each half a percent of the window, filled for the median start, then for what the median peak adds, the rest free.

Figures

  • With no project selected, one small grid for each of the six projects with the most sessions that have a measured start, a known window and a peak. Each names its project, its most common window and its sessions, and gives Start, Peak and Free as shares of the window. The cells and the three figures come from those same sessions, so they always agree. The hint says how many projects of how many it shows.
  • With one project selected, that project’s full grid with its legend, split by its latest /context snapshot when there is one, as on the Project page.

Sessions without a measured start, a known window or a peak take no part. With no grid to draw, the panel is not shown.

Context's Window pressure panel: how close sessions get to their model's window at their peak, and the session map's quadrants.Context's Window pressure panel: how close sessions get to their model's window at their peak, and the session map's quadrants.

Shows how full sessions get at their peak, by the size of their model’s window. A session’s window is the one its source stated (for Codex, the turn’s model_context_window; for Grok, the window a compaction notice states), else the context of its peak model in the price table, else unknown. See Windows.

Figures

  • One bar per window size (for example 200k, 1M), over the sessions with a known window. Each bar splits into five segments: under 25%, 25–50%, 50–80%, 80–90% and 90% or more of the window at the session’s peak. A segment is a share of that window’s sessions; a segment of 7% or more of the bar shows its count, and one of 20% or more its label. A peak at an edge belongs to the band above it (80% is in 80–90%).

  • Sessions by start and peak: one dot per session, placed by starting context (log scale) and peak share of the window, with a line at 30,000 tokens and one at 80% of the window. A ring marks a session that compacted at least once. A dot shows the session’s details in a tooltip on hover, or with the arrow keys, named by its title (else its short id), and the dot read has a ring around it. The chart holds at most the 1,000 newest sessions that have a measured start, a known window and a recorded peak, and states “Showing the newest N of M sessions” when there are more.

  • Quadrants: the two lines cut the map into four, named in its corners:

    Quadrant Start Peak
    Lean under 30,000 tokens under 80%
    Heavy start 30,000 tokens or more under 80%
    Grew full under 30,000 tokens 80% or more
    Heavy and full 30,000 tokens or more 80% or more

Controls

  • Selecting a segment lists its sessions, newest first, up to 20, each with its title, start, peak share and compactions. Selecting a session opens its session sheet. A table of the same counts is behind Show data table.
  • A dot opens its session sheet. Arrow keys step from the oldest to the newest session; Escape clears the reading and, in the same press, the selected quadrant. The reading stays on its session when newer figures arrive, and ends when they no longer hold that session. Escape from another control closes a tooltip the pointer opened, and leaves the selected quadrant as it is.
  • A button under the map per quadrant gives its count. Selecting one, or clicking the map away from any dot, selects that quadrant: the bars count only its sessions on the map (a line says so), the other dots dim, and a list names its 20 newest sessions. Escape, Clear, Show every session or selecting it again clears it; after Clear, focus is on the quadrant’s button. The map’s data table names each session’s quadrant.
Context's Growth panel: the median context size at each turn of a session.Context's Growth panel: the median context size at each turn of a session.

Shows the median context (prompt tokens) at each turn of a session.

Figures

  • Growth chart: the median at each turn index over the sessions that reach it, up to turn 100, with the 25th to 75th percentile band. A point needs at least 5 sessions that reach that turn (for a project’s own curve, 5 sessions of that project), so a curve stops where they run out. Under the chart, a strip counts the sessions each turn rests on. The five projects with the most sessions get a curve of their own. The share view draws a dashed line at 80% of the window. The token view has no limit mark.
  • Added per prompt: the median, over sessions, of the tokens a session adds per user prompt. A session’s added tokens are the sum of the rises between consecutive turns; a fall, as after a compaction, adds nothing.
  • Sessions compacted: how many of the view’s sessions compacted at least once, of how many.
  • Two more tiles appear when at least one session has a recorded first compaction: Before the first compaction (median turns) and Active time before it (median minutes; pauses over 20 minutes are left out). The Sessions compacted note then counts the sessions with a recorded first compaction. Without such a session, a line says either that no session compacted or that none has a recorded first compaction yet.
  • Growth by project table (more than one project): Sessions, Added per prompt, Compacted, Turns to first compaction, Active time to it.

Controls

  • Tokens / Share of window switch: the same curves as tokens, or as a share of each session’s window over the sessions with a known window.
  • A project button in the legend draws that project alone against the view, with its band; selecting it again restores every project.
  • Hover, or the arrow keys, Home and End, read a turn: a tooltip shows the median, the percentile band, the sessions and each drawn project’s median. Escape clears the reading, and it stays on its turn when newer data arrives. Show data table lists each turn with the median, 25th and 75th percentile, sessions, and each project’s median (a dash where that curve has ended).
Context's What fills context panel: the size of tool results, summed by tool and by MCP server.Context's What fills context panel: the size of tool results, summed by tool and by MCP server.

Shows the size of the main-thread tool results as the transcript stores them, summed by tool and by MCP server. The page marks each token count as an estimate: bytes divided by 4, rounded down. The section’s How measured toggletip states how many completed calls have a known size.

Figures

  • Main thread / Subagents: one bar in two parts. Results of calls made inside subagent transcripts never entered the main thread’s context, so they are summed apart and are not in any other figure of the section.
  • Largest contributors: the one table of tools, or MCP servers. It shows the ten with the largest total result size, and one Other row for the rest. The total bars scale to the largest named row; the Other row has its figure and no bar. Columns: Calls (a toggletip gives how many have a result size), Total result size (a bar, the size and its estimated tokens), Typical result (median to 95th percentile, on a log scale with a dashed line at 100,000 bytes) and Largest.

Controls

  • A By tool / By MCP server switch shows when MCP servers exist.
  • Show all N tools (or MCP servers) lists every row, with no Other row; Show the top 10 folds them again.
  • Every column sorts; see Sorting. The table starts by total size, largest first. Typical result sorts by the median. The sort orders the ten shown; the ten stay the ten largest by total whatever the sort, and the Other row stays last.
  • Selecting a tool or server row opens its tool inspector.
Context's Cost panel: what context costs, with the prompt cache's part in it.Context's Cost panel: what context costs, with the prompt cache's part in it.

Shows cost as the Cost page counts it, with the prompt cache’s part in it. Prices and tiers are the same as Cost’s. A view with no priced request reads “–” (unknown), never zero.

Figures

  • Cache use over time: per day, or per week when the view’s first request is more than 60 days old, three tracks over the same days:

    • Tokens not read from the cache: bars of Uncached input and Cache write, the prompt tokens that cost full price or more. They are the bars’ whole scale, so they never shrink to slivers beside the cache reads.
    • Cache breaks: each bucket’s breaks by cause (model switch, expired, other).
    • Cache-hit ratio: cache read tokens over all prompt tokens, as a line on its own thin track, from 90% (or lower, to the lowest ratio’s tenth) to 100%.

    Days and weeks sit in equal slots by date. A day or week with no request is empty on every track, and is read: the tooltip says “No request” and the sentence “Nov 4, 2026: no request.” The caption says that a break’s cause is inferred from the gap and the model of the previous request, not reported by the provider. Costs are not stacked in this chart.

  • Cost by project table: Whole view and each project (when there is more than one): Estimated cost, Cache reads (cost), Long-prompt tier (cost), Long-tier requests, Cache-hit ratio. The long-prompt tier prices a whole request higher once its prompt passes a model’s threshold.

A request that carries no time is in no bucket of the chart, but it counts in the table’s cache-hit ratio. See Cost estimates.

Controls

  • Cache reads in the chart’s legend adds the cache reads on top of each bar and rescales the bars to all prompt tokens; the track’s title becomes Prompt tokens and its total counts them all. Selecting it again takes them away. The tooltip, the reading and the table always include cache reads.
  • Hover, or the arrow keys, Home and End, read a day or week, an empty one too; a tooltip shows its figures. Escape clears the reading. Show data table lists each bucket: uncached input, cache write, cache read, cache-hit ratio and the breaks by cause.
  • Zoom. In a view of 14 days or weeks or more, a slider sits under the labels. Drag it, or its handles, to narrow the days or weeks the chart draws. With the chart focused, plus (or =) halves the days or weeks shown and minus doubles them, around the one you are reading (the newest when you read none), down to 7 and up to every one. While the chart is zoomed, a Show all days button (Show all weeks on a chart by week) ends the legend row: it shows every day or week again and returns focus to the chart. After each change the chart says which days or weeks are shown, for a screen reader. The arrow keys, Home and End still reach every day or week. Views of fewer than 14 have no slider and no zoom keys. The zoom changes nothing else: the range, the table and the URL stay as they are. It resets when the view changes, and stays on its days when newer data arrives or when you turn Cache reads on or off; the day or week you are reading stays read too.

Shows the 25 largest main-thread tool results in the view.

Figures Columns: Tool (with its MCP server), Input (a summary), Size, Estimated tokens, When, Project (with its source) and Session.

Controls Selecting a row opens its session sheet.

Shows the sessions with a cache break, most uncached tokens first, up to 25.

Figures Columns: Session, Project, Breaks, By cause, Uncached tokens, Their input cost.

Controls Selecting a row opens its session sheet.

A cache break is a main-thread request that is not the session’s first turn, has at least 20,000 prompt tokens, and read less than half of them from the cache. Cache writes count as uncached. Its cause is the first of these that applies, in this order:

Cause Meaning
model switch The request’s model differs from the previous main-thread request’s.
expired More than the cache lifetime passed since the previous request. The lifetime is 1 hour when the previous request wrote to the 1-hour cache (any source), else 30 minutes for a Codex session, else 5 minutes. xAI states no cache lifetime, so a Grok break is never expired: its cause is a model switch or other. A rule, not a measurement.
other Anything else, such as a changed prompt or tool set.

Selecting a row, dot or session opens a sheet over the page and keeps the filters. Sheets describes each:

  • the session sheet, from sessions in tips, the pressure and quadrant lists, the session map and both drawers;
  • the project sheet, from a project row in the Starting context, Growth and Cost tables;
  • the tool, MCP server and skill sheet, from a tool or MCP server row in Largest contributors. It shows that tool’s calls, failures and latency for the same view.
Term Definition
Turn A main-thread request that carries the context. A main-thread request with fewer than 2,000 prompt tokens is a side request and is not a turn. Subagent requests are never turns.
Prompt tokens Input, cache read and both cache writes of a request.
Starting context The prompt tokens of a session’s first turn.
Peak The most prompt tokens a session reached, read against its window. For a Grok session, the largest context a model call stated.
Compaction The agent summarizes the session’s history to free context. The context then falls, and the session’s added tokens do not count the fall.
Main thread The session’s own requests, as opposed to those of subagents.
Near the limit 80% or more of the window.
Estimate Tool result bytes divided by 4, rounded down.