Show context window usage percentage / distance to auto-compact

Resolved 💬 2 comments Opened Apr 4, 2026 by roman-rr Closed Apr 4, 2026

Feature Request

Show the current context window utilization as a percentage or token count, so users can see how close they are to auto-compaction.

Problem

There's no way to know how much of the context window is consumed during a session. The only signals are:

  • The "Tip: You have access to Opus 1M" message appearing near the limit
  • The PreCompact hook firing right before compaction happens
  • The "Compacted" message after it's done

/cost shows cumulative token totals across all turns, but not the current context window size.

Proposed Solution

Any of these would help:

  1. Status bar indicator — e.g. ctx: 72% or 148k/200k in the bottom bar
  2. /context command — show current context size vs limit, similar to /cost
  3. Add to /cost output — append a line like Context window: 148,200 / 200,000 (74%)

Why It Matters

  • Long sessions (multi-hour coding) benefit from knowing when compaction is imminent
  • Users with PreCompact hooks can prepare for context loss
  • Helps decide whether to /compact manually vs continue
  • Useful for understanding token economics when working with large codebases

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6 (200k standard / 1M extended)

View original on GitHub ↗

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