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.251 Home All releases olderv2.1.250
Claude Code v2.1.251

SessionStart hooks get cache-cost data on resume and fork

Use it now
Useful4 Signal4
Hooks Notable

SessionStart hooks now get cache age, context size and estimated re-caching cost on resume.

SessionStartseconds_since_last_responsecontext_tokensprompt_cache_likely_expiredestimated_cache_write_usd
What

When a session starts by resuming or forking, the SessionStart hook payload now includes seconds_since_last_response, context_tokens, prompt_cache_likely_expired, and estimated_cache_write_usd. A hook can use these to judge whether the prompt cache has lapsed and what re-caching the context will cost before doing anything expensive.

Details
  • Present for SessionStart events whose source is resume or fork.
  • The elapsed-time field is measured from the resumed transcript's last assistant response.
Evidence

resume/fork: seconds since the resumed transcript's last assistant response

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

See this entry in the whole of v2.1.251 →