<!-- https://zerolog.ch/docs/compaction · Docs / Chat -->
# Long conversations

A long thread does not have to end. When it comes up against the model's context limit, the older turns are compacted into a summary and the conversation carries on instead of failing.

Fold

Older turns

Compacted

**Summary**

*Hollow rows are the turns the model now reads as one summary. Solid rows it still reads in full.*

Marker

## The seam stays visible

Compaction is not silent. It is shown in the thread, so you can see where it happened and which part of the history has been folded up. The original messages stay stored, and the marker can be expanded to show them.

Cost

## Summarised for everyday use

A model set aside for everyday tasks makes the summary, and the call is billed to you like any other. The latest turns stay in full: six of your turns for automatic compaction, the newest one for Compact now.

When

## Automatic, with a switch

Compaction is on by default for each chat. It starts in the background once the thread passes 70% of the model's window or about 150,000 tokens, whichever comes first. Past 90% it runs before your next message is sent. In the context meter you can switch **Compact automatically** off or press **Compact now**, which needs at least two turns. Paused and anonymous chats are not compacted.

Container

## Nothing in your container moves

Compaction touches the conversation and only the conversation. Files are not part of the context in the first place, so everything in the container is left exactly as it was.

Context length

## Measured against your selected model

The context limit depends on the model selected for the chat. Check its context length in the picker. A thread that exceeds it may need compaction before you continue.

## How a long thread is compacted

Mermaid source of the diagram on this page:

```mermaid
%% Long conversations: when and how a thread is compacted. Facts from server/compact.js (threshold 0.70, hard 0.90, trigger 150000 tokens, keep 6 turns, manual keep 1, sweeper, paused chats) and web/apps/web/components/chat/context-meter.tsx.
flowchart TB
  grow["Thread grows toward<br/>the model's context limit"]
  soft["Over 70% of the window<br/>or about 150,000 tokens:<br/>background compaction"]:::hot
  hard["Over 90%: compaction runs<br/>before your next message"]
  now["Compact now<br/>(context meter)"]
  sum["Everyday model writes<br/>a summary of the older turns"]
  keep["Latest turns stay in full,<br/>summary replaces the rest<br/>in what the model reads"]
  mark["Marker in the thread,<br/>originals stay stored"]

  grow --> soft --> sum
  grow --> hard --> sum
  now --> sum
  sum --> keep --> mark

  linkStyle 0 stroke:#8f7ac9
  linkStyle 1 stroke:#8f7ac9
```
