
I Analyzed My Claude Code Sessions and Found $143 in Hidden Agent Costs — Here's the Breakdown
If you use Claude Code with API billing, you've probably had that moment: you check your Anthropic dashboard and think, "Wait, how did I spend that much on a single session?" I had that moment last week. A session that felt like 20 minutes of light refactoring had burned through $47 in API calls. So I did what any developer would do — I dug into the logs. What I found changed how I think about AI agent costs entirely. The hidden architecture you're paying for Claude Code doesn't just run one model conversation. Under the hood, it spawns sub-agents using the Task tool. Each sub-agent gets its own context window, its own token budget, and makes its own API calls. Here's the thing: you can't see this happening in real time. The /cost command (when it works) shows session-level totals. If you're on a Max or Pro plan, you get even less — the cost display is disabled entirely. Your session logs tell a different story. Every API call is recorded in JSONL files under ~/.claude/projects/*/sessi
Continue reading on Dev.to Webdev
Opens in a new tab


