Expose context-window utilization to the model (re-raise of stale-closed #34184 / #60302 / #43431)
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
There is no way for the assistant to read its OWN context-window utilization (% of context consumed) during a session. The genuine reason to wrap/checkpoint a long session is that context-fullness degrades reliability - but the model can't see that number, so it substitutes weak proxies (responses-since-start, "feels like a milestone") and gets it wrong (e.g. suggesting "want to wrap?" right after a fresh start). This makes context-health self-management guesswork.
Live evidence: in a long Cowork build session, the app auto-fired its "Compacting our conversation... N%" window mid-session - i.e. the context ceiling was hit and the transcript was lossily summarized BEFORE any wrap, because the model couldn't see the real signal and leaned on a proxy that resets each session. Textbook too-late failure.
Proposed Solution
Expose context utilization TO THE MODEL - a readable signal (a tool, a system value, or a periodic "context at X% / ~Y of Z tokens" note) the assistant can check, so it checkpoints when context is ACTUALLY heavy, not on a proxy. Even a coarse band (low / medium / high / near-limit) would fix it.
Prior art (all closed, mostly by the stale-bot, now locked): #34184 "Expose context window usage percentage to the model" (closed not_planned + locked); #60302 (expose to hooks, CLAUDE_CONTEXT_PERCENT); #43431 (show % / distance to auto-compact). Open issues #7111 and #12520 cover user-VISIBLE display (status line / indicators), NOT a model-readable signal. Re-raising because the model-facing version keeps dying of inactivity while the underlying need persists.
Environment: Claude Desktop, Cowork mode, macOS, Opus.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
API and model interactions
Use Case Example
_No response_
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗