Skip to content

Context Reduction

Context reduction trims oversized tool output before it pollutes later turns. Large tool responses can dominate the context window without adding proportional value.

Reduction Pipeline

TokenPilot's reduction runs a pipeline of passes on each tool result:

PassDescriptionConfigurable
readStateCompactionCompact stale or superseded read results before they bloat later contextYes
toolPayloadTrimTrim oversized tool payloadsYes
htmlSlimmingCompact noisy HTML contentYes
execOutputTruncationTruncate long execution outputsYes
agentsStartupOptimizationApply agent startup optimization passYes

Controlling Reduction

bash
# Toggle reduction
lightrsi reduction on
lightrsi reduction off

# Switch mode
lightrsi reduction mode balanced

# Enable/disable specific passes
lightrsi reduction pass toolPayloadTrim off
lightrsi reduction pass toolPayloadTrim on

# Check current status
lightrsi reduction status

Next

Released under the MIT License.