Submit

Claude Code's agent_summary burns up to 20% of agent tokens

Flamerix AI's Bun preload disables Claude Code's undocumented agent_summary query, found burning 15-20% of tokens in background-agent sessions.

Written by AiAgentsListing Team

Claude Code's agent_summary burns up to 20% of agent tokens

What happened

On 29 October 2026, the independent research group Flamerix AI published a Bun preload script that disables an undocumented background query inside Claude Code called agent_summary. Flamerix found the query, via Claude Code's own OpenTelemetry export, costing more of a session's estimated spend than the main conversation itself. The Hacker News thread about the finding reached 563 points and 228 comments within a day.

agent_summary is a background query Claude Code has sent every 30 seconds per active background agent since version 2.1.232 (13 August 2026), asking that agent's own model to describe its last action in three to five words for the status line. Flamerix AI measured it consuming 16.4% of all Claude Code token spend in a one week sample, before a fix brought that to zero.

Update, 9 November 2026: Anthropic has since responded and shipped a fix. A Claude Code team member said on Hacker News on 29 October that, across users who send telemetry, agent_summary was "about 2% of cost at API list prices" and, in the terminal, "about 6% of cost". On 4 November Anthropic said that Haiku 5.5 now writes the status line from short notes instead of re-reading the agent's whole conversation, so "each update costs about 99% less", in Claude Code v2.1.316 and later. Claude Code 2.1.318 also has an off switch, CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES=1, which users found in the binary; it is not in the changelog or the environment variable docs.

What changed

Flamerix AI's fix cut agent_summary requests to zero within two days of installing it, after measuring what the query had been costing:

  • In the week before the fix, agent_summary accounted for 16.4% of Claude Code's estimated spend (the main conversation itself ran 15.7%) and 19.7% of all API requests, about one in five. Flamerix AI says 96% of that spend ran on Opus, at roughly 9,000 input tokens for every output token.
  • A GitHub feature request, issue #86879, filed in August 2026 by a separate user, measured the same query at 22.7% of API requests and 18% of weighted token cost in one 4 hour session with 27 subagents. That issue also found the call is architecturally separate from the agent it describes: it forks context, denies all tools, caps at one turn, and never re-enters the agent's own history.
  • The fix, no-agent-summary.js, is a roughly 70 line Bun --preload script. It does not modify the Claude Code binary. It wraps the global setTimeout function and refuses to arm the specific timer that fires the summary request, which it recognizes by matching text inside that timer's callback.
  • By Flamerix AI's own version testing, the summary code first appeared in Claude Code 2.1.32 (5 February 2026), became reachable in the interactive CLI by 2.1.117 (21 April 2026), and went on by default for background agents in 2.1.232 (13 August 2026). Version 2.1.310 (23 October 2026) added a cheaper mode that sends roughly 2,000 tokens of notes instead of the full transcript, but it shipped switched off. On 4 November 2026 Anthropic rolled out a cheaper status line for Claude Code v2.1.316 and later: Haiku 5.5 writes it from short notes, each update costs about 99% less, and it is live for most Pro, Max and Ultra users and everyone on Team and Enterprise.
  • These requests carry skipTranscript: true, so they never appear in Claude Code's own session logs on disk. Only an OpenTelemetry export shows them; a second GitHub issue, #104358, tracks that gap in cost visibility.

Why it matters for agent builders

Agent builders pay for agent_summary in proportion to how many background agents are running and for how long, not to the work those agents do. Before the 4 November fix, a session with three concurrent long-running subagents paid six of these calls every minute, each resending that agent's full transcript. On a metered API key that is direct spend; on a Claude subscription plan it eats the rate-limit headroom a developer would otherwise use for real agent turns. Because the calls skip the transcript, a team's own cost dashboards understate real usage by this amount unless they read the OpenTelemetry export directly.

What to watch

Whether Anthropic documents an official way to turn agent_summary off is the open question. Claude Code 2.1.318 has CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES=1, which Flamerix AI found in the binary and another user confirmed works; Flamerix AI says it is absent in 2.1.317 and earlier, and it is not in the changelog or the environment variable docs, though an Anthropic employee pointed to it when closing issue #86879 on 9 November 2026. On older versions the fix is still the unofficial script. Flamerix AI is explicit that its tool is independent and not affiliated with Anthropic, and the fix depends on matching a specific string inside a compiled callback, which an unrelated Claude Code update can silently break; Flamerix AI's own changelog shows the matching logic already changed twice since the gist was first published. Anthropic's 4 November update made each summary about 99% cheaper but does not turn the query off. A Hacker News commenter also asked whether the same query runs when Claude Code is driven through the Claude Agent SDK or ACP rather than the interactive CLI; that remains unanswered.

Key takeaways

  • From version 2.1.232 (13 August 2026), Claude Code sent a full transcript of every active background agent to that agent's own model every 30 seconds, solely to generate a 3 to 5 word status line.
  • Flamerix AI measured agent_summary at 16.4% of all Claude Code token spend and 19.7% of all API requests in a one week sample, before its fix brought that to 0%. Anthropic says that across users who send telemetry it was about 2% of cost at API list prices, and about 6% in the terminal.
  • Claude Code 2.1.318 added an undocumented off switch, CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES=1, found in the binary by users; on 2.1.317 and earlier the only fix is an independent, unofficial Bun preload script.
  • These calls are excluded from Claude Code's own transcripts and session logs, so transcript-based cost tools can understate real token usage by this amount.
  • On 4 November 2026 Anthropic said Haiku 5.5 now writes the status line from short notes, so each update costs about 99% less in Claude Code v2.1.316 and later.

FAQ

What is Claude Code's agent_summary query?

It is a background request Claude Code sends roughly every 30 seconds for each running background agent, asking that agent's model to describe its last action in three to five words. The text only updates the status line in the agents panel; it never reaches the main conversation or the agent's own context. Since Anthropic's 4 November 2026 update (v2.1.316 and later), Haiku 5.5 writes that line from short notes instead of the agent's whole conversation.

How much does agent_summary cost in tokens?

Measurements vary by session shape. Flamerix AI recorded 16.4% of total Claude Code spend and 19.7% of API requests over a one week sample in October 2026; GitHub issue #86879, filed in August 2026, recorded 22.7% of requests and 18% of weighted cost in a single 4 hour, 27-subagent session. Anthropic says that across users who send telemetry it was about 2% of cost at API list prices and about 6% in the terminal, and that its 4 November update makes each summary about 99% cheaper.

Can I turn off agent_summary today?

On Claude Code 2.1.318 or later, setting CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES=1 turns the summaries off. Users found it in the binary and it is not in the changelog or the environment variable docs, so treat it as undocumented; Flamerix AI says to set it to exactly 1. On 2.1.317 and earlier, Flamerix AI's no-agent-summary.js is an independent, MIT-licensed Bun preload script that disables the query without modifying the Claude Code binary. It is unaffiliated with Anthropic and can silently stop working after a Claude Code update, so Flamerix AI recommends re-verifying it after every upgrade.

Source: Flamerix AI Discussion: Hacker News

Developers comparing Claude Code against other coding agents and their background-task behavior can browse the current options in the agent directory on AI Agents Listing.

Share:

Subscribe to our newsletter

One email a week. New agents, MCP servers and skills, and what is actually getting traction.

More news

  1. ClawDOS ships as an open source AI coding agent for DOS

    ClawDOS is an open source AI coding agent harness running Claude's Messages API on a real 1980s IBM PC, posted to Hacker News on 21 November 2026.

  2. Turbo-Browser-MCP ships as an 11-tool Playwright MCP server

    Turbo-browser-mcp is a new open-source Playwright MCP server with 11 tools that batches browser actions to cut token use and model turns for AI agents.

  3. Windows 11 diagnostics flag Claude Code, Codex and Cursor

    A Windows 11 component called MissionControlAggregator checks for Claude Code, Codex, Cursor and other coding agents, researcher Xusheng Li found on 16 November 2026.