AI Signal 142
ClaudeStatsBar shows context size and token cost per turn for Claude Code sessions
ClaudeStatsBar adds a status line that reports the current context size, estimated token cost of the next turn, and remaining usage windows for Claude Code sessions.
Engineers working with long Claude Code sessions often exhaust context or usage limits without warning, causing wasted tokens and interrupted tasks. ClaudeStatsBar makes the hidden cost visible, letting users clear or compact before limits are hit.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Shows current context size and estimated token cost per turn before typing.
Provides remaining 5-hour and 7-day usage windows with extrapolated time left.
Pure Python, no dependencies, low overhead (~25 ms per render) and installs via a simple script that edits Claude Code settings.
THE READ
What the cluster adds up to.
Long Claude Code sessions accumulate context without any visible indicator of the growing token cost. As the session length increases, each new turn resends the entire history, so the cost per turn rises roughly with the square of the number of turns. Users typically discover the problem only when the context window or usage quota is exhausted, which interrupts work.
ClaudeStatsBar inserts a statusLine command that displays the current context size, the estimated token cost of the next turn, and the remaining capacity of the 5-hour and 7-day usage windows. The bar also shows whether it is cheaper to clear the session or to compact it, based on the observed baseline. All information is updated on every render, which takes about twenty-five milliseconds. The tool uses only the Python standard library and requires no network access or external dependencies.
Installation is a single git clone followed by an installer script that backs up the existing Claude Code settings file and inserts the statusLine entry, refusing to overwrite a custom line if one already exists. On Windows the command points to the Python interpreter with the full path to the script, while on POSIX systems the shebang and tilde expansion are used. Uninstalling consists of removing the statusLine key from the settings file.
The tool does not automatically clear or compact the session; it relies on the user to act on the displayed warnings. The estimates of remaining time are extrapolated from the measured burn rate. Because it works only with Claude Code, it provides no benefit for other LLM interfaces or for users who do not enable the statusLine feature.
Written by elseif from the cluster below · checked for specifics the sources never containedTHE CLUSTER