Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.246 Home All releases olderv2.1.245 v2.1.247newer
Claude Code v2.1.246

Cost is stored per session rather than only for the most recent one

Under the hood
Useful2 Signal2
Cost Tracking

Cost is stored per session id, so more than just the last session's spend can be restored.

What

Cost is now written to the session store as its own record keyed by session id, replacing global scratch fields that were keyed on the last session id and could therefore only restore the cost of whichever session ran most recently.

Details
  • The record is schema-checked and holds the session id, total cost in USD, API and tool durations, lines added and removed, per-model usage and a flag for models with unknown pricing.
  • Written on exit, read back per session on resume, merged last-wins, and kept with "always" retention so it is not pruned.
  • Whether the record gets emitted at all depends on a guard whose definition is renamed across modules and does not resolve; the merge and retention behaviour is unconditional.
Evidence

cost-state

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

Related

Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.

See this entry in the whole of v2.1.246 →