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

aitools

显示订阅用量、API 等价成本和提示框上方上下文栏

已翻译

关于这个 mod

aitools

提示框上方的一行栏会显示你的 Claude 订阅距离限制还有多远,以及按 Anthropic API 标价计算这次工作会花费多少。

AI Tools    5h 42% ·1h12m    wk 18% ·Thu    ctx 31% 62k/200k    cache 42m    thread $3.12 (+$0.41)    month $184.20    limit ~3:40pm   [🛠] [⁝]

| Segment | Meaning | |---|---| | AI Tools | 为这条栏命名的暗色标签 | | 5h 42% ·1h12m | 5 小时使用窗口:已用百分比,以及重置前的剩余时间 | | wk 18% ·Thu | 每周窗口:已用百分比,以及重置的日期(不足一天时显示小时) | | ctx 31% 62k/200k | 上下文窗口填充量:百分比,以及已用 token 数/窗口大小 | | cache 42m | 提示缓存应保持热状态的时间:Claude Code 会以 1 小时 TTL 写入主要对话的缓存,每次请求都会重新计时。低于 10 分钟时显示琥珀色,过期后显示 cache cold。这是根据请求时间得出的估算;API 不会报告缓存状态,Anthropic 也可能提前回收缓存 | | thread $3.12 | 本次工作阶段按 API 价格计算的成本 | | (+$0.41) | 上一轮的成本(工作阶段成本隐藏时显示为 last $0.41) | | month $184.20 | 本日历月这台机器上所有 Claude Code 工作阶段的 API 价格用量 | | limit ~3:40pm | 按你过去一小时的速度推算 5 小时窗口何时会用尽;只在重置前才显示 |

用量和上下文达到 70% 时变黄,达到 90% 时变红。尚未知道的值会显示 —;在工作阶段收到第一次回应前,栏会显示上一工作阶段的数字。

显示或隐藏栏

/aitools 会切换整条栏(包括按钮);/aitools on 和 /aitools off 可以直接设定。这个选择会跨工作阶段保留。/handoff 在两种状态下都能使用。

设置

按 ⁝ 打开栏上方的选项面板,每行五项,然后切换任意选项:AI Tools 标签、5 小时用量、每周用量、重置倒计时、上下文百分比、上下文 token、缓存热度、工作阶段成本、上一轮成本、月度成本、消耗速率预测、阈值颜色、阈值提醒、Tools 菜单。变更会立即显示在栏中,并跨工作阶段保存。再次按 ⁝ 关闭;打开它会关闭 🛠 菜单,反过来也一样。

当 5 小时或每周窗口超过 90%,以及上下文超过 80% 时,阈值提醒会各显示一次 toast。

交接

/handoff 会要求当前对话生成一份简要说明(目标、当前状态、决定、未完成任务、关键文件、下一步),以格式化文字打印在聊天中,并将原始 Markdown 复制到剪贴板。把它粘贴到新的工作阶段即可继续。简要说明是命令输出行,因此当前工作阶段的模型也会读到它。

🛠 按钮会在栏上方打开一行右对齐的选项:Handoff、Workflows、Task View、Clean View 和 Agent Dock;再次按下会关闭这行而不选择任何项目。Handoff 会把同一份简要说明写入 Handoff brief 面板,以格式化文字绘制,并提供 Copy 按钮;在你按下它之前不会复制任何内容,而且简要说明不会出现在聊天中(所以当前工作阶段的模型不会读到它)。Workflows 会在引擎所在的位置(终端)直接运行 Claude Code 内建的 /workflows;在桌面版 Code 标签中,输入 /workflows 后由界面自行回应,因此它会把 /workflows 放进提示框,等你按 Enter 发送。

Task View 和 Clean View

🛠 菜单中的两个视图会把 Claude 的工作变成栏下方的检查清单(打开的菜单仍会显示在清单上方):已完成步骤标为绿色 ✓,进行中的步骤标为蓝色 ●,尚未开始的步骤标为暗色 ○。菜单中 ● 表示当前开启的视图,○ 表示关闭的视图;再次选择已开启的视图会将其关闭,选择另一个则会切换过去。这个选择会跨工作阶段保留。

开启其中一个视图后,它的名称会显示在提示框下方的状态列中(面板打开时,名称后面会加上逗号和 Agent Dock)。从提示框输入 /taskview 和 /cleanview 的效果与菜单相同:不带参数会切换该视图(开启它时会关闭另一个),on 会开启,off 会关闭。

Adding dark mode                                                    3 of 5
✓ Read the theme code                                   100% ▰▰▰▰▰▰▰▰▰▰
✓ Add the color tokens                                  100% ▰▰▰▰▰▰▰▰▰▰
● Wire up the toggle                                     40% ▰▰▰▰▱▱▱▱▱▱
○ Update tests                                            0% ▱▱▱▱▱▱▱▱▱▱
○ Run checks                                              0% ▱▱▱▱▱▱▱▱▱▱

每个步骤都有一条进度栏:完成后填满,开始前保持空白;对于进行中的步骤,显示 Claude 自己估算的完成程度。每次 Claude 更新检查清单时,进度都会移动(提示会要求大约每完成四分之一步更新一次)。

  • Task View 显示检查清单,让聊天维持原样(只隐藏检查清单工具自己的输出行)。
  • Clean View 显示检查清单,并隐藏工作期间的每个工具调用以及 Claude 写出的所有内容;每个已完成请求只保留最后的回应。它也会隐藏聊天中已经存在的工具调用和进行中的回应。

视图开启时,你发送的每个提示都会带上一则隐藏说明,要求 Claude 用普通语言规划步骤,并通过外掛的 checklist 工具(mcp__aitools__checklist)回报步骤,且在每一步开始和完成时更新。外掛会在 Claude Code 的权限检查前自行回应这个工具,所以不应要求权限。每个新提示都会开始一份新的检查清单;所有步骤完成且 Claude 停止后,清单会折叠成一行:✓ Done: <title> (<n> steps)。不需要进行任何工作的快速问题不会显示检查清单。

Clean View 会把最终回应识别为你下一个提示前 Claude 写出的最后一项内容。外掛载入时会从对话中读取这些回应(因此重新载入或重启前的回应仍会显示),每当请求完成就加入新的回应。

Agent Dock

/agentdock,或 🛠 菜单中的 Agent Dock(面板打开时显示 ●),会打开 Agent Dock 面板,让你把大型工作交给一组辅助代理(多份并行工作的 Claude);再次执行,或按面板自己的关闭标记,就会关闭它。它会保持开启,外掛重新载入后也会恢复。面板关闭,或面板不在画面上(此时状态列会显示 Agent Dock (not shown))时,以下内容均不适用。

Team size: ○ 1 ○ 3 ● 5 ○ 10 ○ 20 ○ 30   Helpers: ● Fast & cheap ○ Same as chat

5 agents · 3 working · 2 idle · 1 queued · 1 done
● Research business licenses · Reading the city site               40% ▰▰▰▰▱▱▱▱▱▱  1:20
✓ Draft the floor plan                                             100% ▰▰▰▰▰▰▰▰▰▰  0:56
  • Team:同时可以运行多少个辅助代理(1、3、5、10、20 或 30)。超过 10 个时,面板会以黄色警告大型团队会更快消耗 Claude 用量。
  • Helpers:Fast & cheap 会以低推理等级在 Sonnet 5.5 上运行每个辅助代理请求;Same as chat 使用聊天所用的模型和推理等级。
  • 面板打开时,你发送的每个提示都会带上一则隐藏说明,要求 Claude 把工作拆成互相独立的部分,并行启动这些部分。每个辅助代理的提示都会要求它通过外掛的 agent_progress 工具(mcp__aitools__agent_progress)回报正在做什么以及进度,之后这些内容会填入它的卡片。
  • 团队已满时会拒绝继续启动,并提示你等辅助代理完成后再试(hook 可能无法长时间拦住启动);这些部分在真正启动前会计入排队。
  • 卡片会显示任务、辅助代理正在做什么、它自己的百分比估算、进度栏和运行时间;运行中的辅助代理文字为中灰色,完成的会显示绿色 ✓,失败的会显示红色 ✕。所有辅助代理完成且 Claude 已回应后,卡片下方会显示它们花了多久(All 3 helpers finished in 6 to 10 seconds each.)。卡片和这行文字会一直保留到下一次提示。
  • 团队和辅助代理选项会保存;新的工作阶段中面板默认关闭。

月度成本如何计算

外掛会读取 Claude Code 自己的记录(~/.claude/projects/**/*.jsonl,或 CLAUDE_CONFIG_DIR 指定的目录),按照消息 id 每个 assistant 回应只计算一次;如果回应的时间戳落在当前月份,就把它计入。它会使用 src/pricing.ts 中的表格,按 token 用量(输入、输出、5 分钟或 1 小时费率的缓存写入、缓存读取)计算价格(API 标价截至 2026-09-25)。只读取上次扫描后新增的字节;缓存保存在外掛的储存区中,并在每月重置。数字前的 ~ 表示其中一部分使用了估算费率(按模型家族为未知模型定价),或某个文件无法读取。

限制

  • 仅限 Claude Code:桌面版 Claude Desktop 的 Code 标签和终端。桌面版 Claude Desktop 的 chat 标签中的对话对外掛不可见,也不会计入。
  • 用量百分比来自 API 的速率限制标头,因此会在每次回应后更新。
  • 金额数字表示同样的 token 按 API 计算的成本,不是订阅本身的价格。

安装

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

claude plugin marketplace add pkkid/claude-mods
claude plugin install aitools
原文 / README

aitools

A one-row bar above the prompt showing how close your Claude subscription is to its limits, and what the work would cost at Anthropic API list prices.

AI Tools    5h 42% ·1h12m    wk 18% ·Thu    ctx 31% 62k/200k    cache 42m    thread $3.12 (+$0.41)    month $184.20    limit ~3:40pm   [🛠] [⁝]

| Segment | Meaning | |---|---| | AI Tools | A dim label naming the bar | | 5h 42% ·1h12m | 5-hour usage window: percent used, time until it resets | | wk 18% ·Thu | Weekly window: percent used, the day it resets (hours when under a day) | | ctx 31% 62k/200k | Context window fill: percent and tokens used / window size | | cache 42m | How long the prompt cache should stay warm: Claude Code writes the main conversation's cache with a 1-hour TTL, restarted by every request. Amber under 10 minutes, cache cold once expired. An estimate from request times; the API does not report cache state, and Anthropic may evict early | | thread $3.12 | This session's cost at API prices | | (+$0.41) | What the last turn cost (last $0.41 when thread cost is hidden) | | month $184.20 | This calendar month's Claude Code usage at API prices, across all sessions on this machine | | limit ~3:40pm | At your pace over the last hour, when the 5-hour window would run out; shown only if before it resets |

Usage and context turn yellow at 70% and red at 90%. A value not known yet shows —; until the first response of a session the bar shows the figures from your previous session.

Show or hide the bar

/aitools toggles the whole bar (buttons included); /aitools on and /aitools off set it. The choice holds across sessions. /handoff works either way.

Settings

Press ⁝ to open the options above the bar, five to a row, and toggle any of: the AI Tools label, 5-hour usage, weekly usage, reset countdowns, context %, context tokens, cache warmth, thread cost, last-turn cost, monthly cost, burn-rate projection, threshold colors, threshold alerts, Tools menu. Changes show in the bar right away and are saved across sessions. Press ⁝ again to close it; opening it closes the 🛠 menu, and the other way round.

Threshold alerts are one-time toasts when the 5-hour or weekly window passes 90%, and when context passes 80%.

Handoff

/handoff asks the current conversation for a brief (goal, current state, decisions, open tasks, key files, next step), prints it in the chat as formatted text, and copies the raw markdown to the clipboard. Paste it into a new session to continue there. The brief is a command output row, so the current session's model reads it too.

The 🛠 button opens a row above the bar with Handoff, Workflows, Task View, Clean View and Agent Dock, right-aligned; press it again to close the row without picking. Handoff writes the same brief into a Handoff brief pane, drawn as formatted text with a Copy button; nothing is copied until you press it, and the brief stays out of the chat (so the current session's model does not read it). Workflows runs Claude Code's built-in /workflows directly where the engine has it (the terminal); in the desktop Code tab, which answers a typed /workflows itself, it puts /workflows in the prompt box for you to send with Enter.

Task View and Clean View

Two views from the 🛠 menu that turn Claude's work into a checklist under the bar (an open menu still shows above it): done steps marked with a green ✓, the step in progress with a blue ●, steps not started with a dim ○. In the menu a ● marks the view that is on and a ○ the one that is off; picking the one that is on turns it off, and picking the other switches. The choice holds across sessions.

While one is on, its name shows in the status line under the prompt (with Agent Dock after a comma while the dock is open). /taskview and /cleanview do the same as the menu from the prompt: no argument toggles that view (turning it on switches off the other), on turns it on and off turns it off.

Adding dark mode                                                    3 of 5
✓ Read the theme code                                   100% ▰▰▰▰▰▰▰▰▰▰
✓ Add the color tokens                                  100% ▰▰▰▰▰▰▰▰▰▰
● Wire up the toggle                                     40% ▰▰▰▰▱▱▱▱▱▱
○ Update tests                                            0% ▱▱▱▱▱▱▱▱▱▱
○ Run checks                                              0% ▱▱▱▱▱▱▱▱▱▱

Each step has a bar: full once done, empty until it starts, and for the step in progress Claude's own estimate of how far along it is, which moves each time Claude updates the checklist (the note asks for about every quarter of a step).

  • Task View shows the checklist and leaves the chat as it is (only the checklist tool's own rows are hidden).
  • Clean View shows the checklist and hides every tool call and everything Claude writes while it works; only the final reply of each finished request stays. It hides tool calls and in-progress replies already in the chat too.

While a view is on, each prompt you send carries a hidden note asking Claude to plan the work as plain-language steps and report them through the mod's checklist tool (mcp__aitools__checklist), updating it as each step starts and finishes. The mod answers that tool itself, before Claude Code's permission check, so it should not ask for permission. Each new prompt starts a fresh checklist; once every step is done and Claude stops, it folds to one line, ✓ Done: <title> (<n> steps). A quick question that needs no work gets no checklist.

Clean View recognizes a final reply as the last thing Claude wrote before your next prompt. It reads them from the conversation when the mod loads (so replies from before a reload or restart still show) and adds each new one as a request finishes.

Agent Dock

/agentdock, or Agent Dock in the 🛠 menu (● while open), opens the Agent Dock pane for handing a big job to a team of helper agents (extra copies of Claude working in parallel); either again, or the pane's own close mark, closes it. It stays open until you close it, and comes back after the mod reloads. While the dock is closed, or its pane is not on screen (the status line then reads Agent Dock (not shown)), nothing below applies.

Team size: ○ 1 ○ 3 ● 5 ○ 10 ○ 20 ○ 30   Helpers: ● Fast & cheap ○ Same as chat

5 agents · 3 working · 2 idle · 1 queued · 1 done
● Research business licenses · Reading the city site               40% ▰▰▰▰▱▱▱▱▱▱  1:20
✓ Draft the floor plan                                             100% ▰▰▰▰▰▰▰▰▰▰  0:56
  • Team: how many helpers may run at once (1, 3, 5, 10, 20 or 30). Past 10 the dock warns in yellow that a big team uses your Claude usage much faster.
  • Helpers: Fast & cheap runs every helper request on Sonnet 5.5 at low reasoning; Same as chat uses the chat's model and reasoning level.
  • While the dock is open, each prompt carries a hidden note asking Claude to split a job with separate parts across the team, starting the pieces in parallel. Each helper's prompt asks it to report what it is doing and how far along it is through the mod's agent_progress tool (mcp__aitools__agent_progress), which fills its card.
  • A full team refuses further starts with a note to try again when a helper finishes (a hook may not hold a start for long); those pieces count as queued until they start.
  • Cards show the task, what the helper is doing, its percent (its own estimate), a bar and its running time; a running helper's text is a mid grey, finished ones get a green ✓ and failed ones a red ✕. When every helper is done and Claude has replied, a line under the cards says how long they took (All 3 helpers finished in 6 to 10 seconds each.). The cards and that line stay until your next prompt.
  • The team and helper picks are saved; the dock itself starts closed in a new session.

How monthly cost is computed

The mod reads Claude Code's own transcripts (~/.claude/projects/**/*.jsonl, or under CLAUDE_CONFIG_DIR), counts each assistant response once (by message id) when its timestamp falls in the current month, and prices its token usage (input, output, cache writes at the 5-minute or 1-hour rate, cache reads) with the table in src/pricing.ts (API list prices as of 2026-09-25). Only bytes added since the last scan are read; the cache lives in the mod's store and resets each month. A ~ before a figure means part of it used an estimated rate (an unknown model priced by its family) or a file could not be read.

Limits

  • Claude Code only: the Code tab in Claude Desktop and the terminal. Conversations in Claude Desktop's chat tab are not visible to mods and are not counted.
  • Usage percentages come from the API's rate-limit headers, so they update after each response.
  • Dollar figures are what the same tokens would cost on the API, not what the subscription costs.

更多类似作品