Context command shows incorrect remaining context with mixed models

Resolved 💬 3 comments Opened Aug 21, 2025 by christopher-buss Closed Aug 21, 2025

Issue Description

The new /context command does not correctly display remaining context when using mixed models, such as when switching from Opus plan mode to Sonnet.

Current Behavior

When using mixed models (e.g., starting in Opus plan mode then switching to Sonnet), the context display shows:

Context Usage
     ⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   claude-sonnet-4-20250514 • 94k/200k tokens (47%)
     ...
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 105.8k (52.9%)

But simultaneously shows "2% context window left until autocompact", which is contradictory.

Expected Behavior

The context display should accurately reflect the actual remaining context window, taking into account context usage from previous models in the same session.

Root Cause

It appears the context calculation doesn't account for context used by Opus (or other models) earlier in the session, only showing the current model's usage against its own context window rather than the cumulative session context usage.

Steps to Reproduce

  1. Start a session in Opus plan mode
  2. Use significant context in Opus
  3. Switch to Sonnet
  4. Run /context command
  5. Observe contradictory context usage information

Environment

  • Platform: Windows (MINGW64_NT-10.0-26100)
  • Mixed model usage (Opus plan mode → Sonnet)
  • Claude Code CLI

Impact

This makes it difficult to accurately track context usage and plan accordingly when working across different models in the same session.

View original on GitHub ↗

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