[FEATURE] Update Status Bar Context Window to 1M Baseline with Dual Threshold Warnings
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Summary
The status bar currently displays context usage percentage against a 200K token baseline, even when using Sonnet 4.5 with 1M token context. This creates confusion and conflicts with the /context command output, which correctly uses the 1M baseline.
Current Behavior
Status Bar:
🧠 36,472 (18%)
- Calculates: 36,472 / 200,000 = 18%
- Uses legacy 200K auto-compact threshold as baseline
- Misleading for 1M context models
/context Command:
90k/1000k tokens (9%)
- Correctly uses 1M token context baseline
- Comprehensive breakdown of all components
Problem
Users see conflicting information:
- Status bar says "18%" (against 200K)
/contextsays "9%" (against 1M)- Same session, different metrics = confusion
Root Cause
Status bar token counting was built for 200K context window and was never updated when Sonnet 4.5 introduced 1M context capability.
Proposed Solution
Proposed:
🧠 36,472 / 1M (3.6%)
Add Dual Warning Thresholds
# Pseudo-code for warning system
if tokens > 800_000: # 80% of 1M model limit
display += " ⚠️ Approaching model limit"
elif tokens > 160_000: # 80% of 200K auto-compact threshold
display += " ⚠️ Auto-compact soon"
Example outputs:
- At 50K tokens:
🧠 50,472 / 1M (5.0%) - At 165K tokens:
🧠 165,472 / 1M (16.5%) ⚠️ Auto-compact soon - At 850K tokens:
🧠 850,472 / 1M (85.0%) ⚠️ Approaching model limit
Benefits
- Consistency: Status bar and
/contextcommand show same percentage - Accuracy: Reflects true capacity of 1M context models
- Educational: Dual warnings teach users about two different limits
- Future-proof: Scales to future models with larger contexts
- Actionable: Clear warnings at meaningful thresholds
User Impact
- Eliminates confusion from conflicting metrics
- Provides accurate representation of remaining capacity
- Maintains at-a-glance monitoring functionality
- Educates users on auto-compact vs. model limit thresholds
Technical Details
Two Important Thresholds:
- Auto-compact threshold (160K tokens):
- 80% of 200K legacy limit
- Claude Code automatically compacts conversation
- Optimization for performance, not hard limit
- Model capacity limit (800K tokens):
- 80% of 1M Sonnet 4.5 capacity
- Approaching actual model constraint
- Requires user intervention
Backward Compatibility
For users who prefer 200K monitoring (e.g., optimizing for auto-compact), consider adding configuration option:
// .claude/config.json
{
"statusBar": {
"contextBaseline": "model" | "autocompact", // Default: "model"
"showWarnings": true
}
}
Related Issues
- Issue #5477: Enhanced Status Line with Context Information Integration
- Issue #5547: Real-time Context Window Monitoring in Status Line
Alternative Solutions Considered
- Remove status bar context display - Too drastic, removes useful feature
- Keep separate metrics - Confusing, requires understanding two systems
- Differentiate with labels - Space constraints in status bar
Testing Checklist
- [ ] Status bar percentage matches
/contextpercentage - [ ] Warning appears at 160K tokens (auto-compact)
- [ ] Warning changes at 800K tokens (model limit)
- [ ] Works correctly with Sonnet 4.5 (1M context)
- [ ] Works correctly with future models (different context sizes)
- [ ] Configuration option allows users to customize baseline
Environment
- Claude Code Version: Latest (as of October 2025)
- Model: claude-sonnet-4-5-20250929 (1M context)
- OS: macOS (Darwin 24.6.0)
Additional Context
This discrepancy was discovered through systematic analysis comparing /context output (90k tokens, 9%) with status bar display (36,472 tokens, 18%). The root cause is status bar using 200K baseline while model actually has 1M capacity.
Community has developed custom status line solutions, but official fix would benefit all users and eliminate need for workarounds.
Alternative Solutions
_No response_
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗