Claude Code API Costs Explained: What a Typical Coding Session Actually Runs You
A developer who tracked Claude Code usage over 95 days has broken down the real API costs of running the agentic coding tool. Unlike standard chat interfaces, Claude Code can trigger 10 to 40 model calls per user request, and every call re-sends the entire conversation history as input tokens, making input volume the primary cost driver. A typical mid-size session of 40 model calls across a medium-sized repo generates roughly 3.6 million input tokens, costing around $11.40 on Sonnet or $19 on Opus at Anthropic's list prices before caching discounts. Prompt caching and the /compact command can meaningfully reduce costs, but the core billing mechanic remains: every token in the active window is charged on every subsequent call. To manage spending, the author recommends keeping CLAUDE.md files lean, scoping file reads tightly, and starting fresh sessions per task rather than letting context windows grow unchecked.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in