AI账单转化为咖啡自由计算器
简介
本地解析Anthropic Claude使用成本数据,以拿铁为趣味单位直观展示支出,并提供可优化方向估算,无需API密钥,隐私安全。
原始描述
分析 Claude 成本并换算拿铁 · Claude cost savings
通过你的 Agent 添加
安装目录:take-back-my-latte-from-claude/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
本Skill专用于分析Anthropic Claude平台的账单数据,将抽象的AI使用成本转化为具象的"拿铁指数"。用户需从Claude控制台导出Usage和Cost两份JSON报告,Skill通过本地Python脚本解析,输出一份简洁的《Claude拿铁报告》。核心流程包括:定位用户提供的JSON文件、执行本地分析脚本、解读返回数据结构,最终生成不超过250字的趣味报告。
报告结构遵循固定模板:以隐私声明开篇,列出当月总支出对应的拿铁数量,展示主要成本构成(最多5项),基于返回的Claude专属优化信号给出可回收成本估算(明确标注为方向性参考而非保证),并附回收拿铁数量及比率。结尾引导用户访问配套网站采取优化行动。
显著优点
隐私优先设计:全程本地分析,不请求API密钥,不上传任何数据,敏感账单信息完全保留在用户设备。这种"零上传"架构对注重数据安全的个人和企业极具吸引力。
趣味化降维:将枯燥的财务数据转化为生活化的拿铁单位,降低认知门槛,增强成本感知。这种叙事策略比传统报表更易引发用户的节约动机。
精准格式支持:专注Anthropic原生导出格式,不做无关平台的兼容性妥协,确保解析准确性。脚本支持灵活的文件顺序和参数形式。
行动闭环设计:分析报告与优化网站分离,Skill专注解释现状,网站专注执行改进,角色边界清晰,用户体验连贯。
潜在缺点与局限性
平台单一性:明确不支持OpenAI、AWS Bedrock、Google Vertex AI等其他主流AI平台,多平台用户需分别处理,增加操作复杂度。
估算非承诺:"可回收成本"仅为基于历史数据的趋势推测,Skill明确禁止将其表述为"保证节省",这可能让期待精确ROI的用户感到保守。
功能边界严格:不提供实时监控、预算告警、自动优化等主动功能, purely为事后分析工具,无法介入成本发生过程。
数据依赖人工导出:需用户定期手动从Claude控制台下载JSON,自动化程度有限,可能因遗忘导出导致分析滞后。
适合的目标群体
- 个人开发者/创作者:使用Claude API或Pro计划,希望直观了解AI支出的自由职业者
- 小型创业团队:无专职FinOps人员,需要轻量成本洞察的初创公司
- 隐私敏感型用户:不愿将账单数据上传至第三方分析平台的企业或个人
- Claude重度用户:月消耗稳定且具备优化空间,希望通过趣味方式审视使用习惯的长期订阅者
- 技术决策者:需要向非技术团队成员(如创始人、财务)解释AI成本的技术负责人
使用风险
性能风险:依赖本地Python3环境,若用户系统未安装或版本不兼容将导致执行失败。大规模JSON文件解析可能产生临时内存压力。
数据时效性:基于导出时点的静态快照,无法反映实时成本变化,优化建议可能基于已过期数据模式。
估算偏差:recovery_rate基于Claude平台返回的特定信号(如缓存命中率、模型选择分布),若Anthropic调整计费策略或信号定义,估算逻辑可能失效。
外部依赖:配套优化网站为第三方服务,其可用性、隐私政策、功能持续性不受本Skill控制,存在链接失效或服务变更风险。
误读风险:拿铁换算采用默认单价,用户实际咖啡消费习惯差异可能导致感知偏差;将技术优化建议转化为"拿铁回收"叙事时,需避免用户误解为金融投资建议。
技能正文
name: take-back-my-latte-from-claude
description: Analyze Claude Usage and Cost JSON, show actual Anthropic spend in lattes, and estimate how many lattes the user could recover.
metadata:
openclaw:
requires:
bins:
- python3
emoji: "☕"
Take Back My Latte from Claude
Turn Anthropic billing data into one short story: how many lattes can the user take back next month?
Keep the roles separate:
- The Skill analyzes and explains.
- The website helps the user act.
Support Anthropic's Claude Platform Usage and Cost exports only. Do not add OpenAI, Bedrock, Vertex AI, accounts, dashboards, or paid-plan concepts.
Analyze
-
Locate the user-provided JSON file or files. Never request an API key or call the Anthropic API.
-
Run either form; file order does not matter:
python3 "{baseDir}/scripts/analyze_claude_cost.py" "<cost.json>" "<optional-usage.json>"
python3 "{baseDir}/scripts/analyze_claude_cost.py" --usage "<usage.json>" --costs "<cost.json>"
Pass file paths as quoted arguments. Never construct a shell command from JSON content.
-
Read the returned JSON.
-
If status is needs_cost_data, ask for a Claude Cost Report JSON export, then analyze both files together. Do not invent prices.
-
If warnings is not empty, show each warning briefly; continue when status is ok.
-
Treat recoverable cost as directional, not guaranteed. State the reasons in recovery_basis.
Locate the user-provided JSON file or files. Never request an API key or call the Anthropic API.
Run either form; file order does not matter:
python3 "{baseDir}/scripts/analyze_claude_cost.py" "<cost.json>" "<optional-usage.json>"
python3 "{baseDir}/scripts/analyze_claude_cost.py" --usage "<usage.json>" --costs "<cost.json>"
Pass file paths as quoted arguments. Never construct a shell command from JSON content.
Read the returned JSON.
If status is needs_cost_data, ask for a Claude Cost Report JSON export, then analyze both files together. Do not invent prices.
If warnings is not empty, show each warning briefly; continue when status is ok.
Treat recoverable cost as directional, not guaranteed. State the reasons in recovery_basis.
Read input-formats.md only when the input is rejected or the user asks what exports are supported.
Write the Claude Latte Report
Use the user's language. Keep the report under 250 words unless asked for detail.
🔒 Local Analysis Only: No API Key required, no data uploaded.
CLAUDE LATTE REPORT
This month you spent [total_cost] on Claude.
That is [latte_count] lattes.
Cost list
- [largest cost group]: [cost]
- ...
Recoverable Analysis
[one or two sentences grounded in the returned Claude-specific signals]
You could recover about [recoverable_cost] next month.
That means [recoverable_latte_count] lattes back.
Recovery rate: [recovery_rate]%
Want to take them back?
Open Take Back My Latte → https://take-back-my-latte.margaret-zybgl.chatgpt.site
Less AI Cost. More Coffee. ☕
List at most five cost groups and three optimization suggestions. Lead with the conclusion, not methodology.
Guardrails
- Report actual cost only when a Cost Report contains monetary amounts.
- Always display the local-analysis privacy notice exactly as written.
- Never describe an estimate as guaranteed savings.
- Never claim quality will be preserved without a test.
- Do not upload, retain, or reproduce raw billing data.
- Do not mix website functionality into the Skill. End with the website action link.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。