Skip to content

context-usage

The context-usage extension adds a /context command that shows how the active context window is allocated.

/context

When usage is unknown (for example immediately after compaction or right after /new//clear), /context shows the standard no-data warning instead of rendering a misleading 0 tokens chart.

CategoryWhat it measures
System promptBase instructions
System toolsTool definitions
Context filesAGENTS.md, CLAUDE.md
SkillsAvailable skill metadata in prompt
MessagesConversation history
Free spaceRemaining capacity
Autocompact bufferReserved compaction buffer

/context includes a Historical tool-result payloads block:

  • total tool results in the active branch
  • summarized result count
  • retained bytes in memory
  • reclaimed bytes from summarization

This reflects the toolResultRetention policy.

{
"toolResultRetention": {
"enabled": true,
"keepRecentToolResults": 12,
"maxRetainedBytesPerResult": 49152,
"previewChars": 600
}
}

Semantics:

  • keepRecentToolResults: newest N results kept full
  • maxRetainedBytesPerResult: older results above this are summarized
  • previewChars: maximum summary preview size

Tallow also applies pre-flight and ingestion-time guardrails for tool output.

{
"contextBudget": {
"softThresholdPercent": 75,
"hardThresholdPercent": 90,
"minPerToolBytes": 4096,
"maxPerToolBytes": 524288,
"perTurnReserveTokens": 8000,
"unknownUsageFallbackCapBytes": 32768
}
}

These values drive:

  • per-turn planner envelopes for tool-call batches
  • ingestion-time tool-result truncation under pressure
  • unknown-usage fallback behavior (tokens: null)

Each turn includes a short signal line in the system prompt:

  • known usage: Context budget: <percent>% used, ~<remaining>k tokens remaining
  • unknown usage: Context budget: unknown (waiting for fresh usage sample)

Unknown usage is treated as high risk and uses conservative caps.