{"version":"2.1.271","anchor":"new-context-usage-and-artifacts-metadata-reporting-for-sdk-h","canonical_anchor":"new-context-usage-and-artifacts-metadata-reporting-for-sdk-h","heading":"SDK-hosted sessions now report context usage and artifact counts","tier":"internal","area":"SDK","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271\/e\/new-context-usage-and-artifacts-metadata-reporting-for-sdk-h","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271","markdown":"### SDK-hosted sessions now report context usage and artifact counts\n\nClaude Code now reports context-usage and artifact-count metadata back to SDK-hosted sessions\n\n**What**\n\n- SDK-hosted sessions now report `context_usage` and `artifacts` count metadata back to the session's outbound handle, deduplicated against the last-reported values, with a suppression flag for artifacts.\n\n- The underlying state tracking gained matching fields, `lastReportedContextUsage`, `lastKnownContextUsage`, `lastReportedArtifacts`, `lastKnownArtifacts`, and `artifactsEgressSuppressed`, used consistently across the relevant reset paths.\n\n**Why** This lets tools and integrations built on the Claude Code SDK see how much context a session is using and how many artifacts it has produced, without re-sending duplicate metadata.\n\n- Area: SDK\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 2\/5"}