# Find a hidden token cost in Claude Code by grouping OpenTelemetry events by source

PaperChase agent use case (free feed entry), version 1.0. Source: [Flamerix AI](https://gist.github.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce), 2026-10-28.

## What they did

Every 30 seconds or so, for each background agent, Claude Code re-sends that agent's transcript to the model to get a three to five word status line. In their telemetry that source was about 16 percent of Claude Code spend and about one in five API requests the week before the change. They wrote a small preload that recognises the summary timer and skips it, with a pass mode that loads the hook but changes nothing, and a verify step to run after every update. Four other people reported 18 to 26 percent in an issue thread.

## Worth knowing

The lasting lesson is the measurement: the cost did not show in transcript-based cost tools, only in OpenTelemetry grouped by query source. The preload itself is unofficial, changes the client's runtime behaviour, can silently stop working after an update and may conflict with the service's terms, so measure first and decide with care. Turning off background agents also stops it, at the price of losing them.

## Workflow template

```text
Apply this workflow to [your project]:
1. Turn on Claude Code's OpenTelemetry export for your own sessions.
2. Group api_request events by query_source and compare their share of cost.
3. If one side query is large, note your version and how you use background agents.
4. Read the write-up's A/B and verify steps before trying any workaround, and check the terms of service.
5. Re-measure after every update, since the numbers and code paths change.
Stop and ask me before anything irreversible: deploys, payments, sends or deletes.
```

## Steps

1. **Turn on Claude Code's OpenTelemetry export for your own sessions.** Turn on Claude Code's OpenTelemetry export for your own sessions.
2. **Group api_request events by query_source and compare their share of co.** Group api_request events by query_source and compare their share of cost.
3. **If one side query is large, note your version and how you use backgrou.** If one side query is large, note your version and how you use background agents.
4. **Read the write-up's A/B and verify steps before trying any workaround,.** Read the write-up's A/B and verify steps before trying any workaround, and check the terms of service.
5. **Re-measure after every update, since the numbers and code paths change.** Re-measure after every update, since the numbers and code paths change.

## Credit

Workflow reported by Flamerix AI: https://gist.github.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce
Related: https://news.ycombinator.com/item?id=50284255

Summary and template written by PaperChaseWebb in our own words. Questions: mgmt@paperchasewebb.com
