<?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: Ranajoy</title>
    <description>The latest articles on DEV Community by Ranajoy (@ranajoy).</description>
    <link>https://dev.to/ranajoy</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3910067%2F01ba11e2-2f37-49f8-bd8f-06a3330b048c.jpg</url>
      <title>DEV Community: Ranajoy</title>
      <link>https://dev.to/ranajoy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ranajoy"/>
    <language>en</language>
    <item>
      <title>Where Did My Claude Code Money Go? I Built a Tool to Find Out</title>
      <dc:creator>Ranajoy</dc:creator>
      <pubDate>Sun, 03 May 2026 09:46:53 +0000</pubDate>
      <link>https://dev.to/ranajoy/where-did-my-claude-code-money-go-i-built-a-tool-to-find-out-30gb</link>
      <guid>https://dev.to/ranajoy/where-did-my-claude-code-money-go-i-built-a-tool-to-find-out-30gb</guid>
      <description>&lt;p&gt;I still remember the message. A developer on my team - sharp, careful - pinged me: &lt;em&gt;"My Claude Code bill spiked $200 this week. Same workflow. Something's off."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I had no answer. The built-in usage view showed session totals. The web billing page showed monthly aggregates. But neither could answer the only question that mattered: &lt;strong&gt;which specific turn ate the money? How do I improve the way I use Claude Code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That gap - between &lt;em&gt;knowing you spent&lt;/em&gt; and &lt;em&gt;seeing exactly why&lt;/em&gt; - is what this closes.&lt;/p&gt;




&lt;h2&gt;
  
  
  What It Is
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Claude Code Cost Explorer&lt;/strong&gt; is a local dashboard that reads Claude Code's own session files already stored locally on your machine and shows you cost down to the &lt;strong&gt;individual turn&lt;/strong&gt;. No API keys. No databases. No instrumentation. Just &lt;code&gt;pip install&lt;/code&gt;, run one command, and your browser opens.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Day view:&lt;/strong&gt; Cost trends, session count, API calls - “Where did that $100 day come from?”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session view:&lt;/strong&gt; Per‑project cost, token totals, timestamps - “Did the auth-refactor session really cost $12?”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn view:&lt;/strong&gt; Full prompt, thinking blocks, tool call inputs/outputs, per‑turn cost, model used - “Wait, that &lt;em&gt;one&lt;/em&gt; turn cost $4.20?”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It doesn’t predict. It doesn’t optimize. It just surfaces exactly what happened - with cost attached to every breath the agent took.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Nothing Else Fit
&lt;/h2&gt;

&lt;p&gt;I searched. Many tools give summaries, live burn‑rate counters, or heavy dashboards. But I couldn't find a single one that would show me &lt;strong&gt;why&lt;/strong&gt; a session cost $12 - down to the turn that triggered 3 &lt;code&gt;Read&lt;/code&gt; calls, a broad &lt;code&gt;Glob&lt;/code&gt;, and a long thinking chain. So I built it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What You Actually See
&lt;/h2&gt;

&lt;p&gt;Claude Code already stores its session data locally. This tool reads those files — no uploads, no network calls - and renders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User prompts&lt;/strong&gt; - exactly what you asked&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent workflow&lt;/strong&gt; - thinking blocks, tool calls (&lt;code&gt;Read&lt;/code&gt;, &lt;code&gt;Write&lt;/code&gt;, &lt;code&gt;Glob&lt;/code&gt;, &lt;code&gt;Bash&lt;/code&gt;), inputs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool results&lt;/strong&gt; - raw outputs Claude received&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per‑turn cost&lt;/strong&gt; - calculated from local pricing tables&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model tags&lt;/strong&gt; - which Claude model handled that turn, and what it cost&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The real value kicks in when you start noticing patterns.&lt;/p&gt;

&lt;p&gt;I once spotted that a simple “fix the build” prompt caused Claude to recursively &lt;code&gt;Glob&lt;/code&gt; through &lt;code&gt;node_modules&lt;/code&gt; - not because it needed to, but because the prompt wasn't precise enough. An immature request that cost a quiet $3.70 in a single turn. I refined the prompt; the next identical task cost under $0.40.&lt;/p&gt;

&lt;p&gt;Another time, I noticed Claude repeatedly pulling AWS CloudWatch log groups and metrics across multiple debugging sessions. Same access pattern, same API calls, same tokens burned. That repetition was a clear signal: this is a reusable workflow. I ended up building a skill to package that exact diagnostic routine - subsequent sessions that would have cost $8-10 each now run in a fraction of the time and cost.&lt;/p&gt;

&lt;p&gt;Without turn-level visibility, those patterns stay invisible. With it, you move from cost surprise to cost control - and from one‑shot prompts to smart, reusable tooling.&lt;/p&gt;




&lt;h2&gt;
  
  
  Install &amp;amp; Run
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;claude-code-cost-explorer
ccx
&lt;span class="c"&gt;# Automatically opens http://127.0.0.1:5000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt; Python 3.10+, Claude Code installed and used at least once.&lt;/p&gt;

&lt;p&gt;The architecture is intentionally minimal - standard library, simple templates, tests. No frontend build step. No database migrations. The smarts are in the log parsing and cost attribution, not in the plumbing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Honest Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not exact billing.&lt;/strong&gt; Local cost estimates; typically within 1-2% of your actual Anthropic Claude Code bill.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not a CLI utility.&lt;/strong&gt; For lightning‑fast terminal checks, other lightweight tools shine. This is for when you need to &lt;em&gt;look inside&lt;/em&gt; a session.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not teamware.&lt;/strong&gt; No multi‑user dashboards, no RBAC.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why I Built This
&lt;/h2&gt;

&lt;p&gt;I’m a AIops/MLOps engineer and solution architect. I spend my days obsessing over system design, architecture optimizations, and making complex pipelines observable and cost‑efficient. I instrument production APIs, ML models, and cloud infrastructure. But my daily coding agent - burning $200-400 a month, firing thousands of API calls - operated with less visibility than a $5 cloud function. That felt broken.&lt;/p&gt;

&lt;p&gt;This started as a weekend project to answer a single question: &lt;em&gt;“Where did that $100 day come from?”&lt;/em&gt; My colleagues started using it. It worked. So I decided to take the next step - I wanted to understand how open‑source software is actually built, packaged, and shared with the world. This is my first attempt, small in scale, but an attempt nonetheless.&lt;/p&gt;

&lt;p&gt;Now it's out there. If it helps you move from cost anxiety to cost clarity - and maybe even inspires you to build a skill from a pattern you discover - that's the whole win.&lt;/p&gt;

&lt;p&gt;File issues. Fork it. The code stays small so it's approachable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ranajoy-dutta/claude-code-cost-explorer" rel="noopener noreferrer"&gt;&lt;strong&gt;github.com/ranajoy-dutta/claude-code-cost-explorer&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
