Track Claude Code cost and context with Redline
Glance at the context percentage and estimated session spend, then open /redline for the detail behind them. Keep conversation capacity, subscription limits and dollars separate: they answer different questions.
Put the gauge in your session
Use Claude Code 2.1.287 or later in a terminal, or a local Code session in Claude Desktop. Desktop includes its own Claude Code; the official minimum there is 2.1.286, while this collection conservatively requires 2.1.287.
The current official mods documentation also allows mod UI in the VS Code chat panel with extension 2.1.299 or later, in a session that fetches feature flags. That platform capability is not a compatibility test of every mod. Desktop WSL sessions have no plugins. Remote Control shows mod UI in the terminal on the host machine.
This workflow uses the terminal or local Desktop Code. Redline's bundled README describes pane drawing through the same hooks elsewhere, but does not report VS Code or mobile testing.
Run these inside Claude Code. Skip the marketplace command if you already added it.
/plugin marketplace add modmyclaude/claude-code-mods/plugin install redline@modmyclaudeCheck claude --version in your shell, or /status in Desktop. If you install externally while a session is open, use /reload-plugins in that session. See the install guide for setup and troubleshooting.
/redlineThe status line below the prompt is the quick check. The pane adds pace, token totals, estimated cost, account windows and busy turns. Where no surface places a pane, Redline writes its detail as display-only transcript rows.

Read three different limits
- Context fill: how full is this conversation?
- The percentage uses Claude Code's reported context window for the current model. It covers the main conversation, not a sum of every subagent's context. Between measurements, Redline counts the main request's input, including cache reads and writes.
- Session cost: how much model usage is represented?
- The
≈total prefers Claude Code's own session estimate, like/cost. Otherwise it uses Redline's table for requests it observed. Token and cost totals include subagents. On a subscription, this list-price estimate is not the amount you are billed. - Plan windows: how much account allowance is used?
- The 5-hour and 7-day percentages are subscription windows reported by Claude Code, after the session's first reply. They are not context percentages and do not appear with API-key billing. A new conversation does not reset an account window.
Illustrative reading, not a live result
Suppose the gauge reads ctx 82% RED, ≈$4.12, 5h 46% and 7d 13%. The conversation is near its context limit, the model usage has an estimated list-price value, and the account windows are less used. None of those figures proves what your invoice will be. This example explains the labels; it is not a session we ran or the result shown in the screenshot.
Below 60%, the level has no warning word. At 60% it becomes AMBER; at 80%, RED. The toast fires once on a crossing of 80% and re-arms only below 75%. It suggests action; it does not stop work or execute a command.
Updates follow responses, not a ticking meter
Requests and Claude Code measurements refresh the gauge. Context pace needs at least a minute of growing context within the last ten minutes. Flat or shrinking context gives no fill-time forecast. Plan run-out uses the last fifteen minutes of readings when the window is moving, otherwise an average pace. Forecasts change with the work.
Two one-shot repaints handle idle pace expiry and account-window resets. The pane's elapsed session time otherwise refreshes with readings, so an idle display need not tick every second.
Use the spend view as a clue
/redline spendThe same pane includes “Where the money went”: estimated request cost grouped into prompt, reading, editing, shell, search, planning, subagents, answering and named MCP servers, plus a model breakdown.
These categories are heuristic. A request is allocated equally across the distinct kinds of tool results it carried from the previous reply. A request carrying reading and shell results splits its estimate between those kinds. The first request is prompt; a subagent request is subagents. It is not a meter on each file read, shell process or MCP service, and does not include that service's own charges.
The session headline can differ from category totals: the headline can use Claude Code's ledger, while categories use Redline's price table. The table is a snapshot marked 8 Oct 2026, not a live pricing feed. It does not generally account for long-context premiums, fast mode, one-hour cache writes, batch or regional pricing. Unknown model IDs get token counts without a guessed table price.
/redline bandToggle the colored gauge above the prompt if you hide the status line. The band choice is stored across sessions. Toggling it does not change the spend breakdown or ask the model anything.
Choose compact or clear deliberately
- Continue the same task: /compact
- Ask Claude Code to summarize the conversation when you need room but still need its working context. Review important constraints and pending decisions before continuing. Compaction can omit details; Redline cannot tell you which details matter.
- Start a separate task: /clear
- Save anything you need, then clear when you want a fresh conversation. Redline resets its tracked session data. Account limits and money already used do not disappear.
These are commands you choose, not actions Redline automatically takes. Redline also restarts its gauge on an in-session resume. Its own token and table totals begin when it loads; Claude Code's context and ledger can cover earlier session usage.
Troubleshoot missing or surprising values
- No status line or pane
- Confirm Redline is installed and enabled in
/plugin. Check the version and attached surface, reload after an external install, then use/redline. Try the band if you hide the status line. - No 5-hour or weekly window
- Wait for the first reply on a subscription session. API-key sessions have no subscription windows; Redline cannot invent them.
- No pace or a stale-looking clock
- A new session, recent compaction or flat context may not have enough growth for a forecast. Most updates arrive with responses and measurements, not continuously.
- Cost differs from billing or another mod
- Check whether the figure is an engine estimate or table estimate, when tracking began and which model was used. Use your provider's billing records for actual charges, not the gauge.
Redline observes session usage and prompt text for its busy-turn list. It stores the band preference but makes no model calls, file accesses, processes or network requests of its own. The Claude work it observes still uses your normal model and tool permissions.
Source and next steps
Reviewed against Redline v0.1.3, commit 6dee58f, and current official documentation on 15 Oct 2026. The screenshot is existing project media. No new live Claude Code test was run.
Official feature and context guidance · Official mods documentation