[BUG] `/context` command shows misleading usage percentage by including autocompact buffer as "used"

Resolved 💬 4 comments Opened Dec 19, 2025 by coygeek Closed Feb 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The /context command displays context usage in a way that's mathematically confusing and potentially misleading to users.

Problem 1: The "used" percentage includes reserved buffer space

The headline shows 130k/200k tokens (65%) but the visible categories only sum to ~53k:

System prompt:    3.0k
System tools:    17.4k
Memory files:     5.7k
Messages:        27.4k
─────────────────────
Visible sum:     53.5k   ← But display says 130k "used"

The ~77k difference is the autocompact buffer, which is reserved but empty. Counting it as "used" makes users think they've consumed 65% of context when actual content is only ~27%.

Problem 2: Confusing relationship between "Free space" and "Autocompact buffer"

The display shows:

  • Free space: 70k (34.8%)
  • Autocompact buffer: 77.0k tokens (38.5%)

These are shown as separate items, but the buffer is counted within "used" while free space is separate. The relationship isn't clear.

Problem 3: Categories don't reconcile to total

Users naturally expect: System prompt + Tools + Memory + Messages = Used

But: 3k + 17.4k + 5.7k + 27.4k = 53.5k ≠ 130k

This makes users question whether the display is accurate.

What Should Happen?

Option A: Show actual content vs reserved separately

Context Usage
claude-opus-4-5-20251101 · 53k content / 200k capacity

⛁ Content:     53k (27%)    ← what you've actually used
⛶ Available:   70k (35%)    ← what you can still use
⛝ Reserved:    77k (38%)    ← autocompact buffer (pre-allocated)

Option B: Make the math reconcile
Add a visible "Autocompact buffer" category to the breakdown so the sum equals the total:

System prompt:     3.0k (1.5%)
System tools:     17.4k (8.7%)
Memory files:      5.7k (2.8%)
Messages:         27.4k (13.7%)
Autocompact buf:  77.0k (38.5%)  ← NEW: explicitly shown
─────────────────────────────────
Total used:      130.5k (65%)    ← Now the math adds up
Free space:       70k (35%)

Option C: Change headline to clarify

claude-opus-4-5-20251101 · 53k used + 77k reserved / 200k (70k free)

Error Messages/Logs

No errors — this is a display/UX issue, not a functional bug.

Steps to Reproduce

  1. Start a Claude Code session with some plugins/skills enabled
  2. Have a short conversation (a few messages)
  3. Run /context
  4. Observe:
  • The headline shows high usage (e.g., "65% used")
  • Sum the four visible categories (System prompt + Tools + Memory + Messages)
  • Note the sum is much lower than the "used" amount
  • Try to understand where the difference comes from

Claude Model

None

Is this a regression?

I don't know

Last Working Version

2.0.74

Claude Code Version

2.0.74

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Why this matters:

  • Users may unnecessarily run /compact or /clear thinking they're running low
  • The display undermines trust when the math doesn't add up
  • New users especially may be confused about how context works

Suggested fix priority: Low (UX improvement, not blocking)

Related context:

  • The autocompact buffer appears to be fixed at 38.5% of capacity
  • Skills/plugins are shown separately but it's unclear if they're in "System tools" or additional
  • Hook-injected context (SessionStart, etc.) isn't broken out

Environment:

  • Model: claude-opus-4-5-20251101
  • Capacity: 200k tokens
  • OS: macOS (Darwin 25.1.0)

View original on GitHub ↗

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