omeraltinova/claude-usage-footer/tree/main/plugins/usage-footer
usage-footer
Claude Code 外掛,在提示列下方的頁尾顯示提示快取倒數與 5 小時、每週限制視窗的 API 等值費用,並提供可點擊的依模型權杖與費用明細卡片。
關於這個 mod
usage-footer 是一個 Claude Code 外掛,會把使用資訊放在提示列下方的模型名稱旁邊。頁尾顯示提示快取倒數(顏色從綠色漸變到紅色),以及目前 5 小時與每週限制視窗內請求依 API 公開價格計算的費用,並按使用速度上色(如果限制會在重設前填滿則為紅色,達到 85–100% 為黃色,否則為綠色)。點擊 ▾ 或執行 /usage-footer,會在提示列上方開啟卡片;每個視窗包含:依目前速度何時填滿限制或在哪裡結束、總費用、快取命中率,以及按模型列出請求、輸入、快取讀取、快取寫入、輸出、命中率與費用。
它使用你帳號自己的視窗(從回報的重設時間前一個視窗長度開始)。費用取自 ~/.claude/projects 的本機工作階段記錄計算,包含子代理與這台電腦上的所有工作階段;依請求去重,並以 API 公開價格計價(不是訂閱費用)。一個小型 Node.js 腳本會在每個回合結束時與每 5 分鐘增量掃描記錄,只需數十毫秒,模型的請求串流中不會執行任何內容。
需求:Claude Code v2.1.287 或更新版本(終端機或 Desktop Code 分頁),以及在 macOS、Linux 與 Windows 的 PATH 或標準安裝位置中可取得的 Node.js。
安裝: claude plugin marketplace add omeraltinova/claude-usage-footer claude plugin install usage-footer@claude-usage-footer
接著開始新的工作階段或執行 /reload-plugins。採用 MIT 授權。
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add omeraltinova/claude-usage-footer claude plugin install usage-footer
原文 / README
usage-footer
A Claude Code mod that puts your usage where you look anyway: beside the model name under the prompt.
▾ ◷42 — 5h $82 — 7d $115
- ◷42: minutes left before this session's prompt cache expires. Green while fresh, sliding through yellow to red as it runs out.
- 5h $82: what the requests in your current 5-hour limit window would cost at API list prices.
- 7d $115: the same for your current weekly limit window. While the session runs Fable, this slot shows Fable's own weekly window (
F $…).
The 5h and 7d values are colored by pace: red if, at the pace so far, the limit fills before the window resets; yellow if it ends the window at 85–100%; green otherwise.
Click ▾ (or run /usage-footer) for a card above the prompt with, per window:
- when the limit fills at the current pace, or where it ends the window
- the total cost and the cache hit rate
- one row per model: requests, input, cache read, cache write, output, hit rate, cost
How it works
- The windows are your account's own: each starts its length (5 hours, 7 days) before the reset time Claude Code reports for that limit, not a rolling "last 5 hours".
- Costs come from your local transcripts (
~/.claude/projects, including subagents), across every session on this machine, deduplicated per request and priced at API list prices. It is not what a subscription charges. - A small Node.js script scans the transcripts incrementally at the end of each turn and every 5 minutes; a scan takes tens of milliseconds. Nothing runs inside the model's request stream.
Requirements
- Claude Code v2.1.287 or later (mods), in the terminal or the Code tab of the Desktop app.
- Node.js on the machine. The mod looks for
nodeon PATH, then in the usual install locations on macOS (Homebrew), Linux and Windows. - Works on macOS, Windows and Linux.
Install
claude plugin marketplace add omeraltinova/claude-usage-footer
claude plugin install usage-footer@claude-usage-footer
Then start a new session, or run /reload-plugins in an open one.
Notes
- Prices are built in (
plugins/usage-footer/scripts/usage-scan.mjs,PRICES) and need updating when Anthropic's prices change. - Usage on claude.ai (web, mobile) is not in the local transcripts, so it is not counted in the dollar figures; the limit percentages come from your account and do include it.
- The Desktop app cuts the footer at a fixed width, so the footer stays short; the card has the details.
License
MIT
