Skip to content

Back to the catalog

Claude Code regularly sends each background agent’s transcript to its model
gist.github.comwriteup

Claude Code regularly sends each background agent’s transcript to its model

no-agent-summary.js is a roughly 70-line Bun preload by Flamerix AI that stops Claude Code from re-sending each background agent's full transcript to its model every ~30 seconds for a status-line summary. The write-up cites OpenTelemetry measurements of 18 to 26 percent of spend (since version 2.1.232), explains the setTimeout hook, and gives install and verify steps. It was tested on Linux with Claude Code 2.1.257 to 2.1.312.

TL;DR Shows Claude Code's default background-agent summary calls cost a large share of spend, and offers a Bun preload that disables the timer.
Document

What it claims

no-agent-summary.js (MIT, Flamerix AI) is a Bun preload that disables the agent-summary timer in Claude Code. In interactive sessions, Claude Code sends each background agent's full transcript to that agent's own model (usually Opus) every ~30 seconds, asking it to "describe your most recent action in 3-5 words". The answer only updates the agents panel. No supported setting turns it off:

  • The SDK option agentProgressSummaries defaults to false, but it is one term of an OR that every code path sets to true. Setting it to false changes nothing.
  • The undocumented CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES can only enable summaries.
  • The interval comes from a per-model-family server flag clamped to 30–240 s. The default is already the minimum.
  • DISABLE_NON_ESSENTIAL_MODEL_CALLS does not appear in the binary.
  • CLAUDE_CODE_FORK_SUBAGENT=0 and CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 stop it, but only by also disabling fork subagents or background agents.

How it works

The module ships as precompiled Bun bytecode, so editing its JS inside the binary has no effect. The API client also bypasses globalThis.fetch. However, Function.prototype.toString still returns callback source under bytecode.

The hook works in four steps:

  1. It wraps only the global setTimeout.
  2. It checks each callback's source for a summarizer anchor, such as the [AgentSummary] Timer fired log line.
  3. On a match, it returns an inert handle with a delay of exactly 2³¹−1 ms. Node and Bun treat larger delays as 1 ms, so a larger "infinite" delay would fire at once.
  4. All other timers pass through unchanged.

The hook installs only when Bun.main is /$bunfs/root/cli and process.execPath is a Claude Code install. In any other Bun process, the file loads and does nothing.

Evidence

Spend figures are Claude Code's own cost_usd estimates from OpenTelemetry, not invoices. On a subscription, the cost shows up as lost rate-limit headroom.

  • Issue #86879 collects four independent measurements of 18–26 % of spend.
  • In the authors' telemetry, the weekly share was 3.5–7 % in July 2026. It rose to 7.3 %, then 11.8 % in the week they picked up 2.1.233, and about 16 % by mid-October.
  • About 98 % of these calls read the transcript from prompt cache. The ~2 % that hit a cold cache account for over a third of the cost.
  • These requests are not written to on-disk session logs (#104358), so transcript-based cost tools miss them.
  • Since the authors began running the hook on 2.1.301, they have seen zero agent_summary requests, and no other side query grew to replace them.
  • Startup overhead: claude --version went from ~10 ms to ~17 ms in one measurement.

How to use it

curl -fsSL https://gist.githubusercontent.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce/raw/no-agent-summary.js -o ~/.local/share/no-agent-summary.js
claude daemon stop --any
BUN_OPTIONS="${BUN_OPTIONS:+$BUN_OPTIONS }--preload=$HOME/.local/share/no-agent-summary.js" claude

For a permanent install, export the variable in a shell profile:

export BUN_OPTIONS="${BUN_OPTIONS:+$BUN_OPTIONS }--preload=/abs/path/no-agent-summary.js"

The page also gives fish, systemd environment.d and claude wrapper-script variants. Three setup details matter:

  • Use the = form. BUN_OPTIONS reaches every bun on the machine, and the space form breaks bun subcommands (bun install fails with Script not found "install").
  • Restart the daemon. The daemon, pty host and bg-spare sessions inherit the environment of whichever client started the daemon. Run claude daemon stop --any after installing.
  • Cover headless runs too. claude -p, cron, CI and editor integrations need the variable. Note that claude -p does not arm the timer by default.

To check that the preload loads:

BUN_OPTIONS="--preload=$HOME/.local/share/no-agent-summary.js" CC_AGENT_SUMMARY_LOG=/tmp/nas.log claude --version && cat /tmp/nas.log

The log should show preload active mode=off. After running a background subagent for a minute or two, it should also show summary timer #1 suppressed (setTimeout, delay=30000).

The only check that catches every failure is OpenTelemetry: query_source = agent_summary should stay at zero. For an A/B test, CC_AGENT_SUMMARY_MODE=pass loads the hook but arms every timer.

Limits

Matching is by source text, so an update can silently bring summaries back. This happens if the anchor strings are renamed or moved to a shared constant, if the callback is passed via fn.bind, or if the timer moves off the global setTimeout. Verification must be re-run after every update.

Testing covers Linux x64 with Claude Code 2.1.257–2.1.312. macOS darwin-arm64 is reported working by others, and Windows is untested. Installing with npm --ignore-scripts leaves a shell stub, so the hook never runs.

When upgrading from v2, do not leave a v2 path in BUN_OPTIONS. v2 has no guard against double loading.

With the hook active, the per-agent panel status stops updating and SDK task_progress carries no summary. Version 2.1.310 ships an unused cheaper "short mode" (~2k tokens of notes), which only server flags can enable.

The licence disclaims liability, including for account action. It warns that changing client runtime behaviour may conflict with the service's terms.

Organisations named here

  • Anthropic
  • Anthropic, PBC
  • Claude Code
  • DRIM
  • Flamerix AI

Technologies named here

  • Opus
  • Claude Code
  • Haiku
  • Bun
  • OpenTelemetry
  • Agent View
  • Claude Code SDK
  • claude daemon
  • Linux
  • macOS
  • no-agent-summary.js
  • npm @anthropic-ai/claude-code-linux-x64

Techniques named here

  • Prompt caching
  • Bun preload timer hook
  • OpenTelemetry cost attribution by query_source