Claude Code Sessions Bleed Tokens. Here's Where They Go.
Agentic coding tools bill by token, not by task. A developer who ignores Session hygiene can burn 5–10x more credits for identical results, turning a cost-effective tool into a surprise expense. These mechanics apply equally to subscription quotas and API-key billing.
A single Claude Code Session can consume wildly different token counts for the same fix, depending on whether the model searches blindly or is pointed directly at the right files. Each round re-sends the entire conversation history, so irrelevant files and noisy command output compound costs across every subsequent request. The official guidance breaks down where tokens actually go: input prefill, output decode, and prompt caching.
Prompt cache gives a 10x discount on repeated prefixes, but it breaks when you switch models, change effort levels mid-Session, or let the cache expire after an hour. Using @-mentions instead of letting Claude read files saves tool-call rounds. Quiet flags on test and build commands prevent thousands of lines of passing-test output from permanently occupying the context window.
The highest-leverage fixes are the simplest: run /clear between unrelated tasks, check /context before starting work, and compact before stepping away. Subagents isolate noisy analysis from the main Session, but for small tasks they add overhead. Long-running loops belong in a separate terminal with a clean Session to avoid cache-miss reprefills.
Token cost is wildly asymmetric: a request might carry tens of thousands of input tokens but generate only a few hundred output tokens, yet output tokens cost 5x more per token.
Prompt cache is automatic but fragile — it matches from the very start of a request, so any change to the prefix (model, effort, fast mode) invalidates the entire cache and forces a full-price reprefill.
Command output under 30,000 characters enters the context verbatim and stays for the entire Session; a test runner printing 400 passing tests line-by-line silently bloats every subsequent round.
Subagents solve context pollution but create a trade-off: they can't see the main Session's history, so they sometimes re-read files the main Session already loaded, adding their own token cost.
The most expensive Session pattern is a long, unfocused conversation where round 40 must re-read the cached context of the previous 39 rounds, each carrying accumulated noise.