<?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: Raunak Pathak</title>
    <description>The latest articles on DEV Community by Raunak Pathak (@raman_8527359ba62faa0a58e).</description>
    <link>https://dev.to/raman_8527359ba62faa0a58e</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%2F4193251%2F80ac949f-1e0a-4f4d-b2eb-926c698e33ad.png</url>
      <title>DEV Community: Raunak Pathak</title>
      <link>https://dev.to/raman_8527359ba62faa0a58e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raman_8527359ba62faa0a58e"/>
    <language>en</language>
    <item>
      <title>Where my Claude Code quota actually went (208 sessions of logs)</title>
      <dc:creator>Raunak Pathak</dc:creator>
      <pubDate>Mon, 19 Oct 2026 04:45:21 +0000</pubDate>
      <link>https://dev.to/raman_8527359ba62faa0a58e/where-my-claude-code-quota-actually-went-208-sessions-of-logs-1jkk</link>
      <guid>https://dev.to/raman_8527359ba62faa0a58e/where-my-claude-code-quota-actually-went-208-sessions-of-logs-1jkk</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F44z12a6q0z5um157utur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F44z12a6q0z5um157utur.png" alt="cc-quota-doctor output on 208 sessions" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My Claude Code limits kept running out faster than I expected, and the usage counter only told me &lt;em&gt;how much&lt;/em&gt; I'd used, not &lt;em&gt;where it went&lt;/em&gt;. Claude Code already keeps a transcript of every session on disk, in &lt;code&gt;~/.claude/projects&lt;/code&gt;. So I built a small tool, with the help of an AI agent, that reads those files and summarizes them. Then I ran it on my own history.&lt;/p&gt;

&lt;p&gt;This post covers what the logs showed, what the docs say about it, and the habits I changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers (208 sessions)
&lt;/h2&gt;

&lt;p&gt;This is an anonymized and rounded run on one developer's history (mine):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Sessions&lt;/td&gt;
&lt;td&gt;208&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Longest session&lt;/td&gt;
&lt;td&gt;9,849 turns, 68 compactions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cache rebuilds after &amp;gt; 60 min away&lt;/td&gt;
&lt;td&gt;280, ~81.6M cache-write tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cache rebuilds after &amp;gt; 5 min away (only matters on the 5-min TTL)&lt;/td&gt;
&lt;td&gt;417, ~112.8M&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mid-session model switches&lt;/td&gt;
&lt;td&gt;37, ~9.07M tokens re-read uncached&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Average context re-read per turn&lt;/td&gt;
&lt;td&gt;~374k tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output / cache write / cache read&lt;/td&gt;
&lt;td&gt;24.6M / 260M / 12.5B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subagents&lt;/td&gt;
&lt;td&gt;24% of raw tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Largest CLAUDE.md&lt;/td&gt;
&lt;td&gt;~3k tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One caveat before anything else: cache reads are 98% of the &lt;em&gt;raw&lt;/em&gt; tokens here, but that is &lt;strong&gt;not&lt;/strong&gt; 98% of my quota. Cache reads are cheap per token, and Anthropic doesn't publish how each token type counts against plan limits. These are raw token counts. The only honest way to measure a change is to compare &lt;code&gt;/usage&lt;/code&gt; before and after.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things I had wrong
&lt;/h2&gt;

&lt;p&gt;All three are covered in the official doc &lt;a href="https://code.claude.com/docs/en/prompt-caching" rel="noopener noreferrer"&gt;How Claude Code uses prompt caching&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The cache lifetime isn't always 5 minutes.&lt;/strong&gt; On a Claude subscription, within plan usage, the main conversation's cache lasts &lt;strong&gt;1 hour&lt;/strong&gt;. Subagents, compaction and other requests get 5 minutes. With an API key, usage credits or a cloud provider, everything is 5 minutes. And once you go over your plan limit and draw on usage credits, the main conversation drops to 5 minutes too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. After a long break, &lt;code&gt;/compact&lt;/code&gt; is the expensive option.&lt;/strong&gt; Once the cache has expired, the next request recomputes the full context. The summarization request behind &lt;code&gt;/compact&lt;/code&gt; reprocesses the whole history uncached, "which is why &lt;code&gt;/compact&lt;/code&gt; costs the most when you resume an old session" (from the doc). My 280 rebuilds after more than an hour away were exactly this pattern: coming back to a huge session and carrying on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Switching &lt;code&gt;/model&lt;/code&gt; mid-session re-reads everything.&lt;/strong&gt; Each model has its own cache, so after &lt;code&gt;/model&lt;/code&gt; the next request re-reads the entire history with no cache hits. I did this 37 times. Changing effort level mid-session does the same on most models.&lt;/p&gt;

&lt;h2&gt;
  
  
  Habits I changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Coming back after a break longer than your TTL:&lt;/strong&gt; start a fresh session and paste a short summary of where you left off. Or &lt;code&gt;/rewind&lt;/code&gt; to an earlier, already-cached point if you're abandoning a path. Don't &lt;code&gt;/compact&lt;/code&gt; first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compact while the cache is warm.&lt;/strong&gt; While the cache is warm, &lt;code&gt;/compact&lt;/code&gt; reads your prefix from cache and is relatively cheap. Run it at natural breaks between tasks rather than waiting for auto-compaction mid-task. &lt;code&gt;/recap&lt;/code&gt; shows a summary without replacing history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One task per session&lt;/strong&gt;, and &lt;code&gt;/clear&lt;/code&gt; between unrelated tasks. A 9,849-turn session re-sends a lot of context every turn.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick the model and effort level at the start&lt;/strong&gt; of a session, not halfway through.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep CLAUDE.md lean.&lt;/strong&gt; It's part of every request; I aim for under ~1,500 tokens. Editing it mid-session doesn't break the cache, but the edit doesn't apply until &lt;code&gt;/clear&lt;/code&gt;, &lt;code&gt;/compact&lt;/code&gt; or a restart. Run &lt;code&gt;/context&lt;/code&gt; in a fresh session to see what actually loads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep tool output small.&lt;/strong&gt; Read files with offsets and limits, grep before reading, and pipe commands through &lt;code&gt;head&lt;/code&gt;, &lt;code&gt;tail&lt;/code&gt; or &lt;code&gt;grep&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use subagents deliberately.&lt;/strong&gt; Each subagent builds its own context and uses the 5-minute TTL. Narrow prompts, short requested outputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check your hit rate.&lt;/strong&gt; &lt;code&gt;/usage&lt;/code&gt; shows a &lt;code&gt;Prompt cache (main)&lt;/code&gt; hit ratio (v2.1.251+).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Run it on your own logs
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;cc-quota-doctor&lt;/code&gt; is MIT-licensed, standard-library Python (3.9+), and works on Windows, macOS and Linux. It makes no network calls and uploads nothing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install git+https://github.com/raunakpathak20/cc-quota-doctor-.git
cc-quota-doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful flags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cc-quota-doctor --top 10              # more projects/sessions
cc-quota-doctor --json &amp;gt; usage.json   # machine-readable
cc-quota-doctor --idle-minutes 5      # API key / usage credits (5-min TTL)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It reports tokens per project and session, the subagent share, startup context size, which CLAUDE.md files load, idle cache rebuilds at both TTLs, model switches and compactions, the largest tool outputs, and a top-3 list of fixes for your own usage.&lt;/p&gt;

&lt;p&gt;What it does &lt;strong&gt;not&lt;/strong&gt; do: it doesn't bypass, reset or raise any limit, and it can't show your plan %. The transcript format is undocumented and may change, and some sizes are estimates (characters / 4). If your numbers look off, please open an issue.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/raunakpathak20/cc-quota-doctor-" rel="noopener noreferrer"&gt;https://github.com/raunakpathak20/cc-quota-doctor-&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it was built
&lt;/h2&gt;

&lt;p&gt;I built it with an AI agent, reviewed it, and ran it on my own history. v0.2 was corrected after a QA pass against the official docs (the TTL details above were the main fix).&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you'd rather have the fixes ready-made, there's an optional $15 Pro kit (a CLAUDE.md-slimmer skill, warning hooks, a weekly report and a playbook that cites the docs): &lt;a href="https://buy.polar.sh/polar_cl_69l29e1HavMF0OIreYDVgqTqPzCPoZjy3QAvI4ZK6Jb" rel="noopener noreferrer"&gt;https://buy.polar.sh/polar_cl_69l29e1HavMF0OIreYDVgqTqPzCPoZjy3QAvI4ZK6Jb&lt;/a&gt;. The free CLI is the complete diagnostic.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'm curious: how many idle rebuilds does yours show?&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>productivity</category>
      <category>python</category>
    </item>
  </channel>
</rss>
