ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 redzrush101

context-meter

为 Claude Code 添加提示符上方的状态栏,显示接近自动压缩的上下文占用、提示缓存过期倒计时、带重置时间的 5 小时/每周用量上限,以及冷会话恢复保护。

redzrush101@redzrush101

redzrush101/claude-mods/tree/main/plugins/context-meter

已翻译

关于这个 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.

其他同名作品

更多类似作品