[BUG] Session limit consumption far exceeds actual token usage for simple prompts
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?
Observed Behavior
Session limit consumption is drastically disproportionate to the actual work performed. Specifically:
What happens:
- sends a prompt that triggers a straightforward response
- Claude generates a short text response (a few hundred tokens)
- No tools are invoked (verified: no bash_tool, web_search, file operations visible in the conversation)
- No web searches are performed
- No large files are read or processed
- Response appears to be generated from conversation context only
Session limit impact:
- Session limit increases by multiple tens of percentage points
- The increase is orders of magnitude larger than the visible token generation would explain
- Even accounting for conversation history reloading and system overhead, the consumption is mathematically impossible
Example
Session limit increased by 29 percentage points (e.g., from 31% to 60%) for a ~200 token response with no tools or searches.
Mathematical impossibility:
- 29% of 200K context window = 58,000 tokens
- Actual response: ~200 tokens
- Even with conversation history reloading: cannot account for this discrepancy
- Discrepancy factor: ~290x
Claude's Own Analysis
When questioned about this behavior, Claude itself acknowledged:
"This is not normal. My last response was ~200 tokens - no tool call, no search. I cannot explain this."
This confirms the behavior is inconsistent with expected token accounting.
Related Issues
This appears related to but distinct from:
- Issue #18802 (context fills fast, stops at ~70%)
- Issue #18178 (context display shows free space but reports limit reached)
- Issue #18159 (limit reached with significant free space remaining)
The core issue here is impossible token consumption calculations rather than just reaching limits early or display inconsistencies.
What Should Happen?
Suggested Fix
- Audit session limit calculation logic
- Ensure each token/operation is counted exactly once
- Provide transparency: show breakdown of what counts toward session limit
- Consider adding
/session-debugcommand to show detailed accounting - Optimize server-side session cache.
Error Messages/Logs
Steps to Reproduce
[Unknown]
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.11
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗