VibeMage/claude-mod-glance
glance
Claude Code 提示列下方的 HUD:一眼查看模型、git、成本、內容視窗和速率限制列、工具、skill、MCP、代理與 todos。
關於這個 mod
English | 繁體中文
glance
這是寫成 Claude Code mod 的 Claude Code 提示列下 HUD。一眼可以看到模型、分支、工作階段成本、內容視窗使用量、5 小時與 7 天限制,以及 Claude 目前執行的內容。
❯ █
◆ Opus 5.5 · main ↑1 ●3 $2.63 · ⏱ 16m
ctx █░░░░░░░░░ 14% · 145k/1M 5h █░░░░░░░░░ 8% · 2h21m 7d ░░░░░░░░░░ 2% · 6d21h
◐ Bash npm test ✓ Read×12 Edit×3 Bash×5
✦ plugin-authoring · simplify ⧉ Notion×2 Gmail×1
⚙ Explore find the config 2 agents
▸ 3/7 Writing the README
? for shortcuts
需要 Claude Code 2.1.289 或更新版本。 Mods 是可能隨版本變更的早期 API。如果更新後 glance 停止繪製,請開啟 issue。
Install
在 Claude Code 中:
/plugin marketplace add VibeMage/claude-mod-glance
/plugin install glance@claude-mod-glance
也能從 shell 安裝:
claude plugin marketplace add VibeMage/claude-mod-glance
claude plugin install glance@claude-mod-glance
開始新的工作階段或執行 /reload-plugins 後,glance 會出現在提示列下方。它可以和 claude-hud 這類 statusLine 並用;如果從一個切換到另一個,請從 ~/.claude/settings.json 移除 statusLine,避免數字顯示兩次。
What it shows
Header 顯示模型(claude-opus-5-5 和 Opus 5.5)、git 分支、ahead/behind、變更檔案、工作階段成本和持續時間。Bars 顯示已用 token 的內容視窗填充量及 5h、7d 速率視窗,並在警告門檻變紅。Tools 顯示目前工具和最常用工具。Skills and MCP 顯示本工作階段載入的 skill 與 MCP 呼叫。Agents 顯示執行中的代理和已啟動數量。Todos 顯示 TodoWrite 或 Task 工具的進度。
載入 glance 時會讀取轉錄,因此載入前使用過的工具、MCP server、skill 和 todo 也會計數。成本是 /cost 回報的 API 列表價估算;Pro 或 Max 訂閱的實際帳單不同。
What it runs and reads
glance 是單一 TypeScript 模組 hooks/register.tsx,在 mod sandbox 中執行。沒有相依專案,不下載內容,也不建立網路連線。
- Runs:在工作階段開始、每回合後和每 30 秒執行 git status --porcelain=v2 --branch,讀取分支、ahead/behind 與變更檔案數。
- Reads:透過 mod API 讀取模型、內容視窗、速率視窗、成本、轉錄中的工具名稱與輸入,以及 theme 設定。
- Observes:觀察 tool.call 和 skill.prompt,只記錄名稱與短標籤;呼叫會原樣通過,不阻止或改寫。
- Keeps:只把資料保存在工作階段 mod 狀態,不寫入檔案,也不跨工作階段儲存。
- Sends:不向外傳送任何內容,不對 git 傳入固定引數之外的輸入。
隱私說明見 Privacy: PRIVACY.md。
Configure
執行 /plugin configure glance@claude-mod-glance,或開啟 /config。palette 支援 auto、catppuccin、mocha、macchiato、frappe、latte;barWidth 預設 10,warnAt 預設 85。showGit、showCost、showDuration、showTools、showSkills、showAgents、showTodos 和 keepHint 預設都為 true。keepHint 會保留 Claude Code 自己的提示列(? for shortcuts、esc to interrupt)。
Known limitations
glance 會取代提示列下的 hint line 並以暗色文字重繪,因此會失去原本的顏色。用 keepHint: false 關閉。以 /name 呼叫的 skill 不會出現在轉錄工具呼叫中,只有 glance 已載入時才會計數。訂閱使用者在工作階段首次回報限制後才會看到速率列。
Develop
git clone https://github.com/VibeMage/claude-mod-glance
cd claude-mod-glance
claude --plugin-dir .
claude plugin validate .
claude plugin test .
引擎第一次載入 mod 時,會將 API 型別寫入 .claude-plugin/types/ 並產生 tsconfig.json;tsc -p . 隨後可以做型別檢查。兩者都依賴建置版本並被 git 忽略。
License
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add VibeMage/claude-mod-glance claude plugin install glance
原文 / README
English | 简体中文
glance
A HUD under your Claude Code prompt, written as a Claude Code mod. One look tells you the model, the branch, what the session has cost, how full the context is, where your 5-hour and 7-day limits stand, and what Claude is running right now.
❯ █
◆ Opus 5.5 · main ↑1 ●3 $2.63 · ⏱ 16m
ctx █░░░░░░░░░ 14% · 145k/1M 5h █░░░░░░░░░ 8% · 2h21m 7d ░░░░░░░░░░ 2% · 6d21h
◐ Bash npm test ✓ Read×12 Edit×3 Bash×5
✦ plugin-authoring · simplify ⧉ Notion×2 Gmail×1
⚙ Explore find the config 2 agents
▸ 3/7 Writing the README
? for shortcuts
Requires Claude Code 2.1.289 or newer. Mods are an early-access API that may change between releases. If glance stops drawing after an update, please open an issue.
Install
In Claude Code:
/plugin marketplace add VibeMage/claude-mod-glance
/plugin install glance@claude-mod-glance
Or from a shell:
claude plugin marketplace add VibeMage/claude-mod-glance
claude plugin install glance@claude-mod-glance
Start a new session (or run /reload-plugins) and glance appears under the prompt.
glance runs alongside a statusLine such as claude-hud. If you are switching from one, remove statusLine from ~/.claude/settings.json so you do not see the same figures twice.
What it shows
| Row | Contents | Source |
| --- | --- | --- |
| Header | Model (claude-opus-5-5 → Opus 5.5), git branch, ahead ↑ / behind ↓, changed files ●, session cost, session duration | $.session.model(), git status --porcelain=v2, $.session.usage() |
| Bars | Context fill with tokens used, then each rate-limit window (5h, 7d) with the time until it resets. Each bar has its own colour and turns red at the warning threshold | $.session.usage(), refreshed on session.measure |
| Tools | Tools running now (◐) and the session's most-used tools | tool.call |
| Skills and MCP | Skills loaded this session, latest first (✦); MCP calls running now (◐) and calls per server (⧉) | skill.prompt, tool.call |
| Agents | Subagents running (⚙) and how many the session has started | tool.call on Agent |
| Todos | Progress and the item in progress, from TodoWrite or the Task tools | tool.call |
When glance loads (a new session, --resume, or installing it mid-session), it reads the transcript, so the tools, MCP servers, skills and todos used before it loaded are counted too.
The cost is what /cost reports: an estimate at API list prices. On a Pro or Max subscription it is not what you are billed.
What glance runs and reads
glance is a single TypeScript module (hooks/register.tsx) that Claude Code runs in its mod sandbox. It has no dependencies, downloads nothing and opens no network connections. Everything it reads stays on your machine.
- Runs one program,
git, asgit status --porcelain=v2 --branchin the session's working directory, when the session starts, after each turn and every 30 seconds, for the branch, ahead/behind and changed-file count. - Reads, through the mod API: the session's model, context fill, rate-limit windows and cost (
$.session.usage()), the session's transcript ($.session.messages(), only the names and inputs of tool calls, to count tools, MCP servers, skills and todos), and your Claude Codethemesetting ($.settings.read(), to pick light or dark colours). - Observes tool calls (
tool.call) and skill loads (skill.prompt) as they happen, to note the tool's name and a short label and the skill's name. Every call and every skill prompt passes through unchanged; glance never blocks, rewrites or adds to them. - Keeps its figures in the session's mod state only. It writes no files and stores nothing across sessions.
- Sends nothing anywhere: it makes no network calls and passes no data to
git, whose only input is the fixed argument list above.
Privacy: PRIVACY.md.
Configure
Run /plugin configure glance@claude-mod-glance, or open /config and find the glance rows. Changes apply immediately.
| Option | Default | What it does |
| --- | --- | --- |
| palette | auto | auto: Cupertino (iOS system colours), light or dark following your Claude Code theme. catppuccin: Latte or Mocha, chosen the same way. mocha, macchiato, frappe, latte: always that Catppuccin flavor |
| barWidth | 10 | Cells in each bar (4–30) |
| warnAt | 85 | Percentage at which a bar and its figure turn red |
| showGit | true | Branch, ahead/behind, changed files |
| showCost | true | Session cost |
| showDuration | true | Session duration |
| showTools | true | Tools row |
| showSkills | true | Skills and MCP row |
| showAgents | true | Agents row |
| showTodos | true | Todos row |
| keepHint | true | Keep Claude Code's own hint line (? for shortcuts, esc to interrupt) under the HUD |
Known limitations
- glance draws in place of the hint line under the prompt and redraws that hint as plain dim text, so the hint's own colours (for example the
auto mode onpill) are lost. Turn the line off withkeepHint: false. - A skill you invoke as
/nameis not in the transcript's tool calls, so it is only counted if glance was already loaded when you ran it. - Rate-limit bars appear only on a subscription, after the first response of the session reports them.
Develop
git clone https://github.com/VibeMage/claude-mod-glance
cd claude-mod-glance
claude --plugin-dir . # load it for one session; saving a file reloads it
claude plugin validate . # what the engine would refuse
claude plugin test . # tests/*.test.ts against the engine
The engine writes the API's types to .claude-plugin/types/ the first time it loads the mod, along with a tsconfig.json, so tsc -p . type-checks it. Both are build-specific and git-ignored.

