token-usage: token usage, prompt cache, cost and rate limits for Claude Code
token-usage is a plugin for Claude Code. It draws a band above the prompt that shows the token usage of your whole session. The band shows the prompt cache reads and writes with the cache hit rate, the session cost, and your 5-hour and weekly rate limits. It counts the main loop and every subagent.

Quick Start
Run one command. It adds the marketplace and installs the plugin:
curl -fsSL https://raw.githubusercontent.com/ejklock/claude-usage-mod/main/scripts/install.sh | bash
To use the band in Brazilian Portuguese (pt-BR), pass the locale:
curl -fsSL https://raw.githubusercontent.com/ejklock/claude-usage-mod/main/scripts/install.sh | bash -s -- --locale pt-BR
The script also accepts --scope user|project|local (default: user) and --help.
You can also install from inside Claude Code. Type this at the prompt:
/plugin install token-usage --marketplace ejklock/claude-usage-mod
Claude Code asks Add marketplace?. Answer y. Then choose a scope with Enter. The first scope is user.
Or run the two claude plugin commands yourself:
claude plugin marketplace add ejklock/claude-usage-mod
claude plugin install token-usage@token-usage
Start a new Claude Code session after the install to see the band.
What it shows
The band adapts to the width of the terminal.

On a wide terminal (100 columns or more) the band fills the full width in two columns. Session usage is on the left. Your rate-limit windows are on the right and follow the left column with exactly 4 spaces, at any width. They are laid out as a table: the labels, the bars, the percents, the forecasts and the countdowns line up, so every bar starts and ends at the same column and the lines are padded to the right edge:
◔ ctx ■□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ 4% ◷ 5h ■┃■■□□□□□□□□□□□ 24% ↯ 2h 16m ↺ 4h 17m
↻ cache R 56.6k · W 15.5k · ◎ 79% $0.14 ◷ 7d ■■■■■┃■■■■□□□□□ 69% ↯ 1d 4h ↺ 4d 8h
Under 100 columns the band stacks: line 1 is session usage and line 2 is the rate limits, with each part separated by a thin bar. The bars are 6 cells wide down to 80 columns. Under 80 columns the bars are dropped, the icons stay, and the parts that do not fit are left out. A line never goes past the width of the terminal.
Session usage:
◔ ctx is how full the context window is. It shows ◔ ctx — until the first measure arrives.
↻ cache R … W … ◎ … is the prompt cache. R is tokens read from the cache. W is tokens written to the cache. ◎ is the cache hit rate. Token counts use k for thousands and M for millions.
- The next part is the session cost in US dollars.
- The last part is the email of the signed-in account, shown only when the
account option is masked or full (see Configuration). It follows the cost, after 2 spaces, in a soft blue-gray. It appears after your first message, because Claude Code hands the email over only then. On a wide terminal it ends the cache line, and it is left out, with the two columns kept, when it does not fit. When the band stacks it ends line 1 and is the first part left out.
Rate limits. They show only when your plan reports them. Without them the band shows the left column only:
◷ 5h is the 5-hour window. ◷ 7d is the weekly window. Any other window kind follows on its own line.
- Each window shows a bar, the percent used, and
↺ with the time left until the window resets, as a countdown: 1d 17h, 4h 17m, 12m or <1m. The same text is used in English and in Brazilian Portuguese. A window with no reset time shows no countdown.
- The
┃ on a bar of the 5-hour or weekly window marks how much of the window has passed. It replaces one cell and the bar keeps its length. The spend limit of a gateway has no known length, so it has no marker.
↯ in red is a warning. It shows the time left until the limit, when your pace so far in this window would reach the limit before the window resets. It sits between the percent and the countdown, and the column is left out when no window has a warning.
The bars use ■ for the used part and □ for the rest. With the show option set to left, they use ■ for the part still free. A reading above 0 always shows at least one ■. On a wide terminal each bar fills its column after the text around it, from 8 up to 60 cells; the context bar stops at 60, and the window bars may grow into the room that frees. If the parts do not fit the two columns, the band stacks.
How the colors work: