Feature: expose token count and context % in status line

Resolved 💬 3 comments Opened Mar 18, 2026 by gsmethells Closed Mar 22, 2026

Problem

There is no way to see how much of the context window has been consumed during a session. This matters for long sessions where you need to decide whether to handoff or compact.

Request

Expose token count and context window utilization (%) to the statusLine command via environment variables, e.g.:

  • CLAUDE_TOKENS_USED — total tokens consumed in the current conversation
  • CLAUDE_CONTEXT_PCT — percentage of the context window used (0-100)
  • CLAUDE_CONTEXT_MAX — max context window size for the current model

This would allow status line commands like:

{
  "statusLine": {
    "type": "command",
    "command": "echo \"Tokens: $CLAUDE_TOKENS_USED | Context: $CLAUDE_CONTEXT_PCT%\""
  }
}

Why

Users running long autonomous workflows (multi-step orchestrators, large refactors) need to know when they're approaching context limits so they can handoff or compact proactively. Currently the only signal is when compaction happens automatically — by then it may be too late to preserve important context.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗