Field-Logic-Ltd/ClaudeStatsBar

A Claude Code status line showing how big your session has got and what the next turn costs before you type

1

stars

4

commits

Python

primary language

Sep 11, 2026

updated

README

ClaudeStatsBar: your session is 486k deep and nothing told you

A Claude Code status line for the number nobody shows you - how big the session has got, what the next turn costs before you type a word, and when it is worth clearing rather than finding the limit mid-task.

Opus 5 (1M context) · my-project · ▕██████░░░░░░▏ 486k · 49k/turn · 88t · 5h 15% ~162t left · 7d 3%
⚠  486k context — every turn now costs 49k before you type. /clear if you have switched task, /compact to keep going

Pure Python stdlib. No dependencies, no network, no transcript parsing, no proxy. ~25ms per render.


Why this exists

Building anything large with Claude means long sessions, and the session grows underneath you whilst you work. Nothing shows you how big it has got, so the first sign is usually the limit itself - context exhausted, or the rolling usage window gone, mid-task. The stronger the model the sooner that bites; Fable on a big codebase will find the ceiling well before you expect it to.

This puts the size on screen whilst you work: how much context the session is carrying, what the next turn costs before you type a word, and how much of the 5h and 7d windows is left. Enough to clear at a sensible boundary instead of discovering the limit halfway through a refactor.

Sessions get far bigger than they feel. I measured two weeks of my own Claude Code usage - 916 transcripts, 711 sessions, 57,451 API requests, 11.6 billion tokens - and the sizes were not what I expected.

How big sessions actually get
Median context at the start of a session42.8k
Median growth per turn~1.7k
Average context carried per request193.3k
Sessions that ran past 150k context37%
Accumulated context re-read across the sample11.1B tokens
Context I actually typed1.3M tokens

Everything I typed across 711 sessions was 1.3M tokens. The same sample re-read 11.1 billion tokens of context it was already carrying. Shorter prompts are not the lever; session size is.

The reason is that the API is stateless. Every turn re-sends the entire conversation - system prompt, instructions, and all prior turns - so what goes on the wire grows with every message, whether you typed a paragraph or "yes".

Why it compounds

Because turn N re-sends turns 1..N-1, the context a session moves grows with roughly the square of its length. Taking the medians above (42.8k start, 1.7k a turn):

Same 160 turns of workContext movedEnds at
One 160-turn session28.6M tokens~315k
Four 40-turn sessions12.3M tokens~111k each

Less than half the context, for identical work - and no run gets near the ceiling. The distribution agrees: the top 10% of sessions accounted for 71% of every token moved.

The problem is that none of this is visible while you work, and unlike running out of context window, it never self-limits. A session can sit at 480k for two hundred turns, never trigger a compaction, and quietly burn millions of tokens.

That is the gap this fills.


Install

git clone <this repo> ClaudeStatsBar && cd ClaudeStatsBar
./install.sh

The installer merges a statusLine entry into ~/.claude/settings.json, backing the file up first and refusing to clobber an existing status line.

Open a new session, or run /hooks once to reload config.

Manual

// ~/.claude/settings.json
{
  "statusLine": {
    "type": "command",
    "command": "/absolute/path/to/ClaudeStatsBar/statsbar.py",
    "padding": 0
  }
}

Windows: "command": "python C:\\path\\to\\ClaudeStatsBar\\statsbar.py" (the shebang and ~ expansion are POSIX-only).

Uninstall: delete the statusLine key.


Reading the bar

FieldMeaning
Opus 5 (1M context)Model. The window size changes what the bar means.
my-projectCurrent directory.
▕██████░░░░░░▏Context window used - how much room is left.
486kTokens re-sent on every turn. Green under 60k, amber to 120k, red above.
49k/turnWhat that re-send costs each turn, before you type a character. Context x 0.1, the cache-read rate.
7.0×How much more a message costs now than at this session's cheapest point. Hidden if the bar started mid-session and never saw the real baseline.
88tAPI requests this session.
5h 15% ~162t leftShare of the 5-hour limit used, and turns of headroom at this session's measured burn rate. Red under 15 turns.
7d 3%Share of the weekly limit.

A second warning line appears past 120k of context, or past 80% of the window.

49k/turn is rent, not growth

A common misreading. The session grows by roughly 1.7k tokens a turn. The 49k is what you pay to put the existing 486k in front of the model again.

TurnSentAddedBilled
49478k1.7k47.8k
50480k1.7k48.0k
51482k1.7k48.2k

The consequence is counterintuitive: a one-word reply costs the same as a complex request. "Just one more quick thing" at the end of a long session is the worst-value message you can send.


What to do about it

Ranked by measured impact:

  1. /clear between unrelated tasks - roughly 35%. The whole game, and free.
  2. Fewer turns - roughly 20%. Each round-trip costs a full context sweep regardless of content. Batch tool calls; don't re-read files.
  3. Trim always-loaded instruction files - roughly 2%. Worth doing, not worth agonising over. In my sample only ~8.7k of a 42.8k session baseline was user-controlled; the rest is the harness.
  4. Lower reasoning effort - roughly 2%. Output is only 9.9% of spend.

Configuration

VariableDefaultEffect
CC_CTX_WARN60000Amber threshold (tokens).
CC_CTX_HIGH120000Red threshold, and the warning line.
CC_CTX_FULL_PCT80Window-full percentage that switches the advice to /compact.
CC_SHOW_COSTunsetShow the dollar estimate. Off by default: on a Claude subscription it is a client-side figure at API list price, not money anyone pays. Useful on an API key.
NO_COLORunsetDisable ANSI colour.

Notes and limitations

  • Weights are a proxy. Costs use API list-price ratios (input 1x, cache write 1.25x, cache read 0.1x, output 5x). The shape is right; treat 49k/turn as an index, not a bill. The rate-limit percentages are Anthropic's own figures and need no such caveat.
  • The multiplier needs a real baseline. It compares against the smallest context observed. Installed mid-session, it never saw the start, so it suppresses the ratio rather than printing a reassuring 1.0×.
  • The burn projection needs five samples before it extrapolates, and re-baselines when the rolling 5-hour window resets.
  • State lives in ~/.claude/.statusline-state/<session_id>.json: the minimum context seen and the rate-limit baseline. Pruned after a week.
  • It never breaks your session. Any exception prints an empty line and exits 0.
  • Requires Claude Code 2.1.251+ for prompt_cache, 2.1.260+ for last_miss_cause. Older versions degrade gracefully - those fields simply do not render.

About

Developed by Field Logic.

The numbers throughout this README come from instrumenting our own daily Claude Code use rather than from estimates - 916 transcripts and 11.6 billion tokens over two weeks. If you find the figures differ materially on your workload, we would like to hear about it.

Licence

MIT - see LICENSE.

Contributors

djf73

4 commits

Field-Logic-Ltd/ClaudeStatsBar

A Claude Code status line showing how big your session has got and what the next turn costs before you type

1

stars

4

commits

Python

primary language

Sep 11, 2026

updated

README

ClaudeStatsBar: your session is 486k deep and nothing told you

A Claude Code status line for the number nobody shows you - how big the session has got, what the next turn costs before you type a word, and when it is worth clearing rather than finding the limit mid-task.

Opus 5 (1M context) · my-project · ▕██████░░░░░░▏ 486k · 49k/turn · 88t · 5h 15% ~162t left · 7d 3%
⚠  486k context — every turn now costs 49k before you type. /clear if you have switched task, /compact to keep going

Pure Python stdlib. No dependencies, no network, no transcript parsing, no proxy. ~25ms per render.


Why this exists

Building anything large with Claude means long sessions, and the session grows underneath you whilst you work. Nothing shows you how big it has got, so the first sign is usually the limit itself - context exhausted, or the rolling usage window gone, mid-task. The stronger the model the sooner that bites; Fable on a big codebase will find the ceiling well before you expect it to.

This puts the size on screen whilst you work: how much context the session is carrying, what the next turn costs before you type a word, and how much of the 5h and 7d windows is left. Enough to clear at a sensible boundary instead of discovering the limit halfway through a refactor.

Sessions get far bigger than they feel. I measured two weeks of my own Claude Code usage - 916 transcripts, 711 sessions, 57,451 API requests, 11.6 billion tokens - and the sizes were not what I expected.

How big sessions actually get
Median context at the start of a session42.8k
Median growth per turn~1.7k
Average context carried per request193.3k
Sessions that ran past 150k context37%
Accumulated context re-read across the sample11.1B tokens
Context I actually typed1.3M tokens

Everything I typed across 711 sessions was 1.3M tokens. The same sample re-read 11.1 billion tokens of context it was already carrying. Shorter prompts are not the lever; session size is.

The reason is that the API is stateless. Every turn re-sends the entire conversation - system prompt, instructions, and all prior turns - so what goes on the wire grows with every message, whether you typed a paragraph or "yes".

Why it compounds

Because turn N re-sends turns 1..N-1, the context a session moves grows with roughly the square of its length. Taking the medians above (42.8k start, 1.7k a turn):

Same 160 turns of workContext movedEnds at
One 160-turn session28.6M tokens~315k
Four 40-turn sessions12.3M tokens~111k each

Less than half the context, for identical work - and no run gets near the ceiling. The distribution agrees: the top 10% of sessions accounted for 71% of every token moved.

The problem is that none of this is visible while you work, and unlike running out of context window, it never self-limits. A session can sit at 480k for two hundred turns, never trigger a compaction, and quietly burn millions of tokens.

That is the gap this fills.


Install

git clone <this repo> ClaudeStatsBar && cd ClaudeStatsBar
./install.sh

The installer merges a statusLine entry into ~/.claude/settings.json, backing the file up first and refusing to clobber an existing status line.

Open a new session, or run /hooks once to reload config.

Manual

// ~/.claude/settings.json
{
  "statusLine": {
    "type": "command",
    "command": "/absolute/path/to/ClaudeStatsBar/statsbar.py",
    "padding": 0
  }
}

Windows: "command": "python C:\\path\\to\\ClaudeStatsBar\\statsbar.py" (the shebang and ~ expansion are POSIX-only).

Uninstall: delete the statusLine key.


Reading the bar

FieldMeaning
Opus 5 (1M context)Model. The window size changes what the bar means.
my-projectCurrent directory.
▕██████░░░░░░▏Context window used - how much room is left.
486kTokens re-sent on every turn. Green under 60k, amber to 120k, red above.
49k/turnWhat that re-send costs each turn, before you type a character. Context x 0.1, the cache-read rate.
7.0×How much more a message costs now than at this session's cheapest point. Hidden if the bar started mid-session and never saw the real baseline.
88tAPI requests this session.
5h 15% ~162t leftShare of the 5-hour limit used, and turns of headroom at this session's measured burn rate. Red under 15 turns.
7d 3%Share of the weekly limit.

A second warning line appears past 120k of context, or past 80% of the window.

49k/turn is rent, not growth

A common misreading. The session grows by roughly 1.7k tokens a turn. The 49k is what you pay to put the existing 486k in front of the model again.

TurnSentAddedBilled
49478k1.7k47.8k
50480k1.7k48.0k
51482k1.7k48.2k

The consequence is counterintuitive: a one-word reply costs the same as a complex request. "Just one more quick thing" at the end of a long session is the worst-value message you can send.


What to do about it

Ranked by measured impact:

  1. /clear between unrelated tasks - roughly 35%. The whole game, and free.
  2. Fewer turns - roughly 20%. Each round-trip costs a full context sweep regardless of content. Batch tool calls; don't re-read files.
  3. Trim always-loaded instruction files - roughly 2%. Worth doing, not worth agonising over. In my sample only ~8.7k of a 42.8k session baseline was user-controlled; the rest is the harness.
  4. Lower reasoning effort - roughly 2%. Output is only 9.9% of spend.

Configuration

VariableDefaultEffect
CC_CTX_WARN60000Amber threshold (tokens).
CC_CTX_HIGH120000Red threshold, and the warning line.
CC_CTX_FULL_PCT80Window-full percentage that switches the advice to /compact.
CC_SHOW_COSTunsetShow the dollar estimate. Off by default: on a Claude subscription it is a client-side figure at API list price, not money anyone pays. Useful on an API key.
NO_COLORunsetDisable ANSI colour.

Notes and limitations

  • Weights are a proxy. Costs use API list-price ratios (input 1x, cache write 1.25x, cache read 0.1x, output 5x). The shape is right; treat 49k/turn as an index, not a bill. The rate-limit percentages are Anthropic's own figures and need no such caveat.
  • The multiplier needs a real baseline. It compares against the smallest context observed. Installed mid-session, it never saw the start, so it suppresses the ratio rather than printing a reassuring 1.0×.
  • The burn projection needs five samples before it extrapolates, and re-baselines when the rolling 5-hour window resets.
  • State lives in ~/.claude/.statusline-state/<session_id>.json: the minimum context seen and the rate-limit baseline. Pruned after a week.
  • It never breaks your session. Any exception prints an empty line and exits 0.
  • Requires Claude Code 2.1.251+ for prompt_cache, 2.1.260+ for last_miss_cause. Older versions degrade gracefully - those fields simply do not render.

About

Developed by Field Logic.

The numbers throughout this README come from instrumenting our own daily Claude Code use rather than from estimates - 916 transcripts and 11.6 billion tokens over two weeks. If you find the figures differ materially on your workload, we would like to hear about it.

Licence

MIT - see LICENSE.

Contributors

djf73

4 commits

Languages

Python

77.6%

Shell

22.4%