Developers captured raw Claude Code API traffic via local proxy to analyze where tokens and cost go in multi-turn sessions. They identified five cost drivers, including MCP tool schemas consuming 15k-25k input tokens per turn and prompt cache misses that cut the 90% discount. They released an open-source tool, cost-xray, that attributes tokens and costs to individual sources for Claude Code and Codex.
A developer running Codex and Claude Code traced where tokens go per turn, finding the full conversation resends every turn, so early junk compounds cost. The breakdown quantifies per-item token costs like system prompts, CLAUDE.md, screenshots, and MCP connectors.
A developer running Codex and Claude Code traced where tokens go per turn, finding the full conversation resends every turn, so early junk compounds cost. The breakdown quantifies per-item token costs like system prompts, CLAUDE.md, screenshots, and MCP connectors.
A user instrumenting Claude Code found that Prompt Suggestions — the greyed-out autocomplete text in the input line — trigger a Cache Read of the entire context and can cost up to 10% of a weekly limit. The poster advises turning the feature off. Suggestions cost a median 91% of the corresponding normal prompt's cost in their logs.
A user instrumenting Claude Code found that Prompt Suggestions — the greyed-out autocomplete text in the input line — trigger a Cache Read of the entire context and can cost up to 10% of a weekly limit. The poster advises turning the feature off. Suggestions cost a median 91% of the corresponding normal prompt's cost in their logs.
A developer analyzed 60 sessions of Claude Code transcripts and built a free open-source profiler to identify token waste. Key findings: a 5,649-line progress doc was read 118 times, and 455 failed tool calls cost ~$201 in retry billing. Caching saved an estimated $15k in API costs.
A developer analyzed 60 sessions of Claude Code transcripts and built a free open-source profiler to identify token waste. Key findings: a 5,649-line progress doc was read 118 times, and 455 failed tool calls cost ~$201 in retry billing. Caching saved an estimated $15k in API costs.
A developer analyzed Claude Code's per-call token logs and found most cost came from context bloat, mis-inherited model assignments, and repeated file reads — not output verbosity. After four fixes, cost per call fell 40% and subagent spend dropped 77%. The audit and fixes are packaged as a local-only plugin, /scrooge.
A developer analyzed Claude Code's per-call token logs and found most cost came from context bloat, mis-inherited model assignments, and repeated file reads — not output verbosity. After four fixes, cost per call fell 40% and subagent spend dropped 77%. The audit and fixes are packaged as a local-only plugin, /scrooge.
Developers analyzing their own Claude Code transcripts found sessions incur roughly 70,000 tokens of overhead before any user input, driven by system prompts, tool schemas, and accumulated rule files. One test logged 33k tokens before the prompt, with 24k from tool schemas alone, while open-source alternatives like OpenCode start closer to 7k. The findings highlight a hidden cost for heavy users and explain the '70% wall' where projects slow down as codebases grow.
Developers analyzing their own Claude Code transcripts found sessions incur roughly 70,000 tokens of overhead before any user input, driven by system prompts, tool schemas, and accumulated rule files. One test logged 33k tokens before the prompt, with 24k from tool schemas alone, while open-source alternatives like OpenCode start closer to 7k. The findings highlight a hidden cost for heavy users and explain the '70% wall' where projects slow down as codebases grow.