
Daily Digest
Where your Claude Code limit actually goes
Read your Claude Code logs in five minutes, counting each reply once.
The problem
You hit your Claude Code limit midweek and have no idea what used it. In Claude Code threads on Reddit this year, subscribers keep describing the same thing: a weekly allowance that jumps overnight, a plan that runs dry by Tuesday, and usage commands that show a total but not where it went. The detail is already on your disk. Claude Code writes every reply it gets back, with its token counts, to log files under ~/.claude/projects.
The technique
Read those logs yourself, and read them correctly. Each project has a folder of .jsonl files, one per session, one JSON record per line. Assistant records carry message.usage with four numbers: fresh input, cache write, cache read, and output. One reply is often written as several lines that share the same message.id and repeat the same usage, so a plain sum counts it two or three times. Count each message.id once, keep the four buckets apart, and rank sessions by total.
This script does that. It only reads files and needs nothing but Node:
import { readdirSync as ls, readFileSync as read } from "node:fs";
import { homedir } from "node:os";
const dir = process.argv[2] ?? `${homedir()}/.claude/projects`;
const L = ["Fresh input", "Cache write", "Cache read", "Output"];
const F = ["input_tokens", "cache_creation_input_tokens",
"cache_read_input_tokens", "output_tokens"];
const n = (x) => x.toLocaleString("en-US");
const files = ls(dir, { recursive: true }) // <dir>/*/*.jsonl
.filter((f) => /^[^/\\]+[/\\][^/\\]+\.jsonl$/.test(f))
.map((f) => `${dir}/${f}`);
let naive = 0, seen = new Map(), sess = {}, tot = [0, 0, 0, 0];
for (const f of files) for (const line of read(f, "utf8").split("\n")) {
let o; try { o = JSON.parse(line); } catch {}
const u = o?.type === "assistant" && o.message?.usage;
if (!u || o.message.model === "<synthetic>") continue;
const v = F.map((k) => u[k] ?? 0), t = v.reduce((a, b) => a + b);
naive += t; // counts every log line, duplicates included
const id = o.message.id ?? line;
if (seen.has(id)) continue; // same API response: first one wins
seen.set(id, o.timestamp.slice(0, 10));
v.forEach((x, i) => (tot[i] += x));
sess[o.sessionId] = (sess[o.sessionId] ?? 0) + t;
}
const all = tot.reduce((a, b) => a + b);
const days = [...seen.values()].sort();
const row = (name, x) => console.log(name.padEnd(12), n(x).padStart(15),
((100 * x) / all).toFixed(1).padStart(6) + "%");
L.forEach((name, i) => row(name, tot[i]));
row("Total", all);
console.log(`Sessions: ${n(Object.keys(sess).length)}`);
console.log(`Dates (UTC): ${days[0]} to ${days.at(-1)}`);
console.log(`Naive total: ${n(naive)} (${(naive / all).toFixed(2)}x)`);
console.log("Top 5 sessions:");
Object.entries(sess).sort((a, b) => b[1] - a[1]).slice(0, 5)
.forEach(([id, t]) => row(" " + id.slice(0, 8), t));Save it as usage.mjs and run node usage.mjs. It finished in under a second on our logs.
What we saw
We ran it on our own box: 114 Claude Code sessions from Nov 7 to Nov 11, 2026, almost all of them automated: build and publishing runs plus one-shot model tests. That came to 868 replies and 50.6 million tokens. The session names below are replaced with labels.
Fresh input 1,746 0.0%
Cache write 3,815,610 7.5%
Cache read 46,127,929 91.1%
Output 684,808 1.4%
Total 50,630,093 100.0%
Sessions: 114
Dates (UTC): 2026-11-07 to 2026-11-11
Naive total: 110,203,070 (2.18x)
Top 5 sessions:
Session A 11,767,523 23.2%
Session B 6,669,159 13.2%
Session C 4,529,816 8.9%
Session D 2,907,423 5.7%
Session E 2,204,423 4.4%Three things stood out. First, the double counting is real: adding every line gives 110.2 million tokens, 2.18 times the true figure. Second, 91% of our tokens were cache reads. Every call sends the whole conversation again, and the cached part is counted as a cache read each time, so long sessions add up fast. Fresh input is near zero because Claude Code caches almost everything it sends. Third, five sessions used 55% of everything. Session A was a long run that published several posts: 101 calls in 11 minutes, with its context growing from 21,120 to 160,327 tokens. Session B was a pull request check for a page fix, Session C an accessibility fix with a full review pass, Session D a feature build, and Session E a single post publish.
Two models appear in the logs. Claude Sonnet 5.5 at medium effort made 798 of the replies and 95% of the tokens. Claude Fable 5.2, at low, medium, and high effort, made 70 replies in one-shot test runs. We built this post with Claude Code on Claude Sonnet 5.5 at high effort.
Four fixes our numbers support
- End long sessions sooner. Since each call re-reads the whole context, cost grows with calls times context size. Our middle call carried 46,191 tokens of context, and one in ten carried more than 124,740. When a task changes, start a fresh session with a short brief instead of carrying the old one forward.
- Trim what loads before you type. Nine in ten sessions started with 14,200 to 20,421 tokens of context before our first word, and 64% of all cache writes happened on a session's first call. Cut what you load at startup, such as long project instructions and tools you don't use. Whatever stays is re-read on every call after.
- Keep big tool output out of the chat. Tool results were about a fifth of everything logged, measured in characters, not tokens. Most of our tool calls, 765 of 1,042, were shell commands. Send long output to a file and read only the lines you need, or filter it with
tailorgrepfirst. - Don't open with a giant paste. Four one-shot runs began with about half a million tokens of context each. Those four replies were 3.9% of all our tokens. Point the agent at the file instead, and let it read the part it needs.
Limits
Anthropic doesn't publish how these four buckets count toward Pro or Max limits, so treat our percentages as shares of tokens, not of your limit. In the API, cache reads cost much less than fresh input; how they count toward a subscription is not published. Our runs are short automated jobs, not long interactive days. They never resumed an old session, never used subagents, and showed almost no cache rebuilds after breaks, so we can't measure those cases here. If your top sessions are resumed sessions or subagent runs, or show large cache writes after a pause, start there. The logs are a local record, not a bill, and their format may change between Claude Code versions.
Try it
Run the script on your own ~/.claude/projects folder. Check the naive total against the real one, then open your top session and ask why it ran so long. If one session is a quarter of your week, that is the habit to change first.
Did it work for us?
Partly
On our logs, the script split 50.6M tokens into four buckets and caught a 2.18x overcount. It can't say how they count toward your limit.