Find a hidden token cost in Claude Code by grouping OpenTelemetry events by source
by PaperChaseWebb
A team grouped Claude Code's OpenTelemetry API request events by query source and found that the status-line summaries for background agents cost more than their main conversation. They published a measured write-up and an unofficial preload that turns the timer off, with an A/B switch to prove the effect.
- Price
- Free
- Difficulty
- Advanced
- Setup
- 1 hr
- Format
- .md file
find-a-hidden-token-cost-in-claude-code-by-grouping-opentelemetry-events-by-source.md · 3 KB · direct download, no signup
What you end up with
The lasting lesson is the measurement: the cost did not show in transcript-based cost tools, only in OpenTelemetry grouped by query source.
What you get
- A plain-language summary of the workflow
- A fill-in prompt template
- What to watch out for
- A link to the original source
Who it is for
Builders who already use AI agents and want a proven workflow they can copy into their own project.
Works with
Solid chips: the agent is named in this listing's own tools list. Dashed chip: Plain Markdown, so it also pastes into other agents such as Grok Bot, Hermes, OpenClaw or Muse. We list those as compatible by format only, not as tested.
Tools needed
Cost to run: Free with the agent plan you already use.
Time to result: One working session
How it works
Turn on Claude Code's OpenTelemetry export for your own sessions
Turn on Claude Code's OpenTelemetry export for your own sessions.
Expected: Done before you move to the next step.
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.
Expected: Done before you move to the next step.
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.
Expected: Done before you move to the next step.
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.
Expected: Done before you move to the next step.
Re-measure after every update, since the numbers and code paths change
Re-measure after every update, since the numbers and code paths change.
Expected: Done before you move to the next step.
Sample prompt from the pack
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.
Adapted by PaperChaseWebb. Not the original author's prompt.
Free preview of the file
# 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.
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.
- Figures are as reported by the original author and were not re-measured by us.
Questions
Where does this come from?
A public post credited to Flamerix AI. Source: https://gist.github.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce
Is it free?
Yes. Feed entries are free to read and download.
Details
Version 1.0 · Updated Oct 29, 2026 · Markdown version of this page
License: Personal and commercial use. Credit the original source when you share the workflow. Download terms
Related

AGENTS.md, CLAUDE.md and Cursor rules starter files
Six fill-in instruction files for coding agents (base, Next.js plus Supabase, FastAPI, browser game, CLAUDE.md pointer, scoped Cursor rules), an Approvals section that makes the agent stop and wait for your yes, a table of what Grok Bot, Claude Code, Codex, Hermes and Cursor each read, a read-only checker for your rule files and 9 prompts to write, trim and test your own.

Ask-first rules for AI agents: hard nos, approval cards and a test set
Paste-in rules that make an agent ask before it sends, spends, posts or deletes, define what a real yes is, and stop retries after a no, plus 12 test scenarios to check it.