Token Efficiency Encyclopedia

Sliding Window

Retain only the most recent N conversation turns in the agent's context. Oldest turns are dropped entirely. This caps the prompt size at a fixed bound regardless of session length.

Trade-offs

When to Use

Best as a fallback or combined with summarization. A pure sliding window is usually insufficient for coding agents working on multi-file tasks.

See Also

Tools