Maximizing the value of your Claude Code sessions
02:00 · August 14, 2026 · Claude Blog

Summary
With agentic coding tools such as Claude Code, the cost of completing a task now varies with usage rather than remaining a fixed expense. The same edit can consume markedly different numbers of tokens depending on how much context the model must carry and how many turns it takes to reach a result. The article examines the underlying billing mechanics and shows how developers can keep the tokens that are spent aligned with the actual work requested.
Token cost is determined by three factors: the chosen model, whether a token is processed as input or output, and whether it benefits from prompt caching. Larger models perform more computation per token, so they suit genuinely ambiguous problems while smaller ones handle routine edits more economically. Every request is split into a prefill phase that reads the full context and a decode phase that generates output one token at a time; decode is priced several times higher because each token requires a separate model run. Prompt caching reuses prior prefill work at roughly one-tenth the normal input price, but any change to the prefix that includes tool definitions, the system prompt, or earlier conversation history invalidates the cache for subsequent turns.
Context grows with every file read and every command output returned, and those tokens are re-sent on every following turn even when cached. Broad instructions such as “the tests are failing” trigger exploratory searches whose results remain in the window long after they are useful. More targeted prompts reduce this accumulation, while large command outputs are automatically truncated once they exceed a set length. Long-running sessions compound the expense because later turns must still reference everything that preceded them; clearing or compacting the conversation at logical breakpoints therefore limits unnecessary reprocessing.
Subagents provide a separate context window for tasks that generate voluminous intermediate output, such as scanning logs. Only the final answer returns to the main session, so the overhead of re-reading material is traded against the cost of carrying large histories. The article concludes that the highest-impact levers are model and effort selection at the start of a session, careful scoping of the initial request, disciplined use of session resets, and selective delegation to subagents when output volume would otherwise dominate the context.
Why it matters
It offers highly actionable, technical insights for product teams and builders on optimizing token usage and costs when using Claude Code. Understanding these mechanics is crucial for Dutch AI practitioners looking to efficiently integrate and scale agentic coding tools in their development workflows.







