Skip to content

Context tokens and context percent are underreported #109

@polczak-itt

Description

@polczak-itt

I frequently see that the status line shows lower token count / usage percent in the status line compared to what Claude reports.

This can be tested by running some task which will occupy eg. 50% of the context window and then using the /context slash command.

Output of /context:

/context 
  ⎿  
      Context Usage
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   claude-sonnet-4-5-20250929 · 146k/200k tokens (73%)
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ 
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   ⛁ System prompt: 2.7k tokens (1.4%)
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   ⛁ System tools: 14.2k tokens (7.1%)
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   ⛁ MCP tools: 21.2k tokens (10.6%)
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   ⛁ Custom agents: 400 tokens (0.2%)
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   ⛁ Memory files: 5.6k tokens (2.8%)
     ⛁ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 101.7k tokens (50.8%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 54k (27.1%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 

Status line:

Ctx: 131.9k | Ctx: 66.0%

This is discrepancy is visible even though Claude paused, was waiting for a new prompt and the /context was processed. This means that even if the status line does not update IRL there were already at least two points in time for it to update / correct itself.

It's also interesting that the difference between the reported values is really similar to: System tools: 14.2k tokens (7.1%). My hypothesis is that maybe it's not being counted. Will report back if further testing confirms it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions