Skip to content
Glance MetricsBetaTurn AI recommendations into customers
← Insights
Company3 min read

We Open-Sourced a Claude Code Plugin: Live Context Usage in Your Status Line

Glance Metrics·6 July 2026

We build with AI every day at Glance: it is how we ship a scoring engine, an admin platform, and enterprise integrations with a small team. Today we are open-sourcing a small tool from that workflow: a Claude Code plugin that puts your live context window usage in the status line, so long coding sessions stop ending in surprises.

It is free, MIT-licensed, and one Python file with zero dependencies: github.com/slimt623/claude-context-statusline

The problem

Every AI coding session runs inside a context window (the model's working memory). As the conversation grows, the window fills. When it is full, the session gets compacted: the history is summarized so work can continue. Compaction is useful, but if you do not see it coming, it lands mid-task and you lose the thread of long work, exactly when the work is most valuable.

Claude Code will tell you your usage if you ask (/context), but nobody asks on every turn. The fix is making the number ambient.

What it shows

Fable 5 | my-project | ctx 261k/500k [=====-----] 52% | $1.23
  • Live context usage, read from the real session transcript and updated after every turn
  • A progress bar with warnings at 75% ("consider /compact") and 90% ("compact imminent"), so compaction becomes a decision you make, not a surprise you suffer
  • Model, project, and session cost in one line
  • Auto-detected window sizes: standard 200k and extended 500k / 1M context models, no configuration

Install

Inside any Claude Code session:

/plugin marketplace add slimt623/claude-context-statusline
/plugin install claude-context-statusline@claude-context-statusline
/claude-context-statusline:install

The install skill copies the script into your Claude configuration and wires it into your settings safely: it reads your existing settings first, preserves every key, and verifies the result before telling you it worked. Prefer manual setup? The README covers that too.

How it works

Claude Code pipes a JSON payload to your status line command on every update, including the path to the session transcript. The script reads the last main-thread assistant message and sums its usage block:

context = input_tokens + cache_read_input_tokens + cache_creation_input_tokens

That sum is the actual size of the conversation as sent to the model: the same number that drives compaction. Subagent messages are excluded so background activity does not distort the reading. If anything is missing (no transcript yet, malformed input), it degrades to a quiet "ctx n/a" instead of breaking your prompt.

Why we are open-sourcing our tooling

Glance helps African enterprises adopt AI safely: visibility in AI search, agentic workflows, custom integrations for regulated environments. You cannot credibly build AI systems for banks and insurers without living in these tools daily, hitting their sharp edges, and fixing them. Small utilities like this one fall out of that work, and we would rather share them than keep them in a drawer.

If you want to know how AI systems see your business before your customers ask them, run the free AI Visibility analysis. And if your enterprise is working out how to adopt AI safely, that is exactly what we do.