Claude Code spends up to a fifth of your tokens on a three-word status line
Translated by a model; the original is in Russian.
Flamerix AI has published a GitHub Gist that dissects an easy-to-miss Claude Code feature and offers a small script to disable it. The feature is agent_summary. Roughly every 30 seconds, for every background agent, the client 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 status line in the agents panel. It never reaches the conversation or the model. There is no setting to turn it off, and since version 2.1.232 (August 2026) it has been on by default.
The numbers
The anomaly showed up in the OpenTelemetry export. When the authors grouped claude_code.api_request events by query_source, agent_summary turned out to account for 16.4% of all Claude Code spend over a week. The main conversation came to 15.7%. The feature also made up 19.7% of requests, about one in five. 96% of that spend went to Opus, at roughly 9,000 input tokens per output token. "Spend" here is the client's own estimate (cost_usd), not an invoice. On a subscription, what you lose is rate-limit headroom. Issue #86879 collects four more independent measurements, ranging from 18% to 26%.
Why you can't just switch it off
The documented switch can only turn the feature on. The SDK option agentProgressSummaries defaults to false, but in the code it is one term of an OR, and every path sets it to true. The interval is controlled by the server and clamped to 30–240 seconds, and the default is already the minimum. The DISABLE_NON_ESSENTIAL_MODEL_CALLS variable doesn't appear in the binary at all. Some flags do stop the summaries, but only by disabling fork subagents or background agents altogether.
The prompt cache helps only partly. About 98% of calls read the transcript from cache, but the remaining 2% that hit a cold cache account for over a third of the cost. Cost tools that read session logs can't see these requests: they aren't written to disk, and only OpenTelemetry shows them. Meanwhile, version 2.1.310 already ships a cheaper mode that sends the model about 2k tokens of notes instead of the full transcript. It is switched off, and only server flags can enable it.
How the workaround works
no-agent-summary.js is about 80 lines long. It is a Bun preload script loaded via BUN_OPTIONS=--preload, so the binary itself is not modified. The script wraps setTimeout and setInterval. If a callback's source text contains a telltale string such as [AgentSummary] Timer fired, the timer is never armed. All other timers pass through untouched. The callback has to be identified by its text because the module ships as precompiled Bun bytecode, yet Function.prototype.toString still returns the source. The "forever" delay is exactly 2³¹−1 ms: Node and Bun treat anything larger as 1 ms, so the timer would fire immediately.
The script has been tested on Linux with versions 2.1.257 through 2.1.312. macOS and Windows are untested. The authors warn plainly that any update could silently bring the summaries back and recommend re-checking after every upgrade. The only visible effect of the hook is that an agent's status in the panel stops updating.
According to the authors' telemetry, the feature's share of spend grew from 3.5–7% in July to about 16% by mid-October. The script is released under the MIT license. The authors note separately that changing a client's behavior may conflict with the service's terms of use.
Source: Hacker News
Comments
Sign in, to comment.