DEV Community

gentic news
gentic news

Posted on • Originally published at gentic.news

cc-context-telemetry: Show Context Window & Rate-Limit % Directly in

Install cc-context-telemetry to monitor Claude Code's context window, Pro/Max rate-limits, and model via a custom statusLine segment.

What Changed — Real-Time Telemetry in Your Status Bar

Context Window Optimizing Strategies in Gen AI Applications | by ...

Claude Code's status bar is a small but powerful UI element. It shows your current branch and directory, but it hides critical info: how much of your context window is used, how many requests you have left under Pro or Max rate limits, and which model is active.

cc-context-telemetry changes that. It prepends a segment to your existing status line that looks like this:

ctx 48% | 5h 14% ~3h20m | 7d 50% ~4d | opus-4.8 ~/code/myapp main
Enter fullscreen mode Exit fullscreen mode

Each piece tells you something actionable:

  • ctx 48% — Your context window is half full. Time to start a fresh session if you're hitting token limits.
  • 5h 14% ~3h20m — You've used 14% of your 5-hour rate limit, with ~3 hours 20 minutes until reset.
  • 7d 50% ~4d — You've used 50% of your 7-day rate limit, with ~4 days until reset.
  • opus-4.8 — The current model (short token).

This tool works with any existing status line setup, including popular plugins like adtention (which shows Git info, time, and more). It doesn't replace your current bar — it extends it.

What It Means For You — Stop Guessing, Start Optimizing

If you use Claude Code heavily, you've likely hit a context window limit mid-task or wondered why your requests suddenly slowed down. That's the rate-limit kick in.

With cc-context-telemetry, you can:

  • See context pressure in real time — If ctx is >70%, consider starting a new session or using /compact to free tokens.
  • Plan around rate-limit resets — The countdowns tell you exactly when you'll get more capacity. No more refreshing the Anthropic dashboard.
  • Know which model is active — If you switch models mid-session (e.g., via /model), the bar updates immediately. No confusion.

This is especially valuable for teams sharing a Pro or Max plan. If you see 5h 80%, you know to throttle down or switch to a cheaper model until the reset.

Try It Now — Setup in 2 Minutes

1. Install

npm i -g cc-context-telemetry
Enter fullscreen mode Exit fullscreen mode

No Node.js on your machine? Skip npm. Git clone the repo and use the absolute path to bin/cct-statusline as your command below.

2. Configure

Add this to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "cc-context-telemetry-statusline"
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart Claude Code. You'll see the telemetry segment.

3. Wrap an Existing Status Line

Already using a custom status line? Set CCT_WRAP:

{
  "statusLine": {
    "type": "command",
    "command": "cc-context-telemetry-statusline",
    "env": {
      "CCT_WRAP": "<your existing statusline command>"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

If your Claude Code version doesn't support env in settings, export CCT_WRAP in your shell profile instead.

4. Customize Segments

Use CCT_SEGMENTS to pick which data shows and in what order. Options:

  • ctx — Context window %
  • 5h — 5-hour rate-limit % with countdown
  • 7d — 7-day rate-limit % with countdown
  • model — Current model short token

Example — show only rate limits:

{
  "statusLine": {
    "type": "command",
    "command": "cc-context-telemetry-statusline",
    "env": {
      "CCT_SEGMENTS": "5h,7d"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Or reorder to put model first:

{
  "statusLine": {
    "type": "command",
    "command": "cc-context-telemetry-statusline",
    "env": {
      "CCT_SEGMENTS": "model,ctx,5h,7d"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Changes take effect only in a new session.

5. Host-Owned Status Lines

If another tool (like a plugin) manages your status line, you can point that tool at cct instead. See examples/host-owned-statusline.md in the repo for details.

Forward Signal

As Claude Code expands to larger projects with multi-agent workflows (via Claude Agent), real-time telemetry like this becomes essential for orchestration. Imagine an agent that auto-compacts your session when context hits 80%, or routes tasks to a different model when rate limits are tight. This tool is a first step toward that future — and it's free, open-source, and ready today.


Source: github.com


Originally published on gentic.news

Top comments (0)