Claude Code, Anthropic's command-line coding agent, regularly re-sends the entire transcript of each background agent to that agent's own model, according to a GitHub gist that has now been starred more than 200 times. The requests fire roughly every 30 seconds and exist only to produce a short status line in the agents panel. The transcript never reaches the user's conversation, and there is no setting to switch the behavior off.
The finding was published by Flamerix AI under an MIT license and has spread quickly through the tool's large developer community. Because the workaround requires no modification to Anthropic's binary, it is easy to copy and easy to test, which is driving the debate about how agent tooling spends tokens in the background.
What the Claude Code fix does
The gist, titled around a Bun preload that turns agent_summary off, ships a roughly 70-line script called no-agent-summary.js. It hooks the global setTimeout call that Claude Code uses to arm the summary timer and returns an inert handle instead. Timers belonging to other features pass through untouched.
The author explains why a timer hook was necessary. The Claude Code module is shipped as precompiled Bun bytecode, so editing its JavaScript text inside the binary has no effect, and the API client does not route through a wrapped globalThis.fetch. Function.prototype.toString still returns a callback's source even when it runs from bytecode, so the summarizer timer can be recognized by a string inside it.
The inert handle uses a delay of 2³¹−1 milliseconds. Larger values are treated as 1 ms by both Node and Bun, which would make an "infinite" timer fire immediately. The hook installs only when Bun's main entry is the compiled claude CLI and the running executable is a Claude Code install.
How the token drain was measured
Flamerix says the anomaly was detected by DRIM through Claude Code's OpenTelemetry export. Grouping claude_code.api_request events by query_source showed that agent_summary was costing more than the main conversation itself. The author cautions that the figures describe Claude Code's own per-request estimate (cost_usd) rather than an invoice; on a subscription, the loss shows up as rate-limit headroom.



