省 token 的 skill 和工具(rtk、caveman)真的有用吗?
有一点用,但远没有宣称的多。JetBrains 在 Claude Code 上按账单做的配对实测:caveman 宣称省 65%,实测输出 token 少 8.5%;rtk 宣称省 60–90%,实测低推理档账单反而多 7.6%,高档持平。两个工具都没有让任务质量变差。装之前先用 /usage 看清 token 花在哪,装之后看账单,不看工具自己报的数。
Codex
没有 Codex 上的公开配对实测;判断方法一样:比自己账号的 token 用量,不看工具自己报的数。
rtk 和 caveman 都支持 Codex,但上面两次实测只在 Claude Code 上做过,数字不能直接搬到 Codex。道理是通用的:OpenAI 写明提示、文件、聊天历史、工具结果和回复全都算 token,命令输出只是其中一块,只压这一块,整体省不了多少。自己验证用 Codex CLI 的 /usage daily 和 /usage weekly 看账号的 token 用量,/status 看剩余额度。OpenAI 官方给的省法是另外几条:提示写准、只给相关文件、AGENTS.md 写短、不用的 MCP 关掉、日常换小一档的模型。
官方原文
Tokens are small units of information that ChatGPT reads and writes. Your prompt, files, chat history, tool results, and ChatGPT's response all use tokens.Limit the number of MCP servers you use. Every MCP server adds more context to your messages and uses more of your limit. Disable MCP servers when you don't need them./usage — View account token usage or use a rate-limit reset. Inspect daily, weekly, or cumulative ChatGPT token activity from inside the TUI.Claude
实测省得很少:caveman 输出 token 少 8.5%,rtk 账单多 7.6% 或持平;任务质量都没变差。
两次实测都是 JetBrains 做的:Claude Code、claude-sonnet-5、SkillsBench 的 86 个编程任务,同一任务装和不装各跑一遍再成对比较。caveman 是强制每条回复都启用的最好情况,输出 token 少 8.5%(592k 到 542k,82 对任务),成本约少 10%。rtk 按默认安装,低推理档每个任务的成本中位数多 7.6%(80 对,p=0.004),高推理档 +0.1%(p=0.99)。文中的宣称数字是 2026 年 7 月实测时两个项目 README 的写法。
官方原文
rtk advertised saving: 60–90%. Measured on real agent work: +7.6% more expensive at low reasoning effort (p=0.004), ±0% at high effort. Setup: Claude Code 2.1.201 · claude-sonnet-5 low and high efforts · SkillsBench. Task quality: unchanged in both arms, at both effort levels.Advertised saving: 65%. Measured saving: 8.5%. Output-token saving on real agentic tasks, with the skill forcibly activated. This is the ceiling, not the usual-case result.a tool's self-reported savings are a claim about its counterfactual, not about your bill. rtk's scoreboard said 96 million tokens saved while the invoice went up. If you evaluate any context-compression tool, measure the paired bill, not the tool's diff.On a Pro, Max, Team, or Enterprise plan, /usage also shows a breakdown of what counts against your plan limits: Attribution: recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total.为什么省得这么少
能压的那部分本来就小。写代码时 agent 的输出大多是代码、diff 和工具调用,caveman 不碰这些,变短的只有工具调用之间那几句说明。
Claude Code 读文件、搜索用的是自带的 Read 和 Grep,不经过 rtk 用的 Bash hook;模型读进去的内容里,rtk 碰得到的工具输出只有约五分之一。JetBrains 估算的理论上限是账单的 3% 左右。
只想过滤啰嗦的命令输出的话,Claude Code 官方文档自己就给了一个只回传失败行的 hook 示例。
官方原文
Advertised savings come from chat-style prose answers. Agentic output is different: code, diffs, tool invocations, and exact error strings dominate the token stream, and Caveman correctly leaves all of it verbatim.Custom hooks can preprocess data before Claude sees it. Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for ERROR and return only matching lines, reducing context from tens of thousands of tokens to hundreds.两个项目现在怎么说
实测之后,两个项目的 README 都更新了说法。rtk 现在写的是「最多砍掉 agent 读到的 bash 输出的 90%」,并写明这不等于账单少 90%。caveman 直接引用了 8.5% 这个结果,并在那之后新增了压缩工具输出的代理;JetBrains 没测过这部分。
两个工具的压缩本身是真的,两次实测里任务质量也都没有变差。差别在使用场景和怎么算账。
官方原文
RTK cuts up to 90% of the bash output your agent reads. That is what RTK measures, and it is not the same as cutting your bill by 90%.The JetBrains number is why the proxy exists. They measured the skill alone, in July 2026, before the proxy shipped.常见误解
- 工具自己统计省了几千万 token,账单肯定也省了这么多
不是。JetBrains 的低推理档整轮测试里,rtk 自带的统计报出省了 9,620 万 token,同一批任务的账单却是涨的。JetBrains 给了三个原因:它拿完整的原始输出当对比基准,而 Claude Code 本来就会截断超长输出;它在命令执行时按「字符数 ÷ 4」估 token,而一次会话的输入大头是按缓存价计的重读;hook 根本看不到大部分上下文。
- 装一个省 token 的 skill,就能省掉一大半
不会。宣称的 65% 来自聊天式问答;写代码时 agent 的输出大多是代码、diff 和工具调用,这些 skill 不会去压,能压的只有中间那几句说明。实测上限是输出 token 少 8.5%,而且是强制每条都启用的情况,平时只会更少。
- 实测说省不了多少,那这些工具就是骗人的
不是。两次实测里任务质量都没有变差,压缩本身是真的,JetBrains 对 rtk 的评语是「Honest engineering, wrong counterfactual」(工程做得实在,只是对比基准选错了)。两个项目现在的 README 也都改了说法:rtk 写明砍掉 bash 输出不等于账单少这么多,caveman 直接引用了 8.5% 这个数字。差别在使用场景和怎么算账,不在工具真假。
建议
- 装之前先看 token 花在哪:Claude Code 运行 /usage(按 d 或 w 切换 24 小时和 7 天)和 /context;大头是长会话或 subagent 的话,压缩命令输出的工具帮不上忙。
- 自己验证就比账单:装之前和装之后各用几天,任务类型相近,对比 /usage(Codex 用 /usage weekly)里的用量;不要拿工具自己统计的「已省多少 token」当结论。
- 别只试一次就下结论:rtk 那次实测里,同一个任务原样重跑,成本中位数就能差 22%;caveman 第一轮 10 个任务的小样本显示省 29.5%,扩大到 86 个任务后是 8.5%。
- 装之后留意有没有多跑几轮:rtk 实测里对话轮数多了 13.8%、缓存读取多了 14.3%,多出来的钱就花在这里。
- 只想过滤测试和日志输出:Claude Code 官方 costs 页有现成的 PreToolUse hook 示例,只回传失败行,不用装第三方工具。
- 任何 skill 本身也有每轮开销:它的描述每轮都带着。
