CHAPTER 03 · The Four Moves: Reduce, Offload, Isolate, Retrieve · 1 / 6
Move 1: Reduce context
Reduction means shrinking what is already in the window. There are two distinct techniques, and the order in which you reach for them matters.
Compaction (reversible, preferred)
Compaction strips out information that is redundant because it still exists somewhere else, usually on the filesystem. In Manus, every tool call has a "full" representation and a "compact" representation. The full version holds the raw output (for example, a complete search result) and is stored in the sandbox. The compact version keeps only a reference, such as a file path.
The clean example from Part 2: if an agent writes a 500-line code file, the chat history should not contain the file's contents. It should contain only the path, for example "Output saved to /src/main.py." If the agent needs the contents later, it simply re-reads the file.
The crucial property is that compaction is reversible. Nothing is truly lost, because the full version is on disk. Manus applies compaction to older, "stale" tool results (ones the agent has already used to make a decision) while keeping newer results in full so they can still guide the next step.
Summarization (lossy, used only when needed)
Summarization uses the model itself to condense the history when compaction is no longer freeing enough space. This is lossy: real detail is thrown away permanently, which is why it is the second choice, not the first.
Two practical details make Manus's summarization work better. First, it is triggered at a chosen threshold (Part 2 gives the example of summarizing once the context passes 128,000 tokens). Second, when it summarizes, Manus keeps the most recent tool calls in their raw, full-detail form. This preserves the model's "rhythm," its formatting style and momentum, and prevents the quality drop that comes from feeding the model a context made entirely of summaries. Manus also uses a fixed schema for its summaries, so every summary has the same fields and is consistent across runs.
The priority order to remember: prefer raw context, then compaction, and only summarize when compaction can no longer free enough space. Lance Martin's notes connect this to Anthropic's "context editing" feature, which automatically clears stale tool calls and results as the window approaches its limit while preserving the conversation flow.