AI NewsDev toolsAnnouncement

Claude Code quietly spends 16 percent of your tokens on a status line

A measured note on GitHub says Claude Code's background agent summary costs 16 to 20 percent of a user's tokens. A short preload hook turns it off.

AI News

Editorial3 min read

LinkedInX
GitHub Gist social card for the Flamerix AI note on Claude Code's agent-summary token cost.

Image: GitHub

Why it mattersMany Claude Code users pay a Max plan for the Opus limits. One in five of those Opus calls now goes to a feature nobody reads.

A fifth of your Claude Code bill may be going to a line of text you never read. On 29 October, a note by Flamerix AI on a public GitHub Gist drew 135 points on Hacker News. The author writes as DRIM. They say Claude Code sends every background agent's full transcript back to its own model every 30 seconds. The model is asked to describe its last action in three to five words. The answer only updates the agent's status line.

The author measured the cost in Claude Code's own OpenTelemetry export. They grouped claude_code.api_request events by query_source. In the week before the author's hook, the agent_summary bucket was 16.4 percent of their total Claude Code cost. Main-conversation requests were 15.7 percent. Agent-summary requests were 19.7 percent of all requests. 96 percent of that bucket ran on Opus. Input tokens were about 9,000 for every output token.

What the author's hook does

The author published a Bun preload script under MIT, about 80 lines. It wraps setTimeout and setInterval. When a callback's source text has a summarizer anchor, the wrapper returns an inert handle. Every other timer passes through. The author tested it against six versions of Claude Code between 2.1.257 and 2.1.312. The hook stopped the summaries on every one of them.

The author also calls out two reasons the setting is hidden. The documented agentProgressSummaries flag only turns summaries on. The interval comes from a per-model-family server flag, clamped to 30 to 240 seconds. The default is the minimum. No value disables the timer.

Why the cost is not in the usual places

The 30-second summary calls are not written to the on-disk session logs. The author links Claude Code issue 104358 as the open bug for that. Only the OpenTelemetry export shows them. Tools that read ~/.claude/projects/.../transcripts/ to attribute token cost will not see this bucket at all.

The author also says a prompt-cache hit on the transcript covers about 98 percent of the calls. The 2 percent of cold-cache calls still carry about a third of the bucket's cost. The author also links Claude Code issue 86879. It collects four independent measurements of the same overhead at 18 to 26 percent.

What to do with this

Any Claude Code user with telemetry on can run the same group-by. If the agent_summary share is small, the fix has little effect. If it is near the 16 percent the author saw, the fix is one preload line in a shell file. The author's own install needs a daemon restart to reach the pre-warmed bg-spare sessions.

For a buyer who pays a Max plan for the Opus limits, the number matters a second way. Anthropic sets usage limits in session windows. A background summary that reads the whole transcript burns through that window with no visible result. A user hitting an Opus limit in the middle of a long run has one more place to look.

For Anthropic, the gist is a reproducible complaint on a current default. The author is clear that a model update could silently restart the fork by renaming one log line. That is not a long-term fix, which is the author's point.

Source

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project