Under my last post @junfengzhou01 asked whether my 400k+ context calls came from long sessions or from sub-agents reading big files, and I didn't know. It's the sessions. I split the same local logs into main session and sub-agent calls (7 Nov, 9,604 calls at list price) and got this:
band main calls main cost sub calls sub cost <100k 189 $15.72 3096 $121.48 100-200k 468 $39.50 3183 $175.73 200-400k 661 $64.08 764 $61.65 400k+ 1243 $243.27 0 $0.00 No sub-agent ever got past 365k. Makes sense when you think about it: a sub-agent starts with an empty context and is done before it grows, while my main sessions stay open for days, which is also why your table will probably look nothing like mine if you clear often.
Five sessions did all of the 400k+ spend, and three of them were 94% of it. Most of that money is cache reads, $160 or so of the $243, with output a small slice. Sub-agents are still half my total bill, but they get there by volume, 7,043 calls and most of them under 200k.
@jgravelle wondered in the replies if big file reads were what bloated the main sessions. I tried to measure what filled them and got a mess, because the browser tool's screenshots and page dumps swamp any character count. File reads came out at roughly a tenth. So probably not the main cause, though I wouldn't hang much on that number.
Coming back after a break is the expensive part
On Sunday 18 October I opened a session I'd left running overnight. The first reply cost $3.70. Twelve hours later the cache was long gone, so it had to write 740k tokens back in before doing anything.
21 of the 400k+ calls re-cached more than 100k tokens after a pause like that, and together they came to $56, close to a quarter of the 400k+ spend.
Next time a session is past 400k and I'm about to walk away, I'll have Claude write a notes file and start fresh from that the next day. Caching a 20k-token note costs around 10 cents. I don't have real numbers on the saving yet.
The numbers from the first post held up: 400k+ is now 13% of calls and 34% of cost.
ctxtax shows the main vs sub-agent split per band now, if you want to run it on your own logs: https://github.com/TrueHorison/ctxtax
Written with AI help.

