Oleksandr Kuzmenko, EditorPublished 7 min readAI-assisted · editor-reviewed
TL;DR
- Claude Code sends complete agent transcripts every 30 seconds solely to generate a 3-5 word status string.
- The requests appear in OpenTelemetry as query_source = agent_summary and bypass normal transcript logging.
- Preloading a timer hook via BUN_OPTIONS stops summary requests without breaking agent execution.
Key facts
- Token spend share
- ~15–20% of tokens on agent summaries
- Polling frequency
- Every ~30 seconds (clamped to 30–240 s)
- Affected releases
- Claude Code 2.1.257–2.1.312 (default since 2.1.232)
- Cache behavior
- 98% read from cache; 2% cold cache accounts for >33% cost
The Hidden Token Drain
By default since version 2.1.232, Claude Code runs an internal timer every 30 to 240 seconds for each active background agent. This timer gathers the agent's full transcript and instructs the model (typically Opus) to describe the latest action in three to five words for the agent panel's UI status line. In OpenTelemetry exports, these calls appear as claude_code.api_request events marked with query_source = agent_summary. In heavy multi-agent workflows, these status pings can account for 15% to 20% of your total token spend, directly eating away at your API rate limits.
Why Standard Flags Fail
The undocumented environment flag CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES and the SDK setting agentProgressSummaries cannot turn the feature off: in the compiled binary, the parameter is part of an OR expression where internal paths force it to true. Furthermore, DISABLE_NON_ESSENTIAL_MODEL_CALLS does not exist in the binary, and modifying strings inside the executable fails because Claude Code runs as precompiled Bun bytecode.
Suppressing the Timer with Bun Preload
The fix relies on BUN_OPTIONS=--preload pointing to a minimal wrapper (no-agent-summary.js). The script intercepts setTimeout and setInterval calls, inspects Function.prototype.toString() for the [AgentSummary] log anchor, and replaces the callback delay with an inert 2^31 - 1 millisecond wait. After saving the script, kill the daemon using claude daemon stop --any so that all newly spawned processes and pre-warmed background sessions inherit the hook.
Try it in 2 minutes
curl -fsSL https://gist.githubusercontent.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce/raw/no-agent-summary.js -o ~/.local/share/no-agent-summary.js
export BUN_OPTIONS="${BUN_OPTIONS:+${BUN_OPTIONS} }--preload $HOME/.local/share/no-agent-summary.js"
claude daemon stop --anyWhen to use
- You run background subagents or multi-agent workflows in Claude Code.
- You frequently hit rate-limit errors or monitor token usage via OpenTelemetry.
When NOT to use
- You rely on real-time text descriptions of subagent actions in the CLI agent view panel.
- You run on Windows where Bun virtual filesystem paths (/$bunfs/) are untested.
What to do today
- Download no-agent-summary.js and store it in ~/.local/share/no-agent-summary.js
- Export BUN_OPTIONS="--preload $HOME/.local/share/no-agent-summary.js" in your shell profile
- Run claude daemon stop --any to restart the background runner with the hook enabled
Step names are taken from What to do today.
Step names are taken from What to do today. Download no-agent-summary.js and store it in ~/.local/share/no-agent-summary.js. Export BUN_OPTIONS="--preload $HOME/.local/share/no-agent-summary.js" in your shell profile. Run claude daemon stop --any to restart the background runner with the hook enabled
- Download no-agent-summary.js and store it in ~/.local/share/no-agent-summary.js
- Export BUN_OPTIONS="--preload $HOME/.local/share/no-agent-summary.js" in your shell profile
- Run claude daemon stop --any to restart the background runner with the hook enabled
What the community says
Of course it is for profit. Tokens cost money. Just the energy cost alone. I don't understand this "analysis". Why would it not be about profit?
The way I think of it is that "20x" means "You get up to 20 tokens for each 1 if you run your limits down". For example last week I put $1400 thru my Anthropic enterprise $200 plan.
