[FEATURE] Live tokens-per-second (TPS) display during streaming
Problem
I can't see how fast a response is streaming. When a long response feels slow, there's no way to tell if it's the model, my network, or throttling. There's also no way to compare models on speed.
This was asked before in #58248. That issue was closed by the stale bot for inactivity, not because anyone looked at it, so I'm re-raising it with a bit more detail.
Why this has to be built in
Two different things could be measured here, and only one is possible from outside the CLI.
Live TPS while streaming. Needs the internal streaming token deltas. There's no hook for that today, so it can only be done natively.
Throughput for a finished turn. This one already works. The OpenTelemetry export emits an api_request event on completion with duration_ms and output_tokens, which is enough to compute tokens/sec per turn.
There's already a VS Code extension, Claude Speedometer, that does the second one off that OTel data. Its limits come from the approach, not the implementation: VS Code only, and it can only update once the turn finishes.
So the part nobody outside Anthropic can build is the live number in the terminal.
What I'd like
A TPS counter in the terminal while a response streams:
- rolling window of a few seconds so the number doesn't jump around
-when nothing is streaming- out of the way, e.g. bottom right near the existing indicators
- opt-in via settings, or available to the statusline
OpenCode's @williamcr01/opencode-tps plugin does this by hooking streaming delta events and registering a UI slot.
Alternative
If you'd rather not add UI for this, exposing the streaming token deltas to hooks or the statusline API would let people build it themselves. The blocker is access to the data, not the display.
Why it's useful
- knowing whether a slow response is the model or something else
- comparing models fairly
- spotting throttling instead of guessing