[Bug] Context Remaining Display Shows 0% When ~50% Available

Resolved ๐Ÿ’ฌ 8 comments Opened Nov 10, 2025 by Pichardescu Closed Jan 22, 2026

Bug Description
๐Ÿ› Bug Report: Context Remaining Display Shows 0% When ~50% Available

Severity: CRITICAL - Causes premature context loss and degraded user experience

๐Ÿ“Š Evidence

Actual Context State (verified by disabling auto-compact):

  • Total budget: 200,000 tokens
  • Tokens used: ~117,000 tokens (58.5%)
  • Tokens available: ~83,000 tokens (41.5%)
  • Console display: "0% remaining" โŒ INCORRECT

Impact on User Experience:

  • User was forced to work believing they had 0% context available
  • Premature compaction triggered unnecessarily
  • Lost valuable conversation history
  • Degraded AI performance due to missing context

๐Ÿ” How Bug Was Discovered

  1. User disabled automatic compaction in settings
  2. Continued working for 6 major tasks (~30k tokens of new work)
  3. Expected to hit hard limit (200k)
  4. Discovered 83k tokens still available when console showed "0%"

๐Ÿ“ˆ Token Usage Timeline

Before discovering bug:

  • Console: "0% remaining"
  • User assumption: ~0-5k tokens available
  • Reality: ~100k tokens available (50% free)
  • Discrepancy: Console was off by ~100,000 tokens

After disabling auto-compact:

  • Started at: ~100k used, ~100k free
  • Completed 6 major tasks: +30k tokens used
  • Current state: 117k used, 83k free (41.5%)
  • Console STILL shows: "0% remaining"

๐Ÿ’” User Impact

"I was working with Alzheimer's - thinking I had no memory left when I actually had 100k tokens available. This is
incredibly unfair for a $200/month paid tier."

Consequences:

  • User avoided deep dives thinking context was exhausted
  • Compacted prematurely, losing architectural context
  • Couldn't leverage full 200k context budget they're paying for
  • Degraded productivity believing they needed to "save tokens"

๐Ÿงช Reproduction Steps

  1. Start new Claude Code session
  2. Work until console shows "0% remaining"
  3. Go to Settings โ†’ Disable "Automatic compaction"
  4. Continue working for 20-30k more tokens
  5. Observe: Console still shows "0%" but no actual limit hit

Expected: Console shows accurate percentage (e.g., "50% remaining")
Actual: Console shows "0% remaining" when 50%+ available

๐Ÿ”ง Suggested Fix

Option 1: Fix percentage calculation
// Current (incorrect)
remaining = 0% // Shows when ~100k available

// Expected (correct)
remaining = (200000 - tokensUsed) / 200000 * 100
// Should show: 50% when 100k available

Option 2: Show absolute tokens
Tokens: 117k / 200k (83k remaining)

Option 3: Both percentage AND absolute
Context: 117k / 200k used (41.5% available)

๐Ÿ“‹ Environment

  • Product: Claude Code CLI
  • Model: claude-sonnet-4-5-20250929
  • Tier: Paid ($200/month)
  • Token Budget: 200,000 tokens
  • OS: Windows 11
  • Version: Latest (as of 2025-11-09)

โš ๏ธ Priority Justification

CRITICAL because:

  1. Affects ALL users relying on context display
  2. Causes unnecessary context loss via premature compaction
  3. Users paying for 200k tokens can't utilize full budget
  4. Degrades AI performance by forcing incomplete context
  5. No warning that display is inaccurate

๐ŸŽฏ Business Impact

  • Users on paid tiers ($200/month) not getting value
  • Degraded AI responses due to lost context
  • User frustration and trust issues
  • Competitive disadvantage vs. other AI tools with accurate context tracking

---

I need Tier 4 asap please.

Environment Info

  • Platform: win32
  • Terminal: null
  • Version: 2.0.36
  • Feedback ID: 077e8b15-3a15-4d48-9fb9-191a4fcbf41f

Errors

[{"error":"Error: Shell 9a6794 is not running, so cannot be killed (status: completed)\n    at Object.call (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2391:1829)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async QI5 (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2028:28755)\n    at async _rA (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2028:25508)\n    at async file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2028:24499\n    at async ZlA (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1648:3531)\n    at async BI5 (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2028:24411)\n    at async t55 (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2028:23399)\n    at async HS (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2028:19848)\n    at async HS (file:///C:/Users/LAlfonsoPichardo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2028:21344)","timestamp":"2025-11-10T00:35:14.093Z"}]

View original on GitHub โ†—

This issue has 8 comments on GitHub. Read the full discussion on GitHub โ†—