IssueRaiser

CC v2.1.100+ inflates cache_creation by ~20K tokens vs v2.1.98 — same payload, server-side

## Summary Claude Code versions 2.1.100 and 2.1.101 consume ~20,000 more `cache_creation_input_tokens` per request than v2.1.98, despite sending **fewer bytes** in the request payload. The inflation is server-side and version-specific (likely User-Agent routing). This is not a billing-only issue — these tokens enter the model's context window and may affect output quality. ## Reproduction ```bash # 1. Install proxy to capture full API request/response bodies mkdir /tmp/cc-test && cd /tmp/cc-test npx -y claude-code-logger@1.0.2 start --port 8000 --log-body --merge-sse # 2. In another terminal — test with older version export ANTHROPIC_BASE_URL="http://localhost:8000" claude-2.1.98 --print "1+1" # Note cache_creation_input_tokens in response # 3. Same setup — test with newer version claude-2.1.100 --print "1+1" # Note cache_creation_input_tokens in response ``` Each test is a **cold cache, single API call, no session state** (`--print` mode). Same machine, same project, same account, minutes apart. ## Evidence | Version | Content-Length (bytes) | cache_creation_input_tokens | cache_read | Total | |---------|----------------------|----------------------------|------------|-------| | v2.1.98 | 169,514 | **49,726** | 0 | 49,726 | | v2.1.100 | 168,536 (-978 B) | **69,922** | 0 | 69,922 | | v2.1.101 | 171,903 (+2,389 B) | ~72,000 | 0 | ~72,000 | **v2.1.100 sends 978 fewer bytes than v2.1.98 but is billed 20,196 MORE tokens.** This rules out any client-side payload differen

Posted by Adrian-Mteam on Apr 12, 2026, 8:14 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

onboarding (Sysadmin)

CC v2.1.100+ inflates cache_creation by ~20K tokens vs v2.1.98 — same payload, server-side

Adrian-MteamApr 12, 2026, 8:14 AM

## Summary Claude Code versions 2.1.100 and 2.1.101 consume ~20,000 more `cache_creation_input_tokens` per request than v2.1.98, despite sending **fewer bytes** in the request payload. The inflation is server-side and version-specific (likely User-Agent routing). This is not a billing-only issue — these tokens enter the model's context window and may affect output quality. ## Reproduction ```bash # 1. Install proxy to capture full API request/response bodies mkdir /tmp/cc-test && cd /tmp/cc-test npx -y claude-code-logger@1.0.2 start --port 8000 --log-body --merge-sse # 2. In another terminal — test with older version export ANTHROPIC_BASE_URL="http://localhost:8000" claude-2.1.98 --print "1+1" # Note cache_creation_input_tokens in response # 3. Same setup — test with newer version claude-2.1.100 --print "1+1" # Note cache_creation_input_tokens in response ``` Each test is a **cold cache, single API call, no session state** (`--print` mode). Same machine, same project, same account, minutes apart. ## Evidence | Version | Content-Length (bytes) | cache_creation_input_tokens | cache_read | Total | |---------|----------------------|----------------------------|------------|-------| | v2.1.98 | 169,514 | **49,726** | 0 | 49,726 | | v2.1.100 | 168,536 (-978 B) | **69,922** | 0 | 69,922 | | v2.1.101 | 171,903 (+2,389 B) | ~72,000 | 0 | ~72,000 | **v2.1.100 sends 978 fewer bytes than v2.1.98 but is billed 20,196 MORE tokens.** This rules out any client-side payload differen

Comments (0)

No comments yet. Start the discussion.

Comment on this issue