DEV Community

Cover image for Claude Code Usage Limit Hit Fast? How to Stop Background Agents Burning Tokens
Alan West
Alan West

Posted on Originally published at blog.authon.dev

Claude Code Usage Limit Hit Fast? How to Stop Background Agents Burning Tokens

If your Claude Code usage limit runs out by mid-afternoon and you use background agents, check this first. About every 30 seconds, each working background agent sends its entire transcript to its own model, usually Opus, and asks it to "describe your most recent action in 3-5 words." The answer becomes the little status label in the agents panel.

One team's telemetry, published in this gist, puts those calls at 16.4% of their total Claude Code spend for a week. Their main conversation came to 15.7%. So the status labels cost them more than the conversation they were actually having with Claude. The gist also links issue #86879, which it says collects four other measurements of 18–26%.

What the gist captured

The numbers come from Claude Code's own OpenTelemetry export. Every claude_code.api_request event has a query_source attribute, and grouping by it showed one source called agent_summary that was far bigger than it had any reason to be:

Metric Week before fix 2 days after
Share of Claude Code spend 16.4% 0%
Share of API requests 19.7% 0%
Share of that spend on Opus 96% n/a
Input tokens per output token ≈ 9,000 : 1 n/a

That 9,000 : 1 ratio is the giveaway. A huge input (the whole transcript) goes in, and a four-word label comes out.

Some details from the gist:

  • Each background agent sends a summary request about every 30 seconds, and it goes to that agent's own model, which is usually Opus. A server flag sets the interval within 30–240 s, and the default is already the minimum.
  • Summaries have been on by default since 2.1.232 (August 2026). A cheaper short mode, which sends about 2k tokens of notes instead of the transcript, showed up in 2.1.310 but only server flags can turn it on.
  • About 98% of these calls read the transcript from the prompt cache. The other 2% miss it, and according to the gist those misses are over a third of the cost.
  • The SDK's documented agentProgressSummaries option and the undocumented CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES env var can only turn summaries on. Neither one turns them off.

Anthropic says 2%, and both numbers can be true

An engineer who works on Claude Code replied in the Hacker News thread. Across users who send telemetry, agent_summary was about 2% of cost at API list prices last week and just under 4% of requests. In the terminal, where nearly all of these calls happen, it was about 6% of cost. They said the 16.4% "sounds like it was for a team running mostly background agents," that idle agents don't trigger summaries, and that Claude Code itself uses the summaries to track what each agent is doing. A fix for summaries that miss the prompt cache rolled out in 2.1.311+, and a cheaper mode that sends short notes to a smaller model is in progress. Their words: "That said, we agree that's a lot for a status line."

I believe the 2%. I also think it's the wrong number to look at. A fleet average includes everyone who never opens a background agent. My guess is that the people searching "Claude Code usage limit reached" are heavy users running several agents in parallel, and they're the ones paying most of this overhead. In the same thread, one commenter on a 20x Max plan had Opus estimate it from their transcripts: about $380 in hidden status-label calls on top of $1,970 API-equivalent spend for the week, 16% of the true total. Another measured "~8% at most."

My view: a background job that costs this much should be a setting you can turn off, and it should not have shipped on by default. One commenter quoted the docs, which say status lines "do not consume API tokens." That's about the configurable status line at the bottom of the terminal, not the agent labels, so it doesn't help you here.

What it costs per hour with N agents

The gist doesn't give per-call token counts, so here's rough math using Anthropic's published prices. The numbers are assumed and you should plug in your own.

Opus 5.5 costs $4/MTok base input, $5/MTok for a 5-minute cache write, and $0.20/MTok for a cache hit. Say an agent's transcript is 100k tokens, with the gist's 98% cache-hit rate:

  • Cache hit: 100k × $0.20/MTok = $0.02
  • Cache miss (rewrite): 100k × $5/MTok = $0.50
  • Blended: about $0.03 per summary, with the 2% of misses making up about a third of it (which matches the gist)
  • At one call every 30 s, that's 120 calls an hour, or about $3.55 per agent per hour
Active background agents Summary cost / hour (API-equivalent)
1 ~$3.55
3 ~$10.65
5 ~$17.75
8 ~$28.40

On Pro or Max you aren't billed in dollars, but your limit is measured against usage like this. Two things make it worse over time. Transcripts grow as agents work, so each summary gets more expensive. And every summary that misses the prompt cache pays the full cache-write price, which is the case Anthropic says it fixed in 2.1.311+.

How to stop Claude Code burning tokens on background agents

Ordered from least to most invasive.

1. Measure first

Turn on the console exporter described in the monitoring docs:

export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_LOGS_EXPORTER=console
claude
Enter fullscreen mode Exit fullscreen mode

Look for claude_code.api_request events with query_source set to agent_summary, and add up cost_usd. Use the events for this, because the token and cost metrics only carry a coarse main / subagent / auxiliary category. If you'd rather check the network side, put a local intercepting proxy in front of claude and count requests per agent every 30 seconds. OTel gives you the same answer with less setup.

2. Update

You want 2.1.311 or newer for the cache-miss fix. Run claude --version.

3. Run fewer agents at once

The cost goes up linearly with active agents: five agents working at once means five summary calls every 30 seconds. Running the same work one agent after another doesn't remove those calls, but it spreads them out instead of piling them into the same rate-limit window.

4. Keep agents short-lived

Idle agents don't trigger summaries, but a long-running agent with a 150k-token transcript gets resent at full size every 30 seconds. Give agents narrow tasks that finish.

5. Put background agents on a cheaper model

The summary goes to the agent's own model. If a subagent doesn't need Opus, set model: sonnet in its definition. Opus 5.5 cache hits cost $0.20/MTok and Sonnet 5.5 costs $0.10/MTok, so that alone halves the summary cost.

6. Run /compact more often

Every token you trim from a transcript stops being resent 120 times an hour. While you're in /config, look at idleCompaction. One commenter suggested making sure it's off, because new features have been switched on by default for them before, though they weren't sure this one shipped that way.

7. The blunt switch

According to the gist, CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 stops the calls because it disables background agents entirely. CLAUDE_CODE_FORK_SUBAGENT=0 does the same for forked subagents. They work, but you lose the feature.

8. The unofficial hook

The gist ships a Bun preload script that suppresses only the summary timer:

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
Enter fullscreen mode Exit fullscreen mode

Read the script before you run it, which is normal practice for anything you curl from a gist. It was tested only on Linux with 2.1.257–2.1.312. It works by matching source-text anchors, so any update can break it silently. Set CC_AGENT_SUMMARY_LOG to a file path to get a log, and after every upgrade check it for preload active mode=off, then summary timer #1 suppressed. Expect a status panel with no labels. One gist commenter reports that --preload /path (with a space) breaks Bun subcommands like bun install on Bun 1.4.3, and that --preload=/path works.

One thing that probably won't help: someone in the thread asked whether disableAgentView stops the calls or only hides the panel. Nobody answered. The gist also says DISABLE_NON_ESSENTIAL_MODEL_CALLS doesn't appear in the binary, so don't count on it.

The checklist

  • claude --version shows ≥ 2.1.311
  • OTel on, agent_summary share checked
  • At most 2–3 parallel background agents unless you've measured the cost
  • Subagents that don't need Opus set to model: sonnet
  • /compact long transcripts
  • If you use the preload hook, check its log after every update

I'd rather have an agentSummaries: off setting than any of this. Until Anthropic ships the cheaper mode or a real toggle, it's on you.

So, if you have OTel on: what share of your spend is agent_summary, and how many background agents were you running? Post the number even if it's tiny. I want to know whether the 2% average or the 16–26% reports are closer to what most of you see.

Sources

Top comments (0)