12% of Claude Code Calls Cost 31% of the Bill: One Developer Priced 7,802 Calls From His Own Logs
- Level Intermediate
- Setup1–3 hrs (estimated)
- Evidence Some evidence
- CostNot stated in source
- No-codeNo
What they did
He priced every call in his Claude Code session logs at list price. 954 of 7,802 calls sent more than 400k tokens of context, and those 12% of calls cost 31% of the $565 API-equivalent total. Sub-agents were $289 of it. Output tokens barely mattered, because the cost is re-sending context every turn. He also hit the 5-hour limit 14 times in about two weeks. His untested idea: clear the session when a task is done instead of carrying on. He shared the script free.
How it went
dev.to post by true_horison_37 (Oct 28, 2026): 7,802 calls, 954 over 400k context = 31% of $565, sub-agents $289, 14 limit hits; open-source script on GitHub. These are API-equivalent prices on a subscription plan, and his fix is untested
Worth knowing
- dev.to post by true_horison_37 (Oct 28, 2026): 7,802 calls, 954 over 400k context = 31% of $565, sub-agents $289, 14 limit hits; open-source script on GitHub.
- These are API-equivalent prices on a subscription plan, and his fix is untested.
Prompt
Cleaned version rewritten from the source — not a direct quote.
Read my Claude Code session logs in ~/.claude/projects. Count each message once, and price every call at current list prices, splitting input, cache reads, cache writes and output. Group calls by context size (<100k, 100-200k, 200-400k, 400k+) and show calls and cost per group, plus how much went to sub-agents. Then suggest 3 habits to cut the most expensive group.
Recommended
Try it in Grok Bot
- Copy the prompt (button below).
- Open Grok Bot chat and paste it. Replace any [bracketed] placeholders.
- Connect the listed tools (as needed) as connectors when Grok Bot asks.
- If the task repeats, ask: "Make this a daily routine."
Alternatives: the same prompt works in Claude Code, Claude, ChatGPT Agent, OpenClaw.
Set it up
Stack: Claude Code
- Read the original source for full context.
- Connect the tools your agent needs.
- Paste the prompt and replace [bracketed] placeholders.
- Run once manually and check the output before scheduling it.
Generic suggested steps, not from the source.
Evidence
dev.to post by true_horison_37 (Oct 28, 2026): 7,802 calls, 954 over 400k context = 31% of $565, sub-agents $289, 14 limit hits; open-source script on GitHub. These are API-equivalent prices on a subscription plan, and his fix is untested
Source: Web · 2026-10-28 · Verified by us: not yet · Report broken or outdated