[FEATURE] Update Status Bar Context Window to 1M Baseline with Dual Threshold Warnings

Resolved 💬 3 comments Opened Oct 20, 2025 by luisdlugo Closed Oct 24, 2025

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)
  • /context says "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

  1. Consistency: Status bar and /context command show same percentage
  2. Accuracy: Reflects true capacity of 1M context models
  3. Educational: Dual warnings teach users about two different limits
  4. Future-proof: Scales to future models with larger contexts
  5. 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:

  1. Auto-compact threshold (160K tokens):
  • 80% of 200K legacy limit
  • Claude Code automatically compacts conversation
  • Optimization for performance, not hard limit
  1. 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

  1. Remove status bar context display - Too drastic, removes useful feature
  2. Keep separate metrics - Confusing, requires understanding two systems
  3. Differentiate with labels - Space constraints in status bar

Testing Checklist

  • [ ] Status bar percentage matches /context percentage
  • [ ] 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_

View original on GitHub ↗

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