技巧

Uber 在 40 万 token 处压缩工程师的 Claude Code 会话以控制 AI 开支

精选理由

Uber 内部数据很实在:agent 请求涨了 9.4 倍但预算没变,他们靠 40 万 token 强制压缩和 MCP 网关把单次会话成本砍了一半。用 Claude Code 或自建 agent 团队可以直接抄这套省钱做法。

Uber 在工程师的 Claude Code 会话达到 40 万 token 时强制压缩(compaction),即使底层模型支持百万 token 上下文也不放宽。其背景是内部 AI 预算已用尽:2 月到 8 月,每周 agent 请求数增长 9.4 倍,AI 编码工具的周活跃用户增长 7 倍,但 4 月以来整体 AI 支出基本持平。

正文

降本手段主要靠工程优化。在模型不变的前提下,每 1000 次请求的成本从峰值下降近 34%,单次会话成本较 6 月峰值下降 52%,但 Uber 未公布某一项具体措施带来的节省金额。

另一个细节是 MCP 的使用方式:Uber 仍运行 MCP 服务器,但 agent 通过绑定中央 MCP 网关的命令行工具访问,因为预加载 100 多个工具的描述会在用户发出第一条提示词前就消耗 5 万到 7 万 token。这套做法对 token 预算紧张的企业工程团队有直接参考价值。

原文 · rohanpaul_ai

Uber compacts engineers’ Claude Code sessions at 400K tokens, even on million-token models, after exhausting its AI budget.

Weekly agent requests at Uber grew 9.4x from February to August and weekly active users of its AI coding tools grew 7x, yet overall AI spending has stayed roughly flat since April.

With the model held constant, cost per 1,000 requests fell almost 34% from its peak and cost per session fell 52% from its June peak, but Uber gives no savings figure for any single default.

Uber still runs MCP servers, but agents reach them through command-line tools tied to a central MCP gateway, because preloading descriptions for 100-plus tools costs 50K to 70K tokens before the first prompt.

产业坐标与信源核验

本条情报归属 AITOP「技巧」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」「中美大模型技术代差与商业化对照」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:Claude Code、Uber、MCP/工具、token成本,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。

信源核验说明:本文原始线索采编自「rohanpaul_ai」(@rohanpaul_ai),经 AITOP 多维评分管线结构化提炼。