[FEATURE] Make the context-usage indicator's 50% visibility threshold configurable in the VS Code extension

Status Open
Reported on v2.1.263
Maintainer reply None cached
Activity 3 comments · opened Sep 9, 2026

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

In the VS Code native extension, the context-usage ring in the composer footer is hidden until context usage crosses 50%. Below that, there is no indication at all of how full the context window is.

The consequence is that the indicator only appears once you are already halfway through the window — exactly when it is too late for it to inform a decision. Deciding when to start a new session, when to hand off, or whether a large file read is affordable is most useful early, while there is still room to act. Today the only way to know before the 50% mark is to interrupt the work and run /context.

This is not a discoverability problem — the number is already computed and already rendered in the widget's own tooltip (N% context used) and hover popup (N% of context remaining until auto-compact.). It is simply gated behind a hardcoded threshold, with no setting or environment variable to change it.

For reference, in anthropic.claude-code-2.1.263 (webview/index.js, minified) the gate is:

let z = J > 0 ? Math.min($ / J * 100, 100) : 0,
    q = yW1 !== null ? yW1 : z,   // yW1: build-time override, `var yW1 = null`, never assigned
    U = 100 - q;                  // U = % of context remaining
if (yW1 === null) {
  if (J === 0) return null;
  if (U >= 50) return null;       // <-- ring hidden while >= 50% remains
}

CLAUDE_AUTOCOMPACT_PCT_OVERRIDE does not help here: it governs when auto-compact fires, not when the indicator is drawn.

Proposed Solution

Make the visibility threshold configurable, e.g. a settings.json key:

{
  // % of context remaining below which the indicator appears.
  // 100 = always visible. Default 50 preserves today's behaviour.
  "contextIndicatorThreshold": 100
}

Users who like the current quiet-until-it-matters behaviour keep it by default; users who want an always-on gauge set 100.

An always-visible indicator is the outcome I am after, so if a setting feels like too much surface area, simply always rendering the ring would also solve the problem.

Alternative Solutions

  • /context — works, always available, but it is an explicit interruption and a point-in-time answer. It cannot serve the "glance while working" purpose an ambient indicator serves.
  • A custom statusLine — the natural fix, and it already renders the gauge permanently in the terminal CLI. But the extension never renders statusLine output in the IDE: statusLine appears in extension.js only in the settings schema, and zero times in webview/index.js. This was reported in #68811 and #70497, both closed NOT_PLANNED by the staleness bot rather than by a maintainer decision. That gap is a separate concern and I am deliberately not folding it into this request.
  • Patching the extension bundle — a one-line regex substitution on webview/index.js works, but a version bump creates a fresh anthropic.claude-code-<version>-<platform> directory, so the patch silently disappears at every update. Not something to recommend to anyone.

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

  1. I start a long session in the extension: reading a domain map, several service repos, a migration runbook.
  2. Thirty tool calls in, I am about to read three more large files and would like to know whether to do it here or split the work into a fresh session.
  3. Today the footer shows nothing, because I am still under 50% — the absence of the ring is indistinguishable between "3% used" and "49% used". I run /context, which stops the flow to answer a question a glance should have answered.
  4. With the threshold set to 100, the ring is simply there the whole time, and I split the session before hitting compaction rather than after.

Additional Context

One technical consideration, in case it makes the change look smaller than it is: the ring's arc geometry is currently quantised into three states, keyed on percent used:

function Re0($) { if ($ < 62.5) return 50; if ($ < 87) return 75; return 99 }

Since the widget is only mounted above 50% used, those three arcs cover the visible range acceptably today. Made always-on, every value from 0% to 62.5% would render the identical arc — a gauge that reads the same at 3% and at 49% is worse than no gauge, because it looks like live feedback while carrying none. So an always-visible indicator likely wants finer arc granularity, or a continuous ring (stroke-dasharray on a circle, or a conic gradient) instead of the three pre-baked SVG paths.

Environment: VS Code native extension anthropic.claude-code-2.1.263-win32-x64, Windows 11.

Related (both closed by the staleness bot, both about statusLine never rendering in the IDE rather than about this threshold): #68811, #70497.

View original on GitHub ↗

3 Comments

pascal-libaud-agicap · 4 days ago

+1, this would be very useful. The terminal app shows context usage at all times, so having it hidden below 50% in the VS Code extension feels like a gap rather than a design choice, the decisions it informs (compact, split the session, offload to a subagent) are taken well before 50%. Really looking forward to this one, ideally as a configurable threshold so current behaviour stays available.

AndreLFSMartins · 3 days ago

Basic visibility gap: the threshold hides exactly the information you need before you need it. #18456 asked for this 8 months and 148 👍 ago and got closed as completed without a configurable threshold ever landing. Please reopen this as a real fix, not another stale-bot close.

astroboy1183 · 40 minutes ago

Confirming this still reproduces on anthropic.claude-code-2.1.270 (linux-x64), so it isn't fixed in the seven releases since 2.1.263.

The gate is unchanged — the build-time override variable has just been renamed by the minifier, yW1RF1:

var RF1 = null;   // still never assigned

function YH0({ usedTokens: $, contextWindow: J, onCompact: Z, buttonClassName: Y }) {
  // ...
  let z = J > 0 ? Math.min($ / J * 100, 100) : 0,
      q = RF1 !== null ? RF1 : z,
      U = 100 - q;
  if (RF1 === null) {
    if (J === 0) return null;
    if (U >= 50) return null;   // ring hidden while >= 50% remains
  }
  // ...
}

Two details that may be useful for triage:

  • The indicator (YH0) and the prompt-cache chip (gV0) are separate sibling components in the footer, rendered side by side. The cache chip has no such threshold, so below 50% usage the footer shows a cache TTL (60m) and no context ring at all. That reads as though the timer replaced the ring, which is a confusing failure mode — it's how I ran into this, assuming the indicator had been removed in a recent update.
  • I checked all 16 settings the extension contributes under claudeCode.* in package.json (focusView, preferredLocation, initialPermissionMode, …). None of them affect this, which matches the report that there is no configuration path today.

The effect is most pronounced on larger context windows, where 50% is a very long way in and the ring is effectively never visible during normal use.