redzrush101/claude-mods/tree/main/plugins/context-meter
context-meter
為 Claude Code 加入提示列上方的狀態列,顯示接近自動壓縮的上下文用量、提示快取到期倒數、附重設時間的 5 小時/每週用量上限,以及冷工作階段的恢復防護。
關於這個 mod
提示列上方會顯示一條狀態列:
context ???????????? 19% 185k/967k 繚 cache 59m 繚 usage 5h 23% ??14:40 繚 week 41% ??Thu 09:00
- context:相對於自動壓縮點的填充量;75% 起變黃,90% 起變紅。剩餘次數少於 30 時,會顯示壓縮前還能進行幾次。
- cache:提示快取距離到期的時間,從上一次請求開始計算;到期前 5 分鐘會顯示通知,之後顯示
cold 繚 next message re-reads ?圳。命中率降到 80% 以下時才會顯示。 - usage:5 小時與每週用量上限,以及重設時間;達到 80% 和 95% 時顯示通知。
- resume guard:恢復快取已到期的工作階段時,顯示快取大小、閒置時間與預估重新快取成本,並提供 Compact 和 Dismiss 按鈕;當上下文超過 50k 時,只攔住第一則訊息一次(再次傳送即可繼續)。
它不會自行發出 API 請求:每個數字都來自 Claude Code 已經擁有的資料。
選項(/plugin configure context-meter@claude-mods):cacheTtlMinutes(預設 60;1 小時提示快取使用 60,5 分鐘提示快取使用 5)和 resumeGuard(預設 true;冷恢復後攔住第一則訊息)。
安裝:
claude plugin marketplace add redzrush101/claude-mods
claude plugin install context-meter@claude-mods
測試:claude plugin test plugins/context-meter。
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add redzrush101/claude-mods claude plugin install context-meter
原文 / README
claude-mods
Claude Code mods (plugins of function hooks).
claude plugin marketplace add redzrush101/claude-mods
claude plugin install context-meter@claude-mods
Or inside Claude Code: /plugin marketplace add redzrush101/claude-mods.
context-meter
A band above the prompt:
context ━━────────── 19% 185k/967k · cache 59m · usage 5h 23% ↻ 14:40 · week 41% ↻ Thu 09:00
- context: fill against the auto-compact point; yellow from 75%, red from 90%. Turns left before compaction appear when fewer than 30 remain.
- cache: time until the prompt cache expires, counted from the last request;
a toast 5 minutes before, and
cold · next message re-reads …after. The hit rate appears when it drops below 80%. - usage: the 5-hour and weekly limits with reset times; toasts at 80% and 95%.
- resume guard: resuming a session whose cache expired shows its size, idle time and estimated re-cache cost, with Compact and Dismiss buttons, and holds the first message once when the context is over 50k (send again to go ahead).
It makes no API requests of its own: every figure is one Claude Code already has.
Options (/plugin configure context-meter@claude-mods):
| Option | Default | |
| --- | --- | --- |
| cacheTtlMinutes | 60 | 60 for the 1-hour prompt cache, 5 for the 5-minute one |
| resumeGuard | true | hold the first message after a cold resume |
Tests: claude plugin test plugins/context-meter.
其他同名作品
- context-metercjavdev · ★ 1
- context-meterVibe-Commit · ★ 0
- context-meterbaselane-sh · ★ 0
- context-meterlucenity0 · ★ 0
- context-metercleverfakealias · ★ 0
