Malhar Ujawane

Inspiration

Inspiration·

Claude Code's background-agent status line has a token bill

Claude Code resends each working background agent's transcript every ~30s for a status line. One team measured 16.4% of spend; Anthropic says ~2%.

Claude Code's background-agent status line has a token bill

Flamerix AI published a gist on October 26 about a side query inside Claude Code that most people never see. While a background agent is working, Claude Code sends that agent’s transcript back to its model every 30 seconds or so, to get a few words for the status line in the agents panel:

Every ~30 seconds, for every background agent, Claude Code sends that agent’s entire transcript to the agent’s own model (usually Opus) and asks it to “describe your most recent action in 3-5 words”. The answer only updates the agent’s status line in the agents panel; it never reaches the model or your conversation.

They found it by grouping Claude Code’s OpenTelemetry claude_code.api_request events by query_source, an attribute the monitoring docs describe as the “subsystem that issued the request”. In their team’s week, agent_summary was 16.4% of Claude Code’s estimated spend and 19.7% of requests, slightly more than the main conversation’s 15.7%. The gist then ships a Bun --preload script that wraps the global setTimeout and swallows the timer whose callback source contains the summarizer’s log line.

Edwin Arbus, who works on Claude Code, answered on Hacker News with Anthropic’s fleet-wide numbers about 80 minutes after the thread went up:

Last week, across Claude Code users who send us telemetry, agent_summary was about 2% of cost at API list prices and just under 4% of requests. In the terminal, where nearly all of these calls happen, it was about 6% of cost.

He also said only actively working background agents get these calls, that a fix for summaries that miss the prompt cache shipped in 2.1.311, and that a cheaper mode sending short notes to a smaller model is in progress. When I checked npm this morning, the latest tag was 2.1.314 and the stable tag was still 2.1.308, which predates that fix.

The gap between 16.4% and 2% comes down to how you work. A team that runs many long background agents pays the most, because each call resends a long transcript, and the gist estimates about 9,000 input tokens per output token. Prompt caching makes that cheaper per token, which is the same lesson as my Gemini 4 Carbon pricing post: the cache-read price decides an agent’s bill. It doesn’t make one in five requests free.

The part I’d act on is visibility. The gist says these requests don’t show up in the session logs on disk, so cost tools that read transcripts can’t see them; only the OpenTelemetry export does. If you’re paying API prices for Claude Code, turn on CLAUDE_CODE_ENABLE_TELEMETRY=1, group by query_source, and look before you patch anything. I wouldn’t roll the setTimeout hook out to a team. It fails open after an update by its authors’ own description, and they warn that changing a client’s runtime may conflict with the service’s terms. I wrote about how long-running agents drift and pile up context in context inertia; this is the billing side of the same habit.

Via Hacker News.

Get new posts in your inbox

© 2026 Malhar Ujawane. Built with Astro.