ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 MridulNegi2005

glyph-hud

Claude Code에서 모델별 채팅 토큰, 비용, 컨텍스트 채움 정도, 5시간 제한 추정치, 캐시 타이머와 코드 통계를 점 행렬 HUD로 보여 주는 플러그인입니다. 모든 처리는 로컬에서 하며 모델을 호출하지 않습니다.

번역 완료

이 mod 소개

Glyph HUD는 Nothing 기기에서 영감을 받은 단색 점 행렬 패널에 현재 채팅의 토큰 사용량을 표시하는 Claude Code 플러그인입니다. 모델을 호출하지 않고 어떤 서버에도 데이터를 보내지 않으며, Claude Code가 이미 공개하는 로컬 파일과 수치만 읽습니다.

패널은 세션이 시작될 때 열리고(/glyph로도 열 수 있음), 전체 채팅 토큰, 비용, 컨텍스트 채움 정도, 요청 수, 토큰 유형(입력, 캐시 쓰기, 캐시 읽기, 출력), 모델별 토큰 내역, 콜드 캐시 요청이 5시간 사용량 제한에서 차지하는 예상 비용, 코드 통계(도구 호출, 자주 쓰는 도구, 편집, 파일, 변경된 줄, Bash 오류, 가장 긴 턴)를 보여 줍니다.

프롬프트 아래의 상태 줄에는 토큰, 비용, 5시간 제한 중 콜드 캐시 비율, 프롬프트 캐시 만료까지 남은 시간(웜/콜드 표시)을 요약하고, 입력 중에는 초안 크기도 표시합니다.

카운터는 세션 기록과 하위 에이전트 기록을 읽고 요청마다 캐시 타이머를 재설정합니다. 사용량 백분율 변화로 보정한 토큰 유형별 가중치를 사용해 5시간 제한 소비량을 추정합니다. 공개되지 않은 Anthropic 가중치와 동시 채팅의 간섭을 비롯한 알려진 제한도 문서화되어 있습니다. blockAttribution 설정을 사용하면 Co-Authored-By trailer가 포함된 git 커밋을 거부할 수 있습니다.

Claude Code 2.1.286+가 필요하며, 4 MB를 넘는 기록을 처리하려면 PATH에 Python 3도 있어야 합니다. /plugin marketplace add MridulNegi2005/glyph-hud를 실행한 다음 /plugin install glyph-hud@glyph-hud로 설치하거나 claude --plugin-dir로 로컬에서 불러올 수 있습니다. MIT 라이선스입니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add MridulNegi2005/glyph-hud
claude plugin install glyph-hud
원문 / 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:10 is the time until the prompt cache expires. The value cache ● warm shows during a turn. The value cache ○ cold shows 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 /glyph command 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 PATH for transcripts larger than 4 MB. The plugin reads smaller transcripts without Python.

Install

  1. Add the marketplace in Claude Code:

    /plugin marketplace add MridulNegi2005/glyph-hud
    
  2. 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.

비슷한 프로젝트