Expand description
Context-window usage of a run (issue #57).
Every Claude Code (and Qwen Code) assistant stream message carries the
request’s usage; the prompt side (input_tokens +
cache_creation_input_tokens + cache_read_input_tokens) plus
output_tokens is what the next request has to carry. The result
message reports each model’s contextWindow in modelUsage. Codex
reports last_token_usage.total_tokens and model_context_window in
rollout token_count events (tokenUsage.last.totalTokens and
modelContextWindow on the app-server). upcomputer draws its context
gauge from these numbers and hive-mind sizes sub-sessions and reports the
peak context from them.
Structs§
- Context
Reading - One request’s context reading
- Context
Usage - How full a run’s context window is
Functions§
- claude_
request_ context_ tokens - Tokens one Claude-style request fills: prompt (fresh, cache writes and cache reads) plus its output.
- context_
reading_ from_ message - The context reading one stream or rollout message carries.
- extract_
context_ usage - Fold a run’s context usage: the last request’s fill, the peak fill, the model’s context window when reported, and the compaction count.