/context command header percentage doesn't match sum of table breakdown

Resolved 💬 4 comments Opened Jan 15, 2026 by eric-xrd Closed Mar 7, 2026

Description

The /context command displays inconsistent numbers - the header percentage doesn't match the sum of the table breakdown rows.

Steps to Reproduce

  1. Run /context in any conversation
  2. Compare the header percentage to the table breakdown
  3. Sum up the table category percentages (excluding free space)
  4. Compare to the header

Expected Behavior

Header percentage should equal 100% minus the "Free space" percentage.

Actual Behavior

Example 1:

Header: 63.7k / 200.0k (32%)

If 32% is used, free should be 68%. But table shows:

Free space: 133.3k (66.6%)

68% ≠ 66.6% — that's a ~3k token gap.

Example 2:

Header: 76.4k / 200.0k (38%)

If 38% is used, free should be 62%. But table shows:

Free space: 120.6k (60.3%)

62% ≠ 60.3% — same ~3k token / ~1.7% discrepancy.

Analysis

The header and table are calculating from different token counts. Approximately 3k tokens are being counted in one calculation but not the other.

Related Issues

  • #17959 - used_percentage doesn't match internal warning calculation
  • #18241 - Context percentage mismatch between /context, statusline, and internal trigger

This issue is distinct: it's about the /context command being internally inconsistent with itself (header vs table), not about mismatches between different components.

Environment

  • Claude Code (VS Code extension)
  • macOS

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗