依据创用CC授权使用
于Linux,Claude Code 2.1.257–2.1.312上测试过(见测试版本). 二进制不修改(BUN OPTIONS=- preload). 更新可以无声地撤消,所以请查看校验。
卷曲-fsSL https://gist.githubusercontent.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce/raw/no-agent-summary.js -o~/.local/share/no-agent-summary.js
claude 守护进程停止 -- 任何
BUN OPTIONS="${BUN OPTIONS:+$BUN OPTIONS} - 预装$HOME/. local/share/no-agent-Summary.js" claude
要让每个 Claude Code 进程永久化,请参见 Institution.
每~30秒,对于每个背景agent,Claude Code都会将agent的全部笔录发送给agent自己的模型(通常是Opus),并要求它"用3-5字描述你最近的动作". 答案只更新了agent在agents面板中的状态线;它从未到达模型或您的对话。 没有设定关闭,自2.1232(2026年8月)以来,它一直默认关闭。
DRIM在Claude Code的OpenTeleometry导出中检测到异常情况:
分组 claude code.api 通过查询 source请求事件显示 agent 汇总成本高于主对话本身。
这里的支出是指Claude Code自己的按要求估算的估计数(成本),而不是发票:
订阅,你损失的是限价头室。 我们不是唯一的衡量者。
#86879收集四个独立
18-26%的测量值。
no-agent-summary.js是Bun预装(~80行代码). 包装时间输出/设置Interval;
当召回的源文本包含一个摘要锚时(如:[代理概要] 计时器被发射
它返回一个惰性手柄,而不是武装定时器。 其他计时器都会通过
穿过未触碰的。 在 OpenTeleometry 导出中,被压制的请求是
claude code.api 用查询來源=agent 摘要请求事件。
为什么定时钩比更简单:模块船作为预先编译的邦字节码,所以
在二进制中编辑其JS文本不会改变任何东西,API客户端不会通过一个
环球This.fatch. 但函数。 prototype.toString仍然返回回调源
即使它从字节代码运行,所以计时器可以通过它内部的字符串识别。 惰性
定时器使用 231–1 ms:节点和 Bun 将较大的延迟处理为 1 ms,所以是"无限" 延迟
立即开火
- 将无agent-Summary.js放在稳定的地方;注意它的绝对路径。
- 设置 BUN OPTIONS 全球,所以每个 Claude Code 进程得到它。 其中一个:
#~. profile,~.bashrc,~/.zshrc 导出 BUN OPTIONS="${BUN OPTIONS:+$BUN OPTIONS} - 预装/abs/path/no-agent-summary.js" #/.confile/.complete/.js –.confile/.d/50-no-agent-summary.js;也到达#用户服务和时间器;在用户管理器下次启动时适用,通常在下一个登录时适用 BUN OPTION=-预装/abs/no-agent-summary.js#.d/. 或更早在PATH上命名为claude的包装纸(当一个Claude时,这个箱子保持了它的一元性).
代码进程开始另一个:
#/bin/sh HOOK=/abs/path/no-agent-summary.js case "${BUN OPTIONS-}" in * - preload $HOOK "*";*)导出 BUN OPTIONS="${BUN OPTIONS:+$BUN OPTIONS] - 预装$HOOK";cesc:"${CC AGENT SUMAMARY LOG:=${XDG R:-/tmp}/no-agent-summary.log}"导出CC AGENT Summary LOG执行/path/to/the/real/claude"@
- 重新启动守护进程和每个已运行的会话,然后从一个开始 Claude Code
具有 BUN OPTIONS 的环境:
claude 守护进程停止 -- 任何
-安装后重新启动守护进程。 守护进程、 pty 主机和预装 bg-spare 会话
继承启动守护进程客户端的环境,因此在 BUN OPTIONS 设定之前,守护进程会启动。 因此,claude守护进程停止 -- 任何。
- 无头运行也需要它:claude -p, cron, CI,编辑集成。
- 平台:Linux试验,macOS和Windows未试验。 在Windows,最多/ $bunfs/ 闸门
可能永远不会安装钩子。
- A/B: CC AGENT SUMMARI MODE=pass 加载钩子但每一次计时器;摘要回来,显示的不结果就是钩子做的。
- 背景进程:守护进程、pty主机和bg-spare必须携带 -- 预装在其环境中(/proc/<pid>/environ on Linux);如果没有,则重新启动守护进程。
- 预装负载:BUN OPTIONS=" - 预装$HOME/.local/share/no-agent-summary.js" CC AGENT Summary LOG=/tmp/nas.log claude - version 猫/tmp/nas.log 期待预装活动模式=关闭。.. 无行:BUN OPTIONS 未到达进程,或
路径不是绝对的。
- 定时器压制:使用相同的BUN OPTIONS和CC AGENT Summary LOG=/tmp/nas.log,运行
一个背景副剂,一两分钟。 显示摘要定时器 # 1 已压制( 设置时断,延迟 = 3000) 和 agent 的面板状态停止
更新。 如果导出 OpenTeleometry,查询 source = agent summary 应保持为 0;此
是每个失败模式的唯一检查。
匹配是通过源文本:一个锚必须坐落在传递到定时器的回调内。 如果更新中断了,钩子没有匹配,总结无声地回来。 如何发生这种情况:
- 重新命名了日志线或查询源代码;
- 回调通过fn.bind(.)(在toString中没有来源)或另一个包装器传递;
- 字符串移动到召回以外的一个共享常数;
- 计时器移动到未包装的API(计时器/保证器,调度器循环器).
在每次更新后重新进行校验。
- 我们的机器上每个Claude Code过程都运行它(2.1.301)。 从那时起
0 agent 摘要请求,没有其他侧式查询增长来取代它。
- 副代理人、背景agents、叉子技能和背景会话正常运行;只有摘要叉被跳过。
- 可见的变化:每agent面板状态停止更新;SDK任务进度没有摘要。
- Overhead:一个函数。 prototype.toString 每个不同的计时器调用,缓存在一个弱地图中。 claude-版本:~10ms~17ms(一个测量).
Linux x64 二进制自 npm @anthropic-ai/claude-code-linux-x64(它的sha256等于土生土长)
安装者名单 json checksum). 静态:提取的捆绑摘要计时器调回
带钩锚。 现场:claude -p - 模式海库
CLAUDE CODE AGENT PROGRESS SUMMARIES=1,一个副剂进行~20s的8个步骤,计数
[代理简讯]forking in --debug-file.
5 / 5 / 0 = 本版本的叉子发生,仅仅装入钩子没有改变,关闭
删掉它。
- 有记录的开关只打开它 SDK 选项代理 PROW 简讯默认为虚假,但在捆绑中它是 OR 的一个术语,并且每个代码路径都会设定它的真实性。 所以假的改变什么也没有,没有记录的CLAUDE CODE AGENT PROGRESS SUMARIES只能启用摘要了。
- 间隔属于服务器。 它来自每个型号的家庭服务器旗,被夹在30–240 s. 默认已经是最小值,没有值会禁用计时器。
- 很明显的黑洞Vars小姐。 一些包装器设置的可拆卸的 NON ESSENTIAL model CALLS
完全不出现在二进制中。 CLAUDE CODE FORK SUBAGENT=0和CLAUDE CODE DISABLE BACKROUND TASKS=1确实阻止了它,但只能使用叉子剂或
背景 agents 随它而来。
- 快速缓存使它更便宜,而不是便宜。 其中约98%的电话从缓存中重新读取记录稿;打入冷藏库的~2%则背负三分之一的成本。
- 读抄本的成本工具看不到这些请求没有写入磁盘上的会话日志(# 104358);只有 OpenTeleometry 导出显示。 关于背景符号用法的docs部分也没有列出,而Agent View的行摘要则被记录为每几分钟刷新一次的海库级模型。
- 一个便宜的变体已经存在,关闭。 2.1.310 一种短模式的船舶:约2k
符号为指出,而不是完整的笔录,可选由较小的模型写成。 那个
默认仍然是完整记录,只有服务器旗才能更改。
在我们的遥测中,其每周支出份额从7月份的3.5-7%(叉门已经为我们打开)增加到7.3%,然后在一周内达到11.8%,到10月中旬达到约16%。
麻省理工学院 2026 Flamerix AI. 提供如上,没有任何形式的保证;你冒着风险使用。 Flamerix AI不对其使用引起的任何损害、数据损失或账户诉讼负责。 改变客户端的运行时间行为可能与您使用的服务条款相冲突;检查由您负责。
"Claude"和"Claude Code"是Anthropic,PBC的商标。 这个项目是独立的,不附属于Anthropic,赞助或认可。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
by Flamerix AI · MIT License
Tested on Linux, Claude Code 2.1.257–2.1.312 (see Tested versions). The binary is not modified (BUN_OPTIONS=--preload). An update can silently undo it, so see Verify.
curl -fsSL https://gist.githubusercontent.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce/raw/no-agent-summary.js -o ~/.local/share/no-agent-summary.js
claude daemon stop --any
BUN_OPTIONS="${BUN_OPTIONS:+$BUN_OPTIONS }--preload $HOME/.local/share/no-agent-summary.js" claude
To make it permanent for every Claude Code process, see Install.
Every ~30 seconds, for every background agent, Claude Code sends that agent's entire transcript to the agent's own model (usually Opus) and asks it to "describe your most recent action in 3-5 words". The answer only updates the agent's status line in the agents panel; it never reaches the model or your conversation. There is no setting that turns it off, and since 2.1.232 (August 2026) it has been on by default.
The anomaly was detected by DRIM in Claude Code's OpenTelemetry export:
grouping claude_code.api_request events by query_source showed agent_summary costing more than the main conversation itself.
Spend here means Claude Code's own per-request estimate (cost_usd), not an invoice: on a
subscription, what you lose is rate-limit headroom. We are not the only ones who measured it:
#86879 collects four independent
measurements of 18–26 %.
no-agent-summary.js is a Bun preload (~80 lines of code). It wraps setTimeout/setInterval;
when a callback's source text contains a summarizer anchor (e.g. the [AgentSummary] Timer fired
log line), it returns an inert handle instead of arming the timer. Every other timer passes
through untouched. In the OpenTelemetry export the suppressed requests are
claude_code.api_request events with query_source = agent_summary.
Why a timer hook rather than something simpler: the module ships as precompiled Bun bytecode, so
editing its JS text inside the binary changes nothing, and the API client does not go through a
wrapped globalThis.fetch. But Function.prototype.toString still returns a callback's source
even when it runs from bytecode, so the timer can be recognised by a string inside it. The inert
timer uses exactly 2³¹−1 ms: Node and Bun treat a larger delay as 1 ms, so an "infinite" delay
would fire at once.
- Put no-agent-summary.js somewhere stable; note its absolute path.
- Set BUN_OPTIONS globally so every Claude Code process gets it. One of:
# ~/.profile, ~/.bashrc, ~/.zshrc export BUN_OPTIONS="${BUN_OPTIONS:+$BUN_OPTIONS }--preload /abs/path/no-agent-summary.js" # ~/.config/fish/config.fish set -gx BUN_OPTIONS "--preload /abs/path/no-agent-summary.js" # ~/.config/environment.d/50-no-agent-summary.conf (systemd user env; also reaches # user services and timers; applies when the user manager next starts, usually next login) BUN_OPTIONS=--preload /abs/path/no-agent-summary.js Or a wrapper named claude earlier on PATH (the case keeps it idempotent when one Claude
Code process starts another):
#!/bin/sh HOOK=/abs/path/no-agent-summary.js case " ${BUN_OPTIONS-} " in *" --preload $HOOK "*) ;; *) export BUN_OPTIONS="${BUN_OPTIONS:+$BUN_OPTIONS }--preload $HOOK" ;; esac : "${CC_AGENT_SUMMARY_LOG:=${XDG_RUNTIME_DIR:-/tmp}/no-agent-summary.log}" export CC_AGENT_SUMMARY_LOG exec /path/to/the/real/claude "$@"
- Restart the daemon and every already-running session, then start Claude Code from an
environment that has BUN_OPTIONS:
claude daemon stop --any
- Restart the daemon after install. The daemon, pty host and pre-warmed bg-spare sessions
inherit the environment of the client that started the daemon, so a daemon started before BUN_OPTIONS was set keeps spawning unhooked sessions. Hence claude daemon stop --any.
- Headless runs need it too: claude -p, cron, CI, editor integrations.
- Platform: Linux tested, macOS and Windows untested. On Windows the /$bunfs/ gate most
likely never installs the hook.
- A/B: CC_AGENT_SUMMARY_MODE=pass loads the hook but arms every timer; the summaries come back, which shows the off result is the hook's doing.
- Background processes: daemon, pty host and bg-spare must carry --preload in their environment (/proc/<pid>/environ on Linux); if not, restart the daemon.
- Preload loads: BUN_OPTIONS="--preload $HOME/.local/share/no-agent-summary.js" CC_AGENT_SUMMARY_LOG=/tmp/nas.log claude --version && cat /tmp/nas.log Expect preload active mode=off …. No line: BUN_OPTIONS did not reach the process, or the
path is not absolute.
- Timer suppressed: with the same BUN_OPTIONS and CC_AGENT_SUMMARY_LOG=/tmp/nas.log, run
a background subagent for a minute or two. The log shows summary timer #1 suppressed (setTimeout, delay=30000) and the agent's panel status stops
updating. If you export OpenTelemetry, query_source = agent_summary should stay at zero; this
is the only check that catches every failure mode.
Matching is by source text: an anchor must sit inside the callback passed to the timer. If an update breaks that, the hook matches nothing and summaries silently come back. Ways it can happen:
- the log line or query-source id is renamed;
- the callback is passed via fn.bind(...) (no source in toString) or another wrapper;
- the strings move to a shared constant outside the callback;
- the timer moves to an unwrapped API (timers/promises, a scheduler loop).
So re-run Verify after every update.
- We run it under every Claude Code process on our machine (2.1.301). Since then there have been
zero agent_summary requests, and no other side query grew to take its place.
- Subagents, background agents, forked skills and background sessions run normally; only the summary fork is skipped.
- Visible change: the per-agent panel status stops updating; SDK task_progress has no summary.
- Overhead: one Function.prototype.toString per distinct timer callback, cached in a WeakMap. claude --version: ~10 ms → ~17 ms (one measurement).
Linux x64 binary from npm @anthropic-ai/claude-code-linux-x64 (its sha256 equals the native
installer's manifest.json checksum). Static: the extracted bundle's summary timer callback
carries a hook anchor. Live: claude -p --model haiku with
CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES=1, one subagent doing 8 steps of ~20 s, counting
[AgentSummary] Forking in --debug-file.
5 / 5 / 0 = the fork happens on this version, merely loading the hook changes nothing, and off
removes it.
- The documented switch only turns it on. The SDK option agentProgressSummaries defaults to false, but in the bundle it is one term of an OR, and every code path that writes it sets true. So false changes nothing, and the undocumented CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES can only enable summaries too.
- The interval belongs to the server. It comes from a per-model-family server flag and is clamped to 30–240 s. The default is already the minimum, and no value disables the timer.
- The obvious env vars miss. DISABLE_NON_ESSENTIAL_MODEL_CALLS, which some packagers set,
does not occur in the binary at all. CLAUDE_CODE_FORK_SUBAGENT=0 and CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 do stop it, but only by taking fork subagents or
background agents with it.
- The prompt cache makes it cheaper, not cheap. About 98 % of these calls re-read the transcript from cache; the ~2 % that hit a cold cache carry over a third of its cost.
- Cost tools that read transcripts don't see it. These requests are not written to the session logs on disk (#104358); only the OpenTelemetry export shows them. The docs section on background token usage doesn't list it either, while Agent View's row summaries are documented as a Haiku-class model refreshing every few minutes.
- A cheaper variant already exists, switched off. 2.1.310 ships a short mode: about 2k
tokens of notes instead of the full transcript, optionally written by a smaller model. The
default is still the full transcript, and only server flags can change it.
In our telemetry its weekly share of spend went from 3.5–7 % in July (the fork gate was already open for us) to 7.3 % and then 11.8 % in the week we picked up 2.1.233, and to about 16 % by mid-October.
MIT © 2026 Flamerix AI. Provided as is, without warranty of any kind; you use it at your own risk. Flamerix AI is not liable for any damage, data loss or account action arising from its use. Changing a client's runtime behaviour may conflict with the terms of the service you use it with; checking that is on you.
"Claude" and "Claude Code" are trademarks of Anthropic, PBC. This project is independent and is not affiliated with, sponsored or endorsed by Anthropic.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.