{"version":"2.1.251","anchor":"sessionstart-hooks-get-cache-cost-data-on-resume-and-fork","canonical_anchor":"sessionstart-hooks-get-cache-cost-data-on-resume-and-fork","heading":"SessionStart hooks get cache-cost data on resume and fork","tier":"use","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251\/e\/sessionstart-hooks-get-cache-cost-data-on-resume-and-fork","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251","markdown":"### SessionStart hooks get cache-cost data on resume and fork\n\nSessionStart hooks now get cache age, context size and estimated re-caching cost on resume.\n\n**What**\n\nWhen 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.\n\n**Details**\n\n- Present for SessionStart events whose source is resume or fork.\n- The elapsed-time field is measured from the resumed transcript's last assistant response.\n\n**Evidence**\n\n`resume\/fork: seconds since the resumed transcript's last assistant response`\n\n- Area: Hooks\n- Names: `SessionStart`, `seconds_since_last_response`, `context_tokens`, `prompt_cache_likely_expired`, `estimated_cache_write_usd`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 4\/5"}