<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Basant Bhat</title>
    <description>The latest articles on DEV Community by Basant Bhat (@basant_bhat_1).</description>
    <link>https://dev.to/basant_bhat_1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4016576%2F262dc0b2-e436-480b-ad95-f51e74ae80f7.jpg</url>
      <title>DEV Community: Basant Bhat</title>
      <link>https://dev.to/basant_bhat_1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/basant_bhat_1"/>
    <language>en</language>
    <item>
      <title>Why your Claude Code bill grows quadratically (and the CLI I built to see it)</title>
      <dc:creator>Basant Bhat</dc:creator>
      <pubDate>Sun, 05 Jul 2026 18:40:00 +0000</pubDate>
      <link>https://dev.to/basant_bhat_1/why-your-claude-code-bill-grows-quadratically-and-the-cli-i-built-to-see-it-1kg1</link>
      <guid>https://dev.to/basant_bhat_1/why-your-claude-code-bill-grows-quadratically-and-the-cli-i-built-to-see-it-1kg1</guid>
      <description>&lt;p&gt;I blew through my weekly Claude Code quota in 2 days. No warning, no breakdown, no idea which sessions did it. So I dug into how Claude Code actually bills tokens - and built a free CLI to make it visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quadratic cost problem
&lt;/h2&gt;

&lt;p&gt;Claude Code re-sends the entire conversation history and all tool schemas on &lt;strong&gt;every single turn&lt;/strong&gt;. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Turn 1 costs 1 unit of input tokens&lt;/li&gt;
&lt;li&gt;Turn 50 costs ~50 units&lt;/li&gt;
&lt;li&gt;A 100-turn session costs roughly &lt;strong&gt;4x&lt;/strong&gt; a 50-turn session, not 2x&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your costs grow quadratically with session length, and nothing in the UI tells you this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the data lives
&lt;/h2&gt;

&lt;p&gt;Claude Code writes every session as JSONL to:&lt;/p&gt;

&lt;p&gt;~/.claude/projects//.jsonl&lt;/p&gt;

&lt;p&gt;Each line contains token usage: input, output, cache writes, cache reads. All the data you need is already on your machine - there's just no tool to read it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter agentburn
&lt;/h2&gt;

&lt;p&gt;I built &lt;a href="https://github.com/Saloni0106/agentburn" rel="noopener noreferrer"&gt;agentburn&lt;/a&gt;, a zero-dependency CLI that parses those files locally:&lt;/p&gt;

&lt;p&gt;npx agentburn-cli&lt;/p&gt;

&lt;p&gt;You get a per-session report: token summary with costs, a "burn curve" sparkline showing cumulative growth per turn, the top token sinks (exact tool calls that cost most), and "fat files" that get repeatedly read.&lt;/p&gt;

&lt;h2&gt;
  
  
  The doctor command
&lt;/h2&gt;

&lt;p&gt;npx agentburn-cli doctor&lt;/p&gt;

&lt;p&gt;This scans for waste patterns and gives concrete fixes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A file read 3 times costing 32k tokens? Add it to .claudeignore.&lt;/li&gt;
&lt;li&gt;77% cache miss rate? Stop using --resume across days - prompt caches expire after ~1 hour.&lt;/li&gt;
&lt;li&gt;One Bash call eating 87k tokens? Split large operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Practical tips to lower your bill
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Keep sessions short.&lt;/strong&gt; Because of quadratic growth, two 50-turn sessions are much cheaper than one 100-turn session.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't let Claude re-read big files.&lt;/strong&gt; Repeated reads of the same file are pure waste.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mind the cache.&lt;/strong&gt; Prompt caches expire after about an hour - resuming an old session pays full price for the entire history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure.&lt;/strong&gt; You can't optimize what you can't see.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  It's open source
&lt;/h2&gt;

&lt;p&gt;MIT licensed, zero dependencies, 100% local - your transcripts never leave your machine. If it's useful, &lt;a href="https://github.com/Saloni0106/agentburn" rel="noopener noreferrer"&gt;a star on GitHub&lt;/a&gt; helps others find it.&lt;/p&gt;

&lt;p&gt;Feedback and PRs welcome - especially for supporting Codex CLI and Gemini CLI transcript formats.&lt;/p&gt;

</description>
      <category>claude</category>
    </item>
  </channel>
</rss>
