[Bug] Context Remaining Display Shows 0% When ~50% Available
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
- User disabled automatic compaction in settings
- Continued working for 6 major tasks (~30k tokens of new work)
- Expected to hit hard limit (200k)
- 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
- Start new Claude Code session
- Work until console shows "0% remaining"
- Go to Settings β Disable "Automatic compaction"
- Continue working for 20-30k more tokens
- 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:
- Affects ALL users relying on context display
- Causes unnecessary context loss via premature compaction
- Users paying for 200k tokens can't utilize full budget
- Degrades AI performance by forcing incomplete context
- 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"}]
Haha, I just compressed itγ
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This is still an issue.
Yeah, same issue happening here.
Context Usage claude-opus-4-5-20251101 Β· 127k/200k tokens (63%)
β System prompt: 6.9k tokens (3.5%) β System tools: 15.8k tokens (7.9%) β Custom agents: 438 tokens (0.2%) β Memory files: 9.4k tokens (4.7%) β Messages: 94.3k tokens (47.2%) βΆ Free space: 73k (36.6%)
Status bar shows: Context low (7% remaining) Β· Run /compact to compact & continue