[BUG] No visibility into session token cost — 1M context window makes existing warnings useless

Resolved 💬 5 comments Opened Apr 7, 2026 by flound1129 Closed Jun 21, 2026

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?

Users have no practical visibility into how many tokens each turn costs them based on session size. With the 1M context window on Opus 4.6, the old compaction warning (which triggered at ~85% of 128K) no longer serves as a useful guardrail — it wouldn't fire until ~850-900K tokens, at which point:

  1. Every turn is re-sending hundreds of thousands of uncached tokens
  2. The session may be too large to even compact successfully
  3. The user has been silently burning through their quota for the entire session

The /cost command exists but requires the user to actively check. The status line exposes context_window.used_percentage and token breakdowns, but only to users who've built custom status line scripts — the default UI shows nothing.

The practical result: most users on 1M Opus sessions are wasting enormous amounts of tokens because they have no idea their session has grown to 200-400K with minimal cache hits. A session over ~100-150K should be compacted if the user wants to avoid token waste, but nothing tells them this.

What Should Happen?

  1. Surface cached vs uncached token counts prominently — not buried in /cost, but visible per-turn or in the default status line. Users need to see "this turn cost 340K input tokens, 12K were cached" to make informed decisions.
  1. Warn based on absolute token count, not just percentage — a session at 200K tokens is expensive regardless of whether that's 20% or 80% of the context window. The warning threshold should be based on cost impact, not proximity to the limit.
  1. Recommend compaction based on economics, not just capacity — "Your session is 250K tokens. Compacting would reduce per-turn cost by ~80%. Compact now?" This is different from the existing "running out of space" warning.
  1. Make the default status line show session size — even a simple "Session: 180K tokens" would help. Currently users have to build custom status line scripts to see this.

Steps to Reproduce

  1. Start a session with Opus 4.6 (1M context)
  2. Work for a while — read files, run commands, have a conversation
  3. Notice there's no indication of session size or per-turn cost in the default UI
  4. Run /cost and discover you've been sending 300K+ tokens per turn
  5. Realize the compaction warning won't fire until ~850K

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

The 128K context window made the ~85% compaction warning a reasonable proxy for "your session is getting expensive." The 1M context window broke this heuristic without replacing it with anything better.

Claude Code Version

2.1.92

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Xterm

Additional Information

Related but different issues:

  • #33981 — wants a "context 80% full" indicator (percentage-based, not cost-based)
  • #42590 — compaction too aggressive on 1M (opposite problem — about when to compact, not about visibility)
  • #11535 / #12520 / #28999 — expose more data in statusLine JSON (data availability, not default UX)
  • #18550 — automatic cost tracking (broader scope)

The workaround today is a custom status line script that shows cached/uncached token breakdown per turn, but this should be default behavior.

View original on GitHub ↗

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