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

context-bar

一个 Claude Code 外挂,在提示列上方显示实时上下文窗口用量条,按 /context 类别拆分,并显示速率限制、自动压缩前剩余 token 和工作阶段长度。

Akash001uts@Akash001uts

Akash001uts/claude-mods/tree/main/plugins/context-bar

已翻译

关于这个 mod

context-bar 会在提示列上方放置堆叠用量条,显示上下文窗口有多满,并按 /context 报告的相同类别拆分(系统提示、工具、记忆文件、消息等)。它在每个工作阶段开始时启用,并在每个回合后刷新。第二行显示订阅账户的 5 小时和 7 天速率限制、自动压缩前剩余的 token,以及工作阶段运行时间;空间不足时会隐藏。/context-bar 命令按工作阶段切换用量条,/context-bar details 打开完整拆分的面板:每个类别占窗口的比例、记忆文件、MCP 服务器与已载入工具、最大的 skills、自定义代理,以及上次 API 调用的缓存拆分。它只读取 Claude Code 的用量数字,不读取文件或消息,不向外发送任何内容,也不在磁盘上保存任何东西。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add Akash001uts/claude-mods
claude plugin install context-bar
原文 / README

context-bar

A bar above the prompt that shows how full your context window is, split into the same categories /context uses (system prompt, tools, memory files, messages and so on). I used to run /context every so often just to check how heavy a session was getting. Now it's always there, so I can wrap up before auto-compact kicks in, and I can spot what's eating my context, like MCP servers I forgot were still connected.

███████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒ 30% 60.0k/200.0k
■ System prompt 4.0k  ■ Messages 56.0k
5h 42% (resets in 2h 14m)  ·  7d 18%  ·  100.0k to compact  ·  session 2h 5m

How it works

  • It turns on at the start of every session and updates after each turn.
  • The third line shows your 5-hour and 7-day rate limits (subscription accounts only), how many tokens are left before auto-compact, and how long the session has been running. It hides itself if there isn't room for it.
  • /context-bar hides or shows the bar for the current session.
  • /context-bar details opens a pane with the full breakdown: each category and its share of the window, every memory file, MCP servers (and how many of their tools are loaded), your biggest skills, custom agents, and the cache split of the last API call. Press r to refresh it.

What it runs and stores

  • It only reads the session's usage numbers from Claude Code, the same ones /context shows. It doesn't read your files or messages, and it doesn't send anything anywhere.
  • The details pane asks Claude Code for the full token count, which costs a few extra requests (same as running /context). So it only refreshes while the pane is open, after each turn or when you press r.
  • Whether the bar is on is kept for the current session only. Nothing is written to disk.

Licence

MIT

其他同名作品

更多类似作品