IntermediateAbout 14 min

    Context Compaction

    Read the full article on Substack

    7 min read.

    When a conversation context window fills up, compaction replaces verbose history with a concise rolling summary. Learn how compaction works, what survives vs. what gets dropped, and how to pair it with prompt caching for maximum efficiency.

    Think of it this way: Context compaction is like a smart meeting note-taker: instead of transcribing every word, they capture decisions, action items, and open questions. When the notebook fills up, the transcript gets replaced by a crisp summary — you lose the verbatim banter but keep everything that matters for the next step.

    Only the system prompt is in the window. Add turns until it passes 75%.

    Context window600 / 8,000 tokens
    compact at 75%
    • system prompt (always kept)600

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Compact a long conversation

    Sequence

    Order the compaction pass.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    6. 6Drop a step here
    6 pieces left to place

    Quiz

    20 questions
    Question 1 of 20
    Score: 0

    At what fill percentage do most systems trigger context compaction?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going