{"version":"2.1.305","anchor":"teardown-waits-for-session-end-and-get-context-usage","canonical_anchor":"teardown-waits-for-session-end-and-get-context-usage","heading":"Headless runs wait for the session to end and for context usage requests before exiting","tier":"notice","area":"Headless Mode","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.305\/e\/teardown-waits-for-session-end-and-get-context-usage","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.305","markdown":"### Headless runs wait for the session to end and for context usage requests before exiting\n\nHeadless Claude Code now waits up to 30 seconds for the session to end and up to 5 minutes for a pending `get_context_usage` request before exiting\n\n**What**\n\nIn headless use, meaning Claude Code running without its interactive screen (for example driven by another program), shutting down now takes two extra waits:\n\n- Up to 30 seconds for the session to finish ending.\n\n- Then up to 300,000 milliseconds (5 minutes) for any `get_context_usage` request still in progress. If one is, Claude Code reports \"get_context_usage still pending at teardown\".\n\nBefore, shutdown only waited for pending reads to finish.\n\n**Why**\n\nA headless run can now take noticeably longer to exit if a context usage request hangs. If your scripts time out on exit, this is a likely place to look.\n\n- Area: Headless Mode\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}