Skip to main content

Automatic chat compression

If the chat with the agent becomes too large, it may hit the context window limit: the model starts working worse, while cost and response time go up.

Automatic compression reduces the history when the chat grows too large. First, the plugin uses built-in rules without making an extra LLM request. If that is not enough and the context still overflows, the history is sent to an LLM for summarization. A short summary replaces the older conversation, while the latest user message stays unchanged.

Compression does not delete messages from the chat: it shortens the history that the model receives.

When to change the threshold

By default, automatic compression starts when the context window is 80% full. The available range is 25% to 100%.

  • Choose a lower threshold if the chat will be long and several stages of work are still ahead. The history starts shrinking earlier, so more context is left for new messages, tool results, and edits.
  • Choose a higher threshold if the early details of the current conversation matter and the task can be finished soon. Compression starts later, but you have less context to spare.

To change the threshold:

  1. Click the context fill indicator next to the input field.
  2. Enable Auto compress by threshold.
  3. Move the slider to the value you want.

If you turn Auto compress by threshold off, automatic compression will not run. Manual compression stays available.

When to run it manually

Run manual compression before a new stage of a long task if you want to free up context in advance. For example, the agent has already explored the project and built a plan, and now it should move on to the implementation. In that case, there is no need to wait for the automatic threshold.

To compress a chat manually:

  1. Click the context fill indicator.
  2. Click Compress.

Manual compression uses the built-in rules and does not depend on the selected threshold. It may not reduce the history if the chat does not yet contain anything that can be shortened.