ClaudeCodeMod

All shelves / Mods / Usage

context-bar

By hamzafer

context-bar is a Claude Code usage mod by hamzafer.

Draws the context window as one stacked bar, a color per category, with token counts and the compaction point.

Draws

Install

The marketplace name is claude-code-mods.

In your shell
claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install context-bar@claude-code-mods
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.1.3
License
MIT
Repo stars
381
Last change
2026-10-15

What it can reach

  • Draws in the session
  • Reads usage or context figures

Claude Code 2.1.287 or later. The author says to restart after installing. One bar the width of the band splits the window by what fills it: system prompt, tools, MCP tools, memory files, skills, and messages, then free space and the compaction buffer. Each used category has its own color, messages in orange. The header shows the tokens in use, the window, where auto-compaction runs, and the percent, which turns yellow at 70% of the compaction point and red at 90%. The legend lists each category's tokens and share of the window. It refreshes after each of the main agent's turns and after a compaction, from the same breakdown /context draws, estimated locally with no extra API calls. Tool schemas loaded on demand are left out, as /context leaves them out. /context-bar shows or hides the bar, and the choice is kept across sessions. Its line stacks with the other hamzafer lines.

The marketplace, claude-code-mods, holds all of hamzafer's mods. This one installs on its own, or from the checklist that npx claude-code-mods@latest opens. The author pairs it with his token-weather, which tracks the trend and the cache while this one shows what the tokens are. The context window is why this page files it under usage. usage-header-szotasz draws the context window above the prompt with a color per category, and the 5-hour and weekly limits under it. context-lens, by Arunjay4213, pins how full the window is and what the last turn added, and /context-lens opens the breakdown by category. This one is one stacked bar, with the compaction point marked.

Demo

Context window drawn as one stacked bar, a color per category
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • turn.completeWhen a turn ends
  • session.compactWhen the context is compacted
  • command.runWhen you run its slash command/context-bar
  • ui.renderDraws into the sessionAbovePrompt

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /context-barShow or hide the context window bar above the prompt

Files

The author's source, 3 files. They load when you open them.

Facts

Author
hamzafer
Category
Usage
Marketplace
claude-code-mods
Repo
hamzafer/claude-code-mods
Folder
mods/context-bar
Version
0.1.3
License
MIT
Repo stars
381
Last change
2026-10-15
Language
TypeScript
Files
8

Other mods in Usage

token-weatherAnthropicDraws a one-line forecast of the context window above the prompt. Fuller goes from clear toward a storm.token-weatherhamzaferDraws the context-window forecast above the prompt, plus how long the prompt cache has left.cache-clockhamzaferDraws a prompt-cache line under the status line: time left while warm, hits and misses, and how many tokens the next message re-caches once it goes cold.openai-balancehamzaferDraws your OpenAI API credit above the prompt: an estimated balance, today's spend, where the money went, and the last call.cost-meterSingh-APHolds a commandDraws session cost, context fill, and the 5-hour and 7-day windows on the status line, plus each turn's cost. An optional budget asks before the next tool call.session-meterarasovicDraws a pane of context by category, the 5-hour and 7-day windows and their pace, and the last 30 tool calls and model requests.cache-timerarasovicDraws a countdown above the prompt until the prompt cache expires, then how many tokens the next message writes again.turn-footerarasovicDraws tool calls, subagents, requests, tokens, and cache hit rate under each answer, and the running tool in the spinner.search-meterarasovicDraws a status line for the model's searches: green found on the first try, yellow found after misses, red found nothing.statusline-anywhereNathanABDraws the status line you already configured, in color, above the prompt in Claude Desktop. In a terminal it stays out of the way.statuspanexuanji86Draws a card above the prompt: model, context gauge, 5-hour and 7-day limits, directory, branch, and session cost. Press the gauge and confirm to run /compact.cache-taxkaranb192Keeps the one-hour prompt cache warm while you step away, and stops a send into a cold cache once with the estimated rewrite cost.
All 183 in Usage