原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。使用 Google 登录即可撰写评价。原型 · 每 30 分钟更新
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

lake-meter

作者:getlake版本 0.1.3i★ 0i在你的电脑上运行
注册名称io.github.getlake/lake-meter

安装方法

What it does

Per-step model recommendations and cost estimates for coding-agent plans.

  • Connects 在你的电脑上运行
  • Account or key No key needed
  • Category 开发者工具

可搭配使用

教 AI 做这类工作的 Skill,可与本项一起使用

rea

Reverse engineer anything with agents, from app behavior down to native binaries.

作者:morluto★ 461,7511 个 skill

Skill · 操作手册

graphify

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

作者:Graphify-Labs★ 148,3521 个 skill

Skill · 操作手册

archify

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

作者:tt-a1i★ 96,7571 个 skill

Skill · 操作手册

为什么排在这里

列表按使用分(满分 100)排序,由以下部分组成

热度4/80GitHub 星标或每周下载量:较大的计 60,较小的计 20
新鲜度12/1230 天内有发布或代码更新得满分
仍在响应0/8上次检查时云端端点有响应
使用分16/100

质量: 基础检查通过 3/3 项(仅展示,不用于排序) · 上升势头: 暂无数据 (只用于“上升中”标签)

安装

选择你使用的 AI 应用,然后复制设置。

通过 3/3 项检查 · 在你的电脑上运行 · ✓ 命令已检查 2026年11月16日

第一步:你用哪个 AI?

选择你用的应用,步骤会显示在下方。

可连接 Claude,但需要先准备

需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用

让 AI 帮你安装

把这段话复制到 Claude 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude 安装 MCP server lake-meter,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "lake-meter": { "command": "npx", "args": [ "-y", "lake-meter", "mcp" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 lake-meter 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 打开电脑版 Claude 应用的设置文件

    SettingsDeveloperEdit Config

  3. 粘贴这些设置并保存文件

    {
      "mcpServers": {
        "lake-meter": {
          "command": "npx",
          "args": [
            "-y",
            "lake-meter",
            "mcp"
          ]
        }
      }
    }
  4. 退出 Claude 再重新打开

  5. 试一试

    用 lake-meter 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude 说正在使用 lake-meter,或回答中出现 lake-meter 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

ChatGPT 暂时无法连接 lake-meter

lake-meter 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器

你可以改用这些方式

A · 使用能连接 lake-meter 的应用

  • 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
  • 需要先在电脑上安装 Node.js(只需一次)
  • 需要先在电脑上安装 Node.js(只需一次)
  • 需要先在电脑上安装 Node.js(只需一次)

B · 开发者工具 类中能连接 ChatGPT 的其他服务器

从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的

可连接 Claude Code,但需要先准备

需要先在电脑上安装 Node.js(只需一次)

让 AI 帮你安装

把这段话复制到 Claude Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude Code 安装 MCP server lake-meter,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):claude mcp add --scope user lake-meter -- npx -y lake-meter mcp 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 lake-meter 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 打开终端

    Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell

  3. 粘贴这条命令并按 Enter

    claude mcp add --scope user lake-meter -- npx -y lake-meter mcp
  4. 在 Claude Code 中输入 /mcp

    应能看到 lake-meter 在列表中并显示已连接

  5. 试一试

    用 lake-meter 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude Code 说正在使用 lake-meter,或回答中出现 lake-meter 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

可连接 Cursor,但需要先准备

需要先在电脑上安装 Node.js(只需一次)

让 AI 帮你安装

把这段话复制到 Cursor 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Cursor 安装 MCP server lake-meter,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "lake-meter": { "command": "npx", "args": [ "-y", "lake-meter", "mcp" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 lake-meter 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 点击这个按钮打开 Cursor

    在 Cursor 中打开

    Cursor 会请你确认安装,点击 Install

  3. 在 Cursor 中以 Agent 模式打开 AI 聊天

  4. 试一试

    用 lake-meter 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Cursor 说正在使用 lake-meter,或回答中出现 lake-meter 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同

可连接 VS Code,但需要先准备

需要先在电脑上安装 Node.js(只需一次)

让 AI 帮你安装

把这段话复制到 VS Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 VS Code 安装 MCP server lake-meter,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "servers": { "lake-meter": { "type": "stdio", "command": "npx", "args": [ "-y", "lake-meter", "mcp" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 lake-meter 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 点击这个按钮打开 VS Code

    在 VS Code 中打开

    VS Code 会请你确认安装,点击 Install

  3. 在 VS Code 中以 Agent 模式打开 AI 聊天

  4. 试一试

    用 lake-meter 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 VS Code 说正在使用 lake-meter,或回答中出现 lake-meter 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同

其他支持 MCP 的应用(如 Windsurf、Zed、Gemini CLI)添加方式各不相同,请在应用列表中查看

查看所有支持 MCP 的应用 →

JSON 设置在下方“开发者专用”中

卡住了?问问正在用 lake-meter 的人💬 讨论 →
开发者专用:终端命令和 JSON 设置

安装在电脑上

Claude Code

claude mcp add --scope user lake-meter -- npx -y lake-meter mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "lake-meter": {
      "command": "npx",
      "args": [
        "-y",
        "lake-meter",
        "mcp"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "lake-meter": {
      "command": "npx",
      "args": [
        "-y",
        "lake-meter",
        "mcp"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "lake-meter": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "lake-meter",
        "mcp"
      ]
    }
  }
}

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

一览

每周下载量i
311/周
连接方式
在你的电脑上运行
最新版本i
0.1.3
发布到注册中心i
2026年11月16日
代码最后更新i
2026年11月16日
作者
getlake
软件包
npm: lake-meter
注册状态
活跃

哪些应用可以使用它

依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。

在你的电脑上运行,适用于

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

全部应用及其优缺点 →

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月16日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 getlake 验证,该账户拥有此仓库

  • ✓ 通过

    仍在维护

    代码最后更新于今天

  • ✓ 通过

    有许可证

    使用 MIT

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

已公开的漏洞(OSV.dev)

尚未检查

我们检查什么 → · JSON

作者:申请重新检查或报告信息错误
给作者:在 README 中加徽章

如果你是作者,可把这段代码贴到 README。徽章会链接回本页。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/getlake-lake-meter.svg)](https://mcp.popnx.com/en/servers/getlake-lake-meter)

讨论

提问、分享技巧或报告无法使用。按“有帮助”数量排序。

还没有帖子,欢迎第一个提问或分享。

此处内容由用户撰写,不代表 PopNx 团队。

登录后发帖

用户评价

还没有评价

登录后写评价

与“开发者工具”中的其他服务器比较i

  • 星标数多于此分类中其他 5964 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 5964 个服务器的 99% 更新
  • 基础检查结果等于或优于此分类中其他 5964 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

lake-meter 安全吗?

它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于今天,最新版本(0.1.3)于今天进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:GitDiagram, Appllama, Cloudflare MCP, Omnara, Repowise

功能相近的其他选择

同一分类、其他作者、命令已通过检查。官方的排在前面,再按星标排序。

如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

GitDiagram

Architecture diagrams, explanations and Mermaid source for public GitHub repositories.

作者:ahmedkhaleel2004广泛使用★ 1.9万2个月前更新

在云端运行✓ 服务方 · gitdiagram.comPopNx 团队已实际试用

Appllama

Study screens, flows and paywalls from top-earning iOS apps, then build from what wins.

作者:Appllama广泛使用★ 51963个月前更新

在云端运行✓ 服务方 · appllama.io

Cloudflare MCP

Cloudflare MCP servers

作者:cloudflare广泛使用★ 446814个月前更新

在云端运行✓ 服务方 · mcp.cloudflare.comPopNx 团队已实际试用

Omnara

Deploy durable AI agents with Omnara, an open-source managed-agent platform.

作者:omnara-ai广泛使用★ 34002个月前更新

在云端运行✓ 服务方 · omnara.com

Repowise

Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.

作者:repowise-dev广泛使用↓ 6506/周★ 8145 整个仓库的星标3天前更新

电脑或云端✓ 服务方 · repowise.dev
与相似项目对比
本项
lake-meter
GitDiagramAppllamaCloudflare MCPOmnaraRepowise
运行位置需要安装在电脑上在云端运行,无需安装在云端运行,无需安装在云端运行,无需安装在云端运行,无需安装云端或安装在电脑上都可以
需要密钥否否否否否否
可在 Claude 中按 + 添加否否否是否否
基础检查3/34/44/44/44/45/5
许可证MITMITMITApache-2.0Apache-2.0AGPL-3.0
价格登记中未列出费用登记中未列出费用登记中未列出费用登记中未列出费用登记中未列出费用登记中未列出费用

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

lake-meter

A model for every step, and a hard stop for every run. For Claude Code.

Claude Code is great until a run loops, fans out into subagents, or quietly eats your 5‑hour window on a step a cheaper model could have done. lake-meter adds two things using only Claude Code's own extension points (hooks, statusline, skills, MCP):

  1. Model per step. When Claude writes a plan in plan mode, lake-meter rates each step's complexity, recommends the cheapest model that should handle it (Haiku / Sonnet / Opus), and estimates tokens and dollars per step and in total, next to the cost of running everything on Opus. The table appears inside Claude Code's own "Ready to code?" plan dialog.
  2. A per-run cap that stops and asks. Set $5 (or a token budget, or a % of your 5‑hour window). When a run reaches it, the next tool call becomes a permission prompt: Yes continues with +50% headroom, No stops Claude right there. In unattended modes it ends the turn instead.
  3. An end-of-run receipt. Measured tokens and list-price dollars for the run, split by model and subagents, compared with the plan's estimate.

Local only. No account, no server, no telemetry.

npx lake-meter init

That's the whole install. Restart Claude Code (or open /hooks) and work as usual.


What you see

In plan mode, at the top of the plan dialog:

Ready to code?

Here is Claude's plan: ▎ Lake Meter estimate: $3.53–$13.0 with a model per step, vs $3.96–$14.5 all on Opus 5.5. Table at the end.

and at the end of the plan:

┌─────┬─────────────────────────────────────┬────────────┬─────────────────────┬───────────┬─────────────┐

│ # │ Step │ Complexity │ Recommended model │ Tokens │ Est. cost │ ├─────┼─────────────────────────────────────┼────────────┼─────────────────────┼───────────┼─────────────┤ │ 1 │ Add retry settings to config │ 1/5 │ Haiku 5.5 (haiku) │ 40k–161k │ <$0.01 │ │ 2 │ Design an idempotent delivery queue │ 5/5 │ Opus 5.5 (opus) │ 1.5M–6.2M │ $2.10–$8.22 │ │ 3 │ Implement the retry worker │ 4/5 │ Opus 5.5 (opus) │ 720k–2.6M │ $1.01–$3.38 │ │ 4 │ Expose delivery status in the API │ 3/5 │ Sonnet 5.5 (sonnet) │ 284k–1.0M │ $0.21–$0.71 │ │ 5 │ Tests for failure paths │ 3/5 │ Sonnet 5.5 (sonnet) │ 284k–1.0M │ $0.21–$0.71 │ │ 6 │ Update the changelog │ 1/5 │ Haiku 5.5 (haiku) │ 40k–161k │ <$0.01 │ └─────┴─────────────────────────────────────┴────────────┴─────────────────────┴───────────┴─────────────┘ Total: $3.53–$13.0 vs $3.96–$14.5 with everything on Opus 5.5 (about 10% less).

When the cap is reached, before the next tool call:

│ Hook PreToolUse:Bash requires confirmation for this command:

│ Lake Meter: this run has used about $2.15 (cap $2.00). Approve to continue with +$1.00 headroom. │ Deny to stop here. Or run /meter cap to set a new cap. [settings] Do you want to proceed? ❯ 1. Yes

  1. No

When the run ends:

Stop says: Lake Meter · run $3.44 · 524k tok (313k cache reads, 155k out) · Opus 5.5 $3.44 · cap $7.00

Since plan approved: $3.25 measured vs $3.53–$13.0 estimated

All the time, in the statusline: ◒ Lake · run $0.65 / $5.00 · session $4.54 · 5h 42%

(These are copied from a real Claude Code 2.1.322 session; see Verification.)

Commands

npx lake-meter@latest initinstall hooks, statusline, /meter skill and two subagents (installed by default; skip with --no-agents) into ~/.claude
npx lake-meter@latest init --projectinstall hooks into this repo's .claude/settings.local.json (also writes .claude/skills and .claude/agents with machine-specific paths: don't commit them)
npx lake-meter@latest init --cap 10 --no-agents --statuslineset the cap, skip the subagents, replace an existing statusline
/meter, /meter cap 10, /meter cap off, /meter reportinside Claude Code (uses one short model turn to display)
npx lake-meter@latest cap 10 · npx lake-meter@latest status · npx lake-meter@latest reportsame, from any terminal, no model turn (or npm i -g lake-meter and drop npx)
npx lake-meter@latest plan plan.md [--why] [--openai] [--json] (flags after the file)plan breakdown for any markdown plan
npx lake-meter@latest mcpMCP server with estimate_plan and meter_status (works in Cursor too)
npx lake-meter@latest uninstallremove everything init added (your settings are restored; a backup of the original is kept as settings.json.lake-meter.bak)
Config

~/.lake-meter/config.json (per-project override: .lake-meter.json in the repo root):

{

"capUsd": 5, "capTokens": null, "capFiveHourPct": null, "sessionCapUsd": null, "onCap": "ask", "extendPct": 50, "warnPct": 80, "provider": "anthropic", "annotatePlans": true }

KeyMeaning
capUsdper run, API list-price equivalent. null = off
capTokensper run, all tokens incl. cache reads
capFiveHourPcte.g. 80: stop when your 5-hour subscription window passes 80% (needs the statusline)
sessionCapUsdacross the whole session
onCap"ask" = permission prompt; "stop" = end the turn
extendPctheadroom granted when you press Yes
warnPctone heads-up (to you and to Claude) at this % of the cap
provider"anthropic" or "openai" for plan recommendations
annotatePlansadd the table to plan files in plan mode

Simplest: npx lake-meter@latest cap 10 writes this file for you.

A run is everything from one prompt you submit until Claude stops.

Cursor and other MCP clients

Add to ~/.cursor/mcp.json (or any MCP client's config):

{ "mcpServers": { "lake-meter": { "command": "npx", "args": ["-y", "lake-meter@latest", "mcp"] } } }

Then ask the agent to "estimate this plan with lake-meter". In Cursor you get the per-step model and cost breakdown. The cap and the receipt are Claude Code only, because Cursor doesn't expose per-run token usage to extensions.

Measured vs estimated (read this)

HowAccuracy
Tokens per runMeasured. Read from Claude Code's session transcript (message.usage on each response, de-duplicated by message id) plus subagent transcripts in /subagents/.Exact as reported by the API, up to transcript write lag (see limits).
Dollars per runComputed from measured tokens × list prices in src/prices.json, per request, including cache writes (5m/1h), cache reads and Haiku's long-context tier.Matches Claude Code's own total_cost_usd in our tests. It's an API-equivalent figure: on Pro/Max you don't pay it per token; it tells you how heavy a run was. Your invoice can differ (discounts, batch, regions).
5-hour window %Reported by Claude Code to the statusline (rate_limits.five_hour.used_percentage, Pro/Max only).As accurate as Claude Code's own number.
Plan breakdownEstimate. Keyword and size heuristics rate each step 1–5; token budgets per complexity live in prices.json (assumptions). Run npx lake-meter@latest plan plan.md --why to see every reason.Rough. Ranges are wide on purpose. Tune the budgets from your own npx lake-meter@latest report history.
Model recommendationOpinion, encoded as complexity → tier (1–2 Haiku, 3 Sonnet, 4–5 Opus). Frontier models are never recommended by default.A starting point, not a guarantee of quality.

Prices last verified 2026‑11‑12 from Anthropic pricing and OpenAI pricing. To update, edit src/prices.json, or drop an override at ~/.lake-meter/prices.json with the same shape.

How it works

init copies a pinned runtime to ~/.lake-meter/runtime (so hooks run in ~50 ms with plain node, no npx per call) and adds to your Claude Code settings:

Extension pointWhat lake-meter does
UserPromptSubmit hookmarks the start of a run
PreToolUse hook (*)reads new transcript bytes, prices them, and returns permissionDecision: "ask" when the cap is reached (or continue: false in bypassPermissions / dontAsk / onCap: "stop"). On ExitPlanMode it records the plan estimate and gives Claude a one-line note about cheaper subagents
PostToolUse hook (*)if the tool we asked about ran, you pressed Yes, so headroom is added. When Claude writes a plan file in plan mode, appends the per-step table to it
Stop hookprints the receipt (systemMessage, never blocks) and appends one line to ~/.lake-meter/runs.jsonl
statusLineshows the meter and stores Claude Code's own session cost and rate-limit % for the window cap. Only installed if you don't already have a statusline
~/.claude/skills/meterthe /meter command
~/.claude/agents/lake-light.md, lake-standard.mdsubagents pinned to haiku and sonnet (installed by default; skip with --no-agents), so the per-step advice is actionable. Claude only uses them if it decides to

Limits (honest list)

  • The cap is checked before each tool call. A single long model response can overshoot it, and the final text answer of a turn isn't gated. Expect a run to end slightly above the cap.
  • Transcript lag. Claude Code writes transcripts asynchronously, so the newest response may land a moment late. Spend can lag by about one response.
  • Pressing No interrupts the turn. Claude Code doesn't run Stop hooks on interrupts, so there's no receipt for that turn; npx lake-meter@latest status still has the numbers.
  • "Run" = one submitted prompt. Background subagent reports and /loop iterations also fire UserPromptSubmit and start a new run; use sessionCapUsd to bound the whole session.
  • Dollar figures are list-price equivalents, not your bill. On subscriptions use capTokens or capFiveHourPct if dollars feel abstract.
  • Plan breakdown is heuristic and English-keyword based. Unknown models count tokens but not dollars (and the receipt says so).
  • `/meter` costs one short model turn because skills run through the model; the CLI commands don't.
  • Claude Code only for caps and receipts. Cursor, Codex and others get the MCP plan estimate.

Privacy

Step titles are stored locally in ~/.lake-meter, along with config and a run log of token and dollar totals. Nothing leaves the machine. No prompts or code are stored. lake-meter makes no network requests, and there's no telemetry. Debugging: touch ~/.lake-meter/debug logs raw hook inputs locally to ~/.lake-meter/debug.jsonl; delete the file to stop.

Verification

  • npm test: 54 tests (pricing math, transcript parsing and de-duplication, plan splitting and scoring, every hook path, install/uninstall round-trip, MCP over stdio, a simulated session through the real CLI).
  • test/real-claude.test.js runs the real Claude Code binary (2.1.322 at time of writing) against a local mock of the Messages API (scripts/mock-anthropic.js, no account needed). It checks that the hooks fire, the cap produces a permission decision, bypassPermissions stops the turn, and that lake-meter's measured run cost equals Claude Code's own total_cost_usd. Skipped when no Claude Code binary is installed.
  • The screens in What you see were captured from an interactive Claude Code session driven against the same mock.

Demo (from a clone, no account needed)

npm run demo        # simulated session: plan breakdown → cap prompt → receipt

Teams

Works with [lake-gate](

只显示了开头部分;其余内容请在仓库中阅读