[FEATURE] VSCode Extension: Display context usage percentage in UI

Status Fixed / completed
Reported on v2.1.7
Maintainer reply ✓ Yes — bcherny
Activity 21 comments · opened Jan 16, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Feature Request

Problem

The CLI version of Claude Code supports custom status lines that can display context usage percentage, but the VSCode extension has no visibility into context consumption. Users must manually run /context to check usage.

This matters because Claude's response quality can degrade as context fills up (commonly cited around 40%). Without visibility, users don't know when to run /compact to maintain optimal performance.

Proposed Solution

Add a persistent context usage indicator to the VSCode extension UI, showing:

  • Current context usage percentage (e.g., "Context: 30%")
  • Visual warning states:
  • 🟢 Green: < 35%
  • 🟡 Yellow: 35-45% (suggest /compact)
  • 🔴 Red: > 45% (strongly recommend /compact)

Bonus Features (nice to have)

  • Configurable threshold warnings
  • Optional notification/toast when crossing thresholds
  • Auto-suggest /compact when hitting warning threshold

Context

  • The CLI statusLine feature doesn't work in VSCode extension
  • Tool Search (v2.1.7) helps reduce MCP tool overhead, but conversation context still grows
  • Power users track the "40% rule" manually - this should be built-in

Environment

  • Claude Code: 2.1.7
  • VSCode Extension
  • macOS

View original on GitHub ↗

21 Comments

Achour · 5 months ago

we really need this

elliejayliquid · 5 months ago

I swear I thought it was always on, but turns out it's not? How hard is it to just always make it visible? It's pretty useful.

maarteek · 5 months ago

Adding my use case. I run the VS Code extension via Remote-SSH on Linux (WSL2), so this isn't macOS-specific.

The extension previously showed a context percentage that updated as the conversation progressed. That indicator has disappeared in recent versions. The CLI statusLine setting works in the terminal but doesn't surface in the VS Code chat panel, so there's currently no passive way to monitor context usage from the extension.

Without it I end up either running /context manually every few messages or just guessing when to start a new conversation. A persistent indicator (status bar, inline, wherever) would remove that guesswork. Even a basic percentage without the colour thresholds would be a meaningful improvement.

callumhay · 5 months ago

This feels like much more of an issue than an enhancement: Knowing the percentage of context is crucial to avoiding context rot, a core limitation of Claude (or any LLM for that matter). I relied heavily on knowing this information for determining my own expectations in a given session and when to start a fresh session. I hope to see this bumped.

bjfar · 5 months ago

As far as I remember this was always visible, but now today it is gone? Why would you ever remove this extremely useful feature?

ns-lwu · 5 months ago

This seems visible until context used up to 50%+ in orange/red. I never see the pie chart before 50%.

callumhay · 5 months ago

I'm wondering whether this has something to do with the new 1M context window that was recently introduced. If the context only shows up at 50%... that would now be 500k tokens, which is A BIG context window (relative to the previous one). I actually find that going above 20-30% in the new 1M context window is not great for my kind of work... maybe there should be a reconsideration of when and how this information is presented now that the context window is so large and results in non-linear and earlier degradation in Claude's performance?

EDIT: If you find yourself here with a now broken workflow due to context rot from the 1M token window, quick solve is to update your claude settings.json with the following:
"env": {
"CLAUDE_CODE_DISABLE_1M_CONTEXT": "1"
},

S-Luiten · 5 months ago

Ever since 1M tokens became the default I have not seen the context usage indicator anymore. I tried setting CLAUDE_AUTOCOMPACT_PCT_OVERRIDE to a 5% thinking maybe it would re-appear at 50% of that amount, but this just makes it auto-compact without warning. There really should be a separate setting that controls when the indicator shows, because 50% is way too much for a 1M token context.

makingaipractical · 4 months ago

I built this extension a few months back that handles this issue:

https://github.com/makingaipractical/claude-code-fuel-gauge

It puts a live percentage in your VS Code status bar from 0%, color-coded green → yellow → red.
Works with both 200k and 1M context windows and works across multiple simultaneous sessions. I actively update it when things change (and will continue until it's not needed anymore) :)

You can find it in the VS Code Marketplace as well.

I've seen a lot of people are looking for something like this, so I decided to post this here. Hope it helps.

thatchaisurface · 3 months ago

How is this still not fixed / addressed? @claude we need a way to see our context window in real time, please. Right now we can only see our context window stats by manually typing /context or reverting back to CLI and not using the very cool VSCode Extension.

varname1 · 2 months ago

Just another user chiming in to say I'd love to have this feature implemented :)

mcltestowy-creator · 1 month ago

+1 — this would significantly improve day-to-day work in the VS Code extension.

As a developer working with large domain-specific source files, I regularly run into
situations where the context window fills up faster than expected. Right now the only
way to check usage in the extension is to manually run /context or /usage, which
interrupts the flow — and by the time you think of checking, it's often because
something already went wrong (auto-compact kicked in, or responses degraded).

A few points in favor of prioritizing this:

  1. The CLI already has this via statusLine — the extension is the only surface

where context usage is invisible. The data is clearly available internally (the
extension knows when to trigger auto-compact), it just isn't surfaced to the user.

  1. This is one of the most frequently requested features for the extension.

A quick search shows at least a dozen closed duplicates of this exact request
(#66021, #57721, #58159, #52468, #44849, #20207, #52156, #33819, #44469, #16526,
#38791...), plus reports like #37575 and #39503 suggesting an indicator existed
in the native UI before ~v2.1.81 and was removed. The demand is clearly persistent.

  1. Context awareness changes user behavior for the better. When I can see usage

approaching a threshold, I can proactively /compact, start a fresh session at
a natural boundary, or trim what I attach — instead of losing work quality
mid-task without warning.

Even a minimal version — a small percentage badge in the input bar area (where the
indicator seems to appear only at high usage today) that is always visible
would cover the core need. A tooltip with the token breakdown on hover would be
a bonus, not a requirement.

Thanks for considering this!

carlosdealmeida · 1 month ago

I built an open-source VSCode extension that shows exactly this, in case it's useful while there's no native indicator — disclosure: I'm the author.

Claude Todos adds a sidebar panel with a persistent context usage indicator: a "{pct}% ctx" badge plus a thin bar with traffic-light warning states (green < 60%, yellow 60–85%, red ≥ 85%). It's computed from the transcripts Claude Code already writes to ~/.claude/projects (input + cache tokens of the latest message, with the 200k/1M window detected per model), so it updates live no matter where claude runs — integrated terminal, external terminal, another window — as long as the session's cwd matches the open workspace. The same panel also shows per-model token usage, cache efficiency, and the live TodoWrite/sub-agent task list.

It's a sidebar panel rather than the inline statusline this issue asks for, but it gives you the always-visible percentage today. Fully local (no telemetry, read-only), MIT. Repo: https://github.com/carlosdealmeida/claude-todos-vscode

josh-keating · 1 month ago

Just another message of support for this feature request, would be great to have official support rather than having to use 3rd party plugins (which I would rather not).

Furkan-rgb · 1 month ago

Chiming in to voice my support for this feature request

mortang2410 · 19 days ago

I can't believe this is actually open after 7 months. I can only conjecture that the devs don't even use code editors like VSCode anymore.

joshhubert-dsp · 15 days ago

This omission feels intentional and disrespectful at this point... do better Anthropic.

bcherny collaborator · 14 days ago

The VS Code extension now has a built-in context indicator: the prompt box shows how much of Claude's context window is in use, and Claude auto-compacts when needed (or run /compact yourself). Threshold coloring/notifications aren't there yet, but the core visibility ask is covered.

Shipped in a recent release — changelog: https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
Docs: https://code.claude.com/docs/en/vs-code

🤖 Generated with Claude Code

S-Luiten · 13 days ago

With 1M context tokens the indicator only shows up when you're already at 500k tokens, that's way too late. This should be lowered to 35~45% as initially proposed, and/or allow users to configure this value.

WilliamABradley · 13 days ago

I think it would be helpful to be able to hover over it and see both day and week usage at any time, like how you can hover over the copilot icon at any time to see usage, it saves having to go into a submenu to see the current usage.

GaviLazan · 12 days ago
The VS Code extension now has a built-in context indicator: the prompt box shows how much of Claude's context window is in use, and Claude auto-compacts when needed (or run /compact yourself). Threshold coloring/notifications aren't there yet, but the core visibility ask is covered. Shipped in a recent release — changelog: https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md Docs: https://code.claude.com/docs/en/vs-code 🤖 Generated with Claude Code

What version is this in? I don't see it in the prompt box in vs code (Ubuntu or Windows) nor mentioned explicitly in the release notes. I do see it in the documentation. I'm fully up to date too.