商业产业 Hacker News AI 2026-10-08T04:10 正文 ok 896 words

Show HN:Pacer——你的 AI 编程订阅能撑到额度重置吗?

英文标题:🔶 Show HN: Pacer – will your AI coding subscription last until the reset?

Pacer 是一款 macOS 菜单栏工具,通过两个圆环展示 Claude Code、Codex、Cursor、Antigravity 等 AI 编程订阅的使用节奏,判断当前用量能否撑到额度重置。它显示的不是单纯已用百分比,而是按当前消耗速度预测重置时的用量;达到 100% 表示额度恰好在重置时耗尽,超过则意味着会提前用完。对于 Claude,Pacer 还能根据本地转录记录估算不同模型的额度权重、给出模型使用建议,并计算 API 等价成本。该工具以一个无依赖 Node 脚本和一个 Swift 文件实现,可每 10 分钟采样并通过 JSON 文件向其他工具开放数据。
打开原文相关 3 · 机会 0
media7.6 KB media82.5 KB media58.0 KB media45.0 KB media124.9 KB

中文

macOS 菜单栏中的两个圆环会告诉你:你的 AI 编程订阅能否撑到下一次额度重置;如果撑不到,又该如何调整。它支持 Claude Code、Codex、Cursor、Antigravity 等服务,并将你已登录的每个账户并排展示。

圆环显示当前打开标签页对应账户的会话和周度情况——即你最近使用过的 Claude 登录账户,直到你选择其他账户。每个圆环会填充至其对应的速度:如果继续按当前方式使用,预计在重置时达到的百分比。100 表示你会恰好在重置时耗尽额度。绿色表示 ≤ 80,琥珀色表示 ≤ 100;超过 100 后,圆环会变成实心红色圆盘。(尚未登录的标签页没有速度数据:其圆环会像卡片一样,以更紧凑的刻度显示已使用量。)菜单栏中不显示数字。

点击它:

Pacer 卡片:某个 Claude 登录账户的会话和周度速度,以及少用 Fable 的建议 在两个 Claude 登录账户、Codex 和通过 Antigravity 使用的 Gemini 之间切换标签页

点击标签页即可查看该账户,菜单栏也会随之切换——上方的圆环和卡片始终对应同一份订阅。点击卡片上的其他任意位置可立即进行一次采样。

其他所有菜单栏工具都显示已用百分比。Pacer 显示的是速度:如果继续按当前方式使用,你会在重置时达到什么水平。已用 16% 听起来还不错——直到你发现本周才刚过去 10%。

  • 一句话建议。 根据你的实际模型使用组合计算:停止或减少使用 Fable、将 X% 的 Opus 工作迁移至 Sonnet,或者降低整体使用量。如果一切正常,则显示“按计划进行——无需调整”。
  • 基于你自己账户测得的单模型权重。 Anthropic 并未公开 Opus、Sonnet、Fable 如何计入额度限制。Pacer 会结合官方使用率百分比与你本地的转录记录,从数据中拟合权重(以及缓存读取是否享有折扣)。在数据不足前,它会采用 API 价格比例。
  • API 等价成本。 统计滚动的一天、一周和 30 天内,~/.claude/projects 下每个 Claude Code 配置档案的所有转录记录成本(当某个 CLAUDE_CONFIG_DIR 配置档案的 projects 是此处的符号链接时,也会计入),让你了解这些订阅对你而言价值多少。
  • 当使用节奏超过 100、恢复至 100 以下,以及任意窗口超过 90% 时发送通知。
  • 记住每一个账户。 机器上曾检测到的每份订阅都会保留最近一次读数。对于尚未登录的账户,会显示已使用量和“上次检查”时间;当其重置时间到来时,该窗口会降至 0,圆环转为绿色——提示你可以切回使用。连续一周未被检测到的账户将被遗忘。
  • 额度重置到期时会再次请求数据,而不是等到下一次 10 分钟采样。
  • 体积很小:一个 Node 脚本(无依赖)加一个 Swift 文件。数据保存在其他工具可读取的 JSON 文件中。

需要 macOS 13+、Node ≥ 18、Xcode Command Line Tools(xcode-select --install),以及下表中的至少一种已登录服务。

brew install dkremsa/tap/pacer
brew services start pacer                 # 每 10 分钟采样一次,重启后仍会运行
cp -R "$(brew --prefix)/opt/pacer/Pacer.app" /Applications/ && open "/Applications/Pacer.app"

在 v2.0.0 之前,这个 Homebrew formula 名为 claude-pacer。该名称仍然可以解析,但已安装的 claude-pacer 不会在此次改名后自动升级——请先运行 brew uninstall claude-pacer。

也可以从源码安装:git clone https://github.com/dkremsa/claude-pacer.git ~/.claude/pacer && cd ~/.claude/pacer && ./build.sh——这会将应用编译至 /Applications,并安装一个每 10 分钟采样一次的 launchd agent。

**登录时启动:**系统设置 → 通用 → 登录项与扩展 → + → 从“应用程序”中选择 Pacer。采样器已在开机时运行;此步骤仅用于启动菜单栏图标。

~/.claude/pacer/status.json 每 10 分钟刷新一次,包含:pace、level、advice、windows[](已用百分比、速度、预测值、剩余小时数)、cost(~/.claude/projects 下的全部转录记录,按滚动 day/week/month 统计)、fit——其余字段对应默认 Claude Code 登录账户(由 acct 标识;仅当无法读取默认账户时,才回退至最近使用的登录账户)——以及 accounts[]。accounts[] 为每个账户提供相同的窗口数据及其各自的 pace/level(判定与顶层字段相同;已经达到 100% 的窗口为 red);对于 Claude,还包含 dir——读取它的 CLAUDE_CONFIG_DIR,默认登录账户为 null,在某次采样读取前该字段不存在,读取时间记录在 accountsAt。当 Claude 数据读取失败时,会设置 error 和 errorAt,而 t 保持不变,因此在信任顶层数据前请检查 t 是否足够新鲜。node pacer.mjs status 会输出相同内容。

  • 周度窗口:projected = used% / 已经过的窗口时间比例。
  • 5 小时会话:按最近 45 分钟的速率计算,并预测至重置时刻(会话使用具有突发性;从会话开始至今的平均值会滞后)。
  • 标题展示的是最差的窗口结果。

| 读取来源 | 窗口 | ---|---|--- Claude Code | 钥匙串中的登录信息,适用于默认配置档案及 ~/.claude-* 中的每个 CLAUDE_CONFIG_DIR 配置档案 | 会话、周度、按模型统计的周度 | Codex | ~/.codex/auth.json,实时读取;其会话转录记录作为后备数据 | 5 小时、周度 | Antigravity | 正在运行的应用的本地语言服务器——其转售的每个模型供应商各有一个标签页 | 按模型的额度 | Cursor | IDE 的登录信息 | 计费月(付费席位) | Gemini CLI、GitHub Copilot | 其保存的登录信息——未经测试,依据其公开客户端编写 | 按模型统计的每日额度 · 每月高级请求数 |

机器上没有登录信息的服务不会产生任何成本,也不会显示任何内容。Pacer 只会使用服务提供商已保存的登录信息访问其自身的用量端点,绝不会刷新或写入 token。单模型权重、基于模型组合生成的建议以及 API 等价成本仅适用于 Claude。

English / 原文

Two rings in the macOS menu bar that tell you whether your AI coding subscriptions will last until their reset — and what to change if they won't. Claude Code, Codex, Cursor, Antigravity and more, every account you are logged into, side by side.

The rings are the session and the week of whichever tab is open — the Claude login you used last, until you pick another. Each fills to its speed : the projected % at reset if you keep going like this. 100 = you run out exactly at reset. Green ≤ 80, amber ≤ 100, and past 100 the ring becomes a solid red disc. (A tab you are not logged into has no speed: its rings show what was used , on a tighter scale, the way its card does.) No numbers up there.

Click it:

The Pacer card: session and week speed for a Claude login, with the advice to use Fable less Switching tabs between two Claude logins, Codex and Gemini via Antigravity

Click a tab to see that account, and the menu bar follows it — the rings up there and the card always mean the same subscription. Click anywhere else on the card to sample now.

Every other menu-bar tool shows the percent. Pacer shows the speed : where you land at reset if you keep going like this. 16% used sounds fine — until you notice it's 10% into the week.

  • One sentence of advice. Computed from your actual model mix: stop/reduce Fable, move X% of Opus work to Sonnet, or do less. "On pace — nothing to change" when you're fine.
  • Per-model weights measured on your own account. Anthropic doesn't publish how Opus/Sonnet/Fable count against the limits. Pacer joins the official usage % with your local transcripts and fits the weights from the data (and whether cache reads are discounted). Until there's enough data it uses API price ratios.
  • API-equivalent cost over a rolling day, week and 30 days, across every Claude Code profile whose transcripts are in ~/.claude/projects (a CLAUDE_CONFIG_DIR profile counts when its projects is a symlink there), so you know what the subscriptions are worth to you.
  • Notifications when the pace crosses 100, when it comes back, and when any window passes 90%.
  • Every account, remembered. Each subscription seen on the machine keeps its last reading. One you are not logged into shows what was used and "last checked"; when its reset passes, that window drops to 0 and its ring turns green — the cue to switch back. Forgotten after a week unseen.
  • It asks again when a reset is due , instead of waiting for the next 10-minute sample.
  • Tiny. One Node script (no dependencies) + one Swift file. The data is a JSON file other tools can read.

Requires macOS 13+, Node ≥ 18, Xcode Command Line Tools (xcode-select --install), and at least one login from the table below.

brew install dkremsa/tap/pacer
brew services start pacer                 # samples every 10 min, survives reboots
cp -R "$(brew --prefix)/opt/pacer/Pacer.app" /Applications/ && open "/Applications/Pacer.app"

The formula was called claude-pacer before v2.0.0. That name still resolves, but an installed claude-pacer does not upgrade across the rename — run brew uninstall claude-pacer first.

Or from source: git clone https://github.com/dkremsa/claude-pacer.git ~/.claude/pacer && cd ~/.claude/pacer && ./build.sh — compiles the app into /Applications and installs a launchd agent that samples every 10 minutes.

Start at login: System Settings → General → Login Items & Extensions → + → pick Pacer from Applications. The sampler already runs at boot; this is for the menu-bar icon.

~/.claude/pacer/status.json is refreshed every 10 minutes: pace, level, advice, windows[] (used %, speed, projected, hours left), cost (all transcripts under ~/.claude/projects, rolling day/week/month), fit — the rest for the default Claude Code login (acct names it; it falls to the login used last only when the default one cannot be read) — plus accounts[], the same windows for every account with its own pace/level (same verdict as the top level; a window already at 100% is red) and, for Claude, dir — the CLAUDE_CONFIG_DIR it was read from, null for the default login, absent until a tick has read it, read at accountsAt. When the Claude read fails, error and errorAt are set and t is left alone, so check t for freshness before trusting the top-level figures. node pacer.mjs status prints the same.

  • Week windows: projected = used% / fraction of the window elapsed.
  • The 5-hour session: rate over the last 45 minutes, projected to the reset (a session is bursty; an average since it opened lags).
  • The headline is the worst window.

| read from | windows
---|---|---
Claude Code | the keychain login, for the default profile and every CLAUDE_CONFIG_DIR profile in ~/.claude-* | session, week, per-model week
Codex | ~/.codex/auth.json, live; its session transcripts as the fallback | 5 h, week
Antigravity | the running app's local language server — one tab per model vendor it resells | per-model allowance
Cursor | the IDE's login | billing month (paid seats)
Gemini CLI, GitHub Copilot | their stored logins — untested , written from their public clients | daily per model · monthly premium requests

A provider with no login on the machine costs nothing and shows nothing. Pacer only ever talks to a provider's own usage endpoint, with the login that provider already stored, and never refreshes or writes a token. Per-model weights, advice from your model mix and the API-equivalent cost are Claude-only.