SDK consumers get /context numbers as context_usage on the assistant message, including an over-limit block.
What's wrong with this entry?
Running /context now produces machine-readable numbers next to the rendered table, and SDK consumers receive them on the assistant message as context_usage. Fields are model, total_tokens, raw_max_tokens, percentage, categories, and an over_limit block containing tokens_over.
- The payload is attached to the system message that carries local command output.
- When that message is converted for the SDK stream, the field is emitted only if present, so messages without usage data are unchanged.
- Neither
contextUsagenorcontext_usageappeared in v2.1.231.
...(n !== void 0 && { context_usage: n }),
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.
-
v2.1.229
Session context is built lazily and cached per project root
Both mention context
-
v2.1.248
/context can hide the memory-files section
Both mention context
-
v2.1.248
/context remote failures can hide the raw error
Both mention context