Xtrusio Claude Code token test kit
Made by Xtrusio for the page https://xtrusio.com/blog/claude-code-cost
Prices read on 24 November 2026. List prices in US dollars per million tokens.

What is inside
- xtrusio-claude-code-token-test-worksheet.xlsx: Excel file with live formulas.
  Prices: list prices for Claude Sonnet 5.5, Opus 5.5 and Haiku 5.5; pick your model in the yellow cell.
  Without plugin / With plugin: one row per run (four token counts and pass or fail).
  Result: median, spread, cost per passed run, and a plain verdict.
  Overhead: how many chat turns a plugin's always-on text needs before it pays for itself.
  Example (made up): the invented numbers used on the page. It is not a test result.
- xtrusio-claude-code-token-test-worksheet.csv: the made-up example as plain values.
- sum_runs.py: a small Python 3 script (standard library only). It reads the JSON files that
  claude -p --output-format json writes and prints the same table as the Result sheet.

How to use sum_runs.py
1. Save each run as <task>__without__1.json, <task>__with__1.json, and so on:
   claude -p "<your task>" --output-format json > tests/fix-login__without__1.json
2. python sum_runs.py tests
3. To use your own pass/fail from your test suite, add --success success.csv (lines like: fix-login__with__1.json,1).
   Without that file every run that did not report an error counts as passed. That is NOT a quality check.
The script reads total_cost_usd, usage.input_tokens, usage.output_tokens, usage.cache_creation_input_tokens,
usage.cache_read_input_tokens, num_turns and is_error. We checked those names against the output of Claude Code 2.1.312 on 24 November 2026.
If your version names them differently the script says so and stops.

Limits
- total_cost_usd is a client-side estimate at list price, not your bill (Anthropic's docs say so).
- The saving rule is a rule of thumb, not a statistical test. The minimum of five runs per arm is our suggestion.
- The Overhead sheet assumes the plugin text sits in the cached part of the prompt and every turn is inside the cache lifetime.
- No private data is in this kit. The numbers in the example are invented.
