Treat the context window like money. You have a fixed amount, everything you add spends some of it, and the interesting question is what you refuse to buy.

Write down the budget for a request before you build the prompt. So many tokens for the system instructions, so many for retrieved material, so many held back for the model's own answer. Once the numbers are on paper, the tradeoffs stop being abstract. You can see that the fourth retrieved document is costing you room you would rather leave for the response.

Two habits pay off quickly. First, measure what each section actually costs on real inputs, not on a tidy example. Conversation history and tool output are the parts that quietly balloon. Second, decide the order of cuts ahead of time: when a request runs long, you already know that old turns get summarized before the retrieved passages get trimmed.

A budget you set on purpose beats a window you let fill up on its own. The second one always fills with the wrong things.