Anthropic 旗下编码助手 Claude Code 自版本 2.1.232(发布于 2026 年 8 月)起,默认启用了一项后台代理状态行摘要功能 1。该机制每隔约 30 秒会将完整的对话记录发送至模型以生成摘要,且目前无法通过官方设置关闭 1。这一行为导致用户额外消耗了约 15% 至 20% 的 Token,对于订阅制用户而言,这直接表现为速率限制余量的浪费 1。相关 GitHub Issue #86879 收集的四项独立测量数据显示,实际损耗范围在 18% 至 26% 之间 1。
针对此问题,开发者 Flamerix AI 发布了一款名为 no-agent-summary.js 的 Bun 预加载脚本,旨在抑制上述异常请求 1。现有的环境变量如 DISABLE_NON_ESSENTIAL_MODEL_CALLS 对该二进制文件无效,而设置 CLAUDE_CODE_FORK_SUBAGENT=0 虽能停止摘要但会禁用子代理功能 1。因此,该脚本通过包裹 setTimeout 和 setInterval 来拦截特定回调 1。用户可以通过设置 BUN_OPTIONS="--preload /path/to/no-agent-summary.js" 进行全局配置,并借助 OpenTelemetry 导出数据中 query_source = agent_summary 的请求数量是否降为零来验证效果 1。
Claude Code has been identified as consuming approximately 15–20% of user token allowances due to a default background feature that sends entire conversation logs to the model every 30 seconds for status line summaries 1. This behavior, enabled by default since version 2.1.232 in August 2026, lacks an official setting to disable it, resulting in significant waste of rate limit quotas for subscription users 1. Independent measurements collected in GitHub Issue #86879 corroborate these findings, with four separate data points indicating token consumption ranges between 18% and 26% 1.
In response to this issue, developer Flamerix AI released a Bun preload script named no-agent-summary.js to intercept and suppress these specific requests 1. The script operates by wrapping setTimeout and setInterval functions to block the callbacks responsible for the summary generation 1. It can be configured globally using the environment variable BUN_OPTIONS="--preload /path/to/no-agent-summary.js" 1. While existing environment variables such as DISABLE_NON_ESSENTIAL_MODEL_CALLS fail to affect the binary, and CLAUDE_CODE_FORK_SUBAGENT=0 disables the process but also breaks subagent functionality, the new script offers a targeted solution 1. Users can verify the effectiveness of the workaround by monitoring OpenTelemetry exports to ensure that request counts associated with query_source = agent_summary drop to zero 1.
评论
还没有评论,欢迎留下第一条。