Skip to main content
The Context Breakdown page shows you exactly how your agent’s context window is being consumed — step by step, broken down by component. Use it to understand why a session is running out of context, which component is growing the fastest, and where you might be able to reduce token usage.
This page requires cache trace data to be enabled. If cache trace is not active, the page displays an “Unavailable” banner with instructions on how to enable it.

Enabling cache trace

The cache trace status is shown as a colored dot at the top of the page: green when enabled, gray when not. Two ways to enable it: Option 1 — add to ~/.openclaw/openclaw.json:
{
  "diagnostics": {
    "cacheTrace": {
      "enabled": true,
      "includeMessages": true,
      "includePrompt": true,
      "includeSystem": true
    }
  }
}
Option 2 — send the keyword OPENCLAW_CACHE_TRACE to OpenClaw and let it enable the setting for you.
The cache trace file grows quickly. Set up a cron job to clean it periodically, or it will consume significant disk space over time.

Selecting a session

Use the session picker to choose which session to inspect. The dropdown shows the session ID, agent name, model, cost, date, and number of steps for each session. Type to search by any of these fields. Click × to clear the current selection and return to the empty state.

Per-step cost chart

Contextbreakdown Cost
A bar chart showing the token cost at each step of the session. Bars are color-coded by relative cost:
ColorMeaning
Red≥80% of the maximum step cost — the most expensive steps
Amber≥50% of the maximum step cost
BlueBelow 50% — normal cost
Hover over any bar to see the token breakdown: input, output, cache write, and cache read.

Context composition chart

Contextbreakdown Context
A stacked bar chart showing how the context window is composed at each step. Three components are tracked:
ColorComponentDescription
BlueSystemThe system prompt and instructions
CyanHistoryConversation history — previous messages between the user and agent
AmberToolsTool call results and tool-related content
This chart tells you at a glance which component is dominating the context window. If the amber (Tools) section grows rapidly, your agent is accumulating large tool outputs. If cyan (History) grows steadily, the conversation itself is consuming the space.

Per-turn table

A detailed table breaking down the context window at each step:
ColumnDescription
StepThe step number in the session
SystemTokens consumed by the system prompt
HistoryTokens consumed by conversation history
ToolsTokens consumed by tool results
TotalTotal tokens used at this step
PressureContext utilization as a percentage of the model’s context limit
CostToken cost for this step (shown only if cost data is available)
Column headers have tooltips explaining what each value means. The pressure column tooltip shows the model’s context capacity (e.g. “200K”).