Compacting a conversation
A model can only read so much at once. In a long conversation the history
fills its context window, and sooner or later something has to give. OAR gives
you two ways out: you can start a fresh conversation that carries a summary
with /, and some providers shrink their own context automatically.
The context-window display (the 🧠 button) is on The context window; this page only covers compacting.
/compact #
Type / in the composer and send it. The command is also offered by
the composer's autocomplete when you type /. OAR asks you to confirm
(Compact this conversation into a new one with carry-over summary?), then:
- It creates a new conversation, titled like the old one with (compacted) added.
- It archives the old conversation. The old one is kept in full and stays readable in the archived list, see Conversation list.
- It opens the new conversation, empty, with the summary waiting. Any other browser that has the old conversation open is moved to the new one too.
The summary is put in front of the first message you send in the new conversation: the agent receives it under [Carry-over context from previous compacted conversation], followed by your text under [New user request]. Your own bubble shows only what you typed. After that first message the summary is used up; later turns carry whatever the agent itself keeps in its history.
/ takes no instruction. It only works as the whole message, without
attachments, in a conversation that is not archived. If you add text after it,
the message is not treated as a command and goes to the agent as ordinary
text. OAR does not wait for a running turn or stop it, so send / when
the agent is idle.
The new conversation is a fresh start
Only the title and the summary are copied. The new conversation does not continue the old agent session, so the agent has no memory of the old conversation beyond the summary. Nothing in the app links the two conversations; to find the old one, look in the archived list. Provider, model and folder are not copied: choose them as you would for any new conversation. Pinned messages are not copied either.
What the summary holds #
The summary is built from the old conversation's text messages, without asking a model to write it:
- the conversation title;
- up to 16 messages, yours and the agent's, oldest first, each reduced to one line and cut to 260 characters;
- at most 3,500 characters in all, so a long summary loses its end.
The 16 are chosen from the 24 most recent messages, and the oldest of those come first. In a conversation with more than 24 messages, the newest 8 are therefore left out of the summary. Messages without text use up a place but add nothing.
Nothing else travels: no tool output, files, images, thinking or the agent's plans. If the old conversation had no text, the summary says so. The new conversation gets a rough reminder of the topic, not a faithful record. Tell the agent again in your first message anything important, in particular the latest steps.
Automatic compaction #
Some providers compact a long conversation on their own, in place. The conversation stays the same one, with the same agent session; the provider replaces older history with a shorter version when the window nears its limit. No confirmation is asked.
| Provider | When it compacts |
|---|---|
| Claude | When the context reaches the auto-compact window, see below. By default that is close to the model's own limit (around 967k tokens on a 1M-context model), so long conversations rarely get there. |
| DeepSeek Added in 0.9.17 | As Claude, at the auto-compact window. Left at Auto, a DeepSeek chat compacts at 400k tokens, well below the models' 1M window. |
| GitHub Copilot and OpenAI, SDK engine | In the background at 80% of the context window, and as a blocking compaction at 95%. |
While it runs, a message you send is held in the queue (the send button reads Queue) and goes in once the compaction has ended.
What you see #
On Claude, DeepSeek and Claude Cloud, the transcript shows a compaction as a full-width line, and the same point appears as a dot beside the scrollbar:
- Added in 0.9.8 While it runs (Claude and DeepSeek only), the line reads Compacting context… above the running turn, and the turn's bubble says Compacting the conversation….
- When it ends, the same line becomes Context compacted · 120k → 40k tokens with the real numbers. If only the earlier size is known, it reads Context compacted · was 120k tokens.
- A compaction that ends without a result leaves no line.
On Claude Cloud the line appears only when the compaction has ended, and shows what the session reports.
On the SDK engine (GitHub Copilot and OpenAI) the progress shows as activity lines in the running turn instead: Compacting the conversation context…, then Context compacted (removed 12 messages, 30k tokens) with the real numbers, or Context compaction failed: reason.
The auto-compact window #
On Claude and DeepSeek, you can choose how much context a conversation may collect before it compacts. Smaller windows compact sooner and keep each turn cheaper. The setting belongs to the conversation.
Open the conversation's 🧠 context button and move the Auto-compact window slider. It has seven stops:
| Stop | Meaning |
|---|---|
| Auto | The default. Claude Code chooses a window suited to the model. On DeepSeek, Auto means 400k: the relay sets that window unless you choose another stop. |
| 100k, 150k, 200k, 300k, 500k, 1M | The conversation compacts when its context reaches this many tokens. |
Things to know:
- The smallest window is 100k. Claude Code ignores anything lower and falls back to its own default, so the slider does not offer it.
- The window cannot exceed the model's own limit. A 1M window on a model with a smaller context window has no effect beyond that smaller limit.
- The slider saves when you close the modal. Moving it only changes the label and the notes under it.
- A running session restarts once to apply it. Claude Code reads the window only when it starts. Before your next message OAR restarts the agent process, when nothing is running in it, and the reply says so: Restarted the session to apply the compaction window (Auto → 100k). The note under the slider tells you what the change waits for: Applies after the current turn., Applies when background work has finished. or Applies on the next message (the session restarts once).
- A window below what the conversation already uses compacts it at once. The slider warns you: The conversation will be compacted on the next message.
- The line under the slider shows the window in force and where it came from: your setting, the model default or the environment. It fills in after the conversation's first turn.
The environment variable CLAUDE_ can also set the
window. When Claude Code reports that it took the window from there, the line
under the slider reads from CLAUDE_CODE_AUTO_COMPACT_WINDOW.
Where sessions run under tmux (Linux and macOS), setting the variable for the
relay does not hand it on to Claude Code: see
which variables reach the agents.
What is lost and what is kept #
/ |
Automatic compaction | |
|---|---|---|
| Conversation | A new one; the old one is archived whole. | The same one. |
| Transcript | The old transcript stays in the archived conversation; the new one starts empty. | Unchanged. Every message stays in the transcript, with the compaction line where it happened (Claude, DeepSeek, Claude Cloud). |
| What the agent knows | The summary only: a few messages from the recent past, at most 3,500 characters. | A shorter version of its history, written by the provider. |
| Pinned messages | Stay with the old conversation. | Stay. |
| Provider, model, folder | Not copied. | Unchanged. |
By provider #
/ |
Automatic compaction | |
|---|---|---|
| GitHub Copilot and OpenAI, SDK engine | Yes | Yes, at 80% and 95% of the window. Activity lines show it. |
| GitHub Copilot and OpenAI, extension engine | Yes | OAR sets and shows nothing. |
| Claude | Yes | Yes. Auto-compact window, transcript line, dot beside the scrollbar. |
| DeepSeek Added in 0.9.17 | Yes | As Claude; the window is 400k unless you choose another one. |
| Claude Cloud | Yes | The transcript line, when the session reports a compaction; no window setting. |
| Cursor | Yes | OAR sets and shows nothing; no window setting. |
| Grok | Yes | OAR sets and shows nothing; no window setting. |
/ works the same everywhere because it never uses a provider's own
compaction: it only starts a new conversation. "OAR sets and shows nothing"
means OAR neither triggers a compaction nor marks one in the transcript; the
provider's own agent may still manage its context.