MridulNegi2005/glyph-hud
glyph-hud
Dot-matrix HUD plugin for Claude Code showing chat tokens by model, cost, context fill, 5-hour limit estimates, cache timer and code stats, all locally with no model calls.
About this mod
Glyph HUD is a Claude Code plugin that displays the current chat's token usage in a monochrome dot-matrix pane inspired by Nothing devices. It makes no model calls and sends no data to any server, reading only local files and figures Claude Code already exposes.
The pane opens at session start (or via /glyph) and shows total chat tokens, cost, context fill, request count, token types (input, cache-write, cache-read, output), per-model token breakdown, estimated 5-hour usage limit cost of a cold-cache request, and code stats (tool calls, frequent tools, edits, files, changed lines, Bash errors, longest turn).
A status line under the prompt summarizes tokens, cost, cold-cache share of the 5-hour limit, and time until prompt-cache expiry (warm/cold indicators), plus draft size while typing.
Counting reads the session transcript and subagent transcripts, resetting the cache timer per request and estimating 5-hour limit consumption via weighted token types calibrated from usage percentage changes. Known limits are documented, including unpublished Anthropic weighting and interference from concurrent chats. A blockAttribution setting can deny git commits containing Co-Authored-By trailers.
Requires Claude Code 2.1.286+ and Python 3 on PATH for transcripts over 4 MB. Install via /plugin marketplace add MridulNegi2005/glyph-hud then /plugin install glyph-hud@glyph-hud, or load locally with claude --plugin-dir. Licensed MIT.
Installation
Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.
claude plugin marketplace add MridulNegi2005/glyph-hud claude plugin install glyph-hud
Original text / README
Glyph HUD
Glyph HUD is a plugin for Claude Code. It shows the token use of the current chat in a dot-matrix pane. The design follows the monochrome dot-matrix style of Nothing devices.
The plugin makes no model calls. It reads local files and the figures that Claude Code already has. It sends no data to any server.
<img src="docs/pane.png" alt="The Glyph pane in the Claude Code desktop app" width="320">What the plugin shows
The pane
The pane opens at the start of each session. The /glyph command opens it again.
- Chat tokens. The total tokens of the current chat, in large dot-matrix digits.
- Cost and context. The cost in US dollars, the context fill as a percentage, and the number of requests.
- Token types. Input, cache-write, cache-read and output tokens.
- Tokens by model. One row for each model in the chat. Each row shows the total, the share as a dot bar, and the four token types.
- Cold cache call. The estimated part of the 5-hour usage limit that one request with a cold cache uses.
- Code stats. Tool calls, the most frequent tools, edits, files, changed lines, Bash errors and the longest turn.
The status line
The status line under the prompt shows a short summary:
◉ 5.14M tok · $2.95 · cold ≈ 3.1% of 5h · cache 52:10
cache 52:10is the time until the prompt cache expires. The valuecache ● warmshows during a turn. The valuecache ○ coldshows after the cache expires.- While you type a message, the line starts with
✎. It shows the approximate size of the draft and the estimated part of the 5-hour limit that the message uses.
In the terminal
The desktop app shows the pane as an image. The terminal shows the same data as text, with ● and · characters for the dots.
- In the fullscreen layout, the pane opens beside the transcript at the start of a session. The terminal must be 144 columns or wider.
- In a narrower terminal, use the
/glyphcommand to open the pane. - The status line is the same in the terminal and in the desktop app.
How the plugin counts
Chat tokens
The plugin reads the transcript file of the chat and the transcript files of its subagents. Each response row records the model and the token use. The plugin counts each response one time.
The count includes the full chat, also the part before the plugin loaded. Requests that the transcript does not record are not in the count. An example is a compaction summary.
The cache timer
Each request resets the lifetime of the prompt cache. The plugin reads the time of the last response and the cache lifetime from the transcript. The lifetime is 1 hour or 5 minutes.
The 5-hour limit estimate
After each response, the plugin reads the 5-hour usage percentage. It uses only changes between two responses less than 90 seconds apart. This step keeps the effect of other chats small.
The plugin sets a weight for each token type:
| Token type | Weight | |---|---| | Input | 1 | | Output | 5 | | Cache read | 0.1 | | Cache write, 1-hour lifetime | 2 | | Cache write, 5-minute lifetime | 1.25 |
The plugin divides the change in percentage by the weighted tokens of the last 60 requests. A request with a cold cache writes the full context again. The estimate is this rate multiplied by the context size and the cache-write weight.
The estimate shows "calibrating" until the percentage has moved by 0.3 points.
The pane also shows the last cold request: the percentage before and after the request, and the age of the "before" reading. Other chats can change the percentage during that time.
Limits of the estimates
- Anthropic does not publish how each token type counts against the usage limit. The weights come from the API prices.
- The plugin gives all models the same weight.
- Other chats that run at the same time can make the estimate too high.
- The draft size uses about 4 characters for each token. It is not an exact count.
Settings
| Setting | Default | Effect |
|---|---|---|
| blockAttribution | false | Denies git commit commands that contain a Co-Authored-By trailer. |
Change the setting in the /config menu.
Requirements
- Claude Code 2.1.286 or newer. The plugin API is early access. A later release can change it.
- Python 3 on the
PATHfor transcripts larger than 4 MB. The plugin reads smaller transcripts without Python.
Install
-
Add the marketplace in Claude Code:
/plugin marketplace add MridulNegi2005/glyph-hud -
Install the plugin:
/plugin install glyph-hud@glyph-hud
To load the plugin from a local folder, start Claude Code with this flag:
claude --plugin-dir path/to/glyph-hud
License
MIT. See LICENSE.
